[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0401MB2591DAF5E8813DD27C7AA4F8981A0@VI1PR0401MB2591.eurprd04.prod.outlook.com>
Date: Fri, 21 Apr 2017 13:50:24 +0000
From: Horia Geantă <horia.geanta@....com>
To: Stuart Yoder <stuyoder@...il.com>
CC: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
Roy Pledge <roy.pledge@....com>,
"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Haiying Wang <haiying.wang@....com>,
"Ruxandra Ioana Radulescu" <ruxandra.radulescu@....com>
Subject: Re: [PATCH] bus: fsl-mc: dpio: fix alter FQ state command
On 4/21/2017 4:31 PM, Stuart Yoder wrote:
> On Fri, Apr 21, 2017 at 7:00 AM, Horia Geantă <horia.geanta@....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@....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
Powered by blists - more mailing lists