Re: [2.6.19 PATCH 5/7] ehea: main header files

From: Michael Neuling
Date: Fri Aug 18 2006 - 14:01:17 EST


> +static inline void ehea_update_sqa(struct ehea_qp *qp, u16 nr_wqes)
> +{
> + struct h_epa epa = qp->epas.kernel;
> + epa_store_acc(epa, QPTEMM_OFFSET(qpx_sqa),
> + EHEA_BMASK_SET(QPX_SQA_VALUE, nr_wqes));
> +}
> +
> +static inline void ehea_update_rq3a(struct ehea_qp *qp, u16 nr_wqes)
> +{
> + struct h_epa epa = qp->epas.kernel;
> + epa_store_acc(epa, QPTEMM_OFFSET(qpx_rq3a),
> + EHEA_BMASK_SET(QPX_RQ1A_VALUE, nr_wqes));
> +}
> +
> +static inline void ehea_update_rq2a(struct ehea_qp *qp, u16 nr_wqes)
> +{
> + struct h_epa epa = qp->epas.kernel;
> + epa_store_acc(epa, QPTEMM_OFFSET(qpx_rq2a),
> + EHEA_BMASK_SET(QPX_RQ1A_VALUE, nr_wqes));
> +}
> +
> +static inline void ehea_update_rq1a(struct ehea_qp *qp, u16 nr_wqes)
> +{
> + struct h_epa epa = qp->epas.kernel;
> + epa_store_acc(epa, QPTEMM_OFFSET(qpx_rq1a),
> + EHEA_BMASK_SET(QPX_RQ1A_VALUE, nr_wqes));
> +}
> +
> +static inline void ehea_update_feca(struct ehea_cq *cq, u32 nr_cqes)
> +{
> + struct h_epa epa = cq->epas.kernel;
> + epa_store_acc(epa, CQTEMM_OFFSET(cqx_feca),
> + EHEA_BMASK_SET(CQX_FECADDER, nr_cqes));
> +}
> +
> +static inline void ehea_reset_cq_n1(struct ehea_cq *cq)
> +{
> + struct h_epa epa = cq->epas.kernel;
> + epa_store_cq(epa, cqx_n1,
> + EHEA_BMASK_SET(CQX_N1_GENERATE_COMP_EVENT, 1));
> +}
> +
> +static inline void ehea_reset_cq_ep(struct ehea_cq *my_cq)
> +{
> + struct h_epa epa = my_cq->epas.kernel;
> + epa_store_acc(epa, CQTEMM_OFFSET(cqx_ep),
> + EHEA_BMASK_SET(CQX_EP_EVENT_PENDING, 0));
> +}

These are almost identical... I'm sure most (if not all) could be merged
into a single function or #define.

Mikey
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/