Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628258 > unrolled thread
| Started by | Stuart Yoder <stuyoder@gmail.com> |
|---|---|
| First post | 2017-04-21 15:40 +0200 |
| Last post | 2017-04-21 19:10 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] bus: fsl-mc: dpio: fix alter FQ state command Stuart Yoder <stuyoder@gmail.com> - 2017-04-21 15:40 +0200
Re: [PATCH] bus: fsl-mc: dpio: fix alter FQ state command Horia Geantă <horia.geanta@nxp.com> - 2017-04-21 16:00 +0200
Re: [PATCH] bus: fsl-mc: dpio: fix alter FQ state command Dan Carpenter <dan.carpenter@oracle.com> - 2017-04-21 19:10 +0200
| From | Stuart Yoder <stuyoder@gmail.com> |
|---|---|
| Date | 2017-04-21 15:40 +0200 |
| Subject | Re: [PATCH] bus: fsl-mc: dpio: fix alter FQ state command |
| Message-ID | <tyGX0-6mH-21@gated-at.bofh.it> |
On Fri, Apr 21, 2017 at 7:00 AM, Horia Geantă <horia.geanta@nxp.com> wrote:
>
> When checking the response verb, the valid bit should be masked out,
> since its value flips depending on what Response Register
> (RR0 /RR1) it's been read from.
>
> Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
> Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
> ---
> drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
> index 2a3ea29d9b43..5d020fb98c66 100644
> --- a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
> +++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
> @@ -963,7 +963,7 @@ int qbman_swp_alt_fq_state(struct qbman_swp *s, u32 fqid,
> }
>
> /* Decode the outcome */
> - WARN_ON(r->verb != alt_fq_verb);
> + WARN_ON((r->verb & 0x7f) != alt_fq_verb);
Don't use magic constants like that. Create a #define for the valid bit.
Thanks,
Stuart
[toc] | [next] | [standalone]
| From | Horia Geantă <horia.geanta@nxp.com> |
|---|---|
| Date | 2017-04-21 16:00 +0200 |
| Message-ID | <tyHgm-6ts-9@gated-at.bofh.it> |
| In reply to | #1628258 |
On 4/21/2017 4:31 PM, Stuart Yoder wrote:
> On Fri, Apr 21, 2017 at 7:00 AM, Horia Geantă <horia.geanta@nxp.com> wrote:
>>
>> When checking the response verb, the valid bit should be masked out,
>> since its value flips depending on what Response Register
>> (RR0 /RR1) it's been read from.
>>
>> Fixes: 321eecb06bfb ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
>> Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
>> ---
>> drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
>> index 2a3ea29d9b43..5d020fb98c66 100644
>> --- a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
>> +++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
>> @@ -963,7 +963,7 @@ int qbman_swp_alt_fq_state(struct qbman_swp *s, u32 fqid,
>> }
>>
>> /* Decode the outcome */
>> - WARN_ON(r->verb != alt_fq_verb);
>> + WARN_ON((r->verb & 0x7f) != alt_fq_verb);
>
> Don't use magic constants like that. Create a #define for the valid bit.
>
Just looking at the surrounding code, this seems the preferred way to
mask the valid bit.
Though there are two defines that could be used in this case:
#define QB_VALID_BIT ((u32)0x80)
#define QBMAN_RESULT_MASK 0x7f
Let me know whether keeping code similar would be preferred or not.
Thanks,
Horia
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2017-04-21 19:10 +0200 |
| Message-ID | <tyKef-8vc-53@gated-at.bofh.it> |
| In reply to | #1628270 |
On Fri, Apr 21, 2017 at 01:50:24PM +0000, Horia Geantă wrote: > Let me know whether keeping code similar would be preferred or not. > Keeping the code similar to the surrounding is never a valid argument but especially not in staging/. If only 1 line is nice in the whole file, at least that's better than nothing. regards, dan carpenter
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web