Re: [PATCH 1/6] staging: ks7010: use GENMASK instead of custom defines in SME_WEP_VAL_MASK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 26, 2018 at 10:33 AM, Dan Carpenter
<dan.carpenter@xxxxxxxxxx> wrote:
> On Fri, Mar 23, 2018 at 05:26:01PM +0100, Sergio Paracuellos wrote:
>> This commits replaces custom defines that were been used
>> to define a mask using GENMASK macro from linux bitops
>> header file.
>>
>> With this change the "WARNING: line over 80 characters"
>> warning message reported by checkpatch script is also
>> removed.
>>
>> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@xxxxxxxxx>
>> ---
>>  drivers/staging/ks7010/ks_wlan.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
>> index aeabbe3..ff6b65a 100644
>> --- a/drivers/staging/ks7010/ks_wlan.h
>> +++ b/drivers/staging/ks7010/ks_wlan.h
>> @@ -87,7 +87,7 @@ enum {
>>  #define SME_WEP_VAL2        BIT(6)
>>  #define SME_WEP_VAL3        BIT(7)
>>  #define SME_WEP_VAL4        BIT(8)
>> -#define SME_WEP_VAL_MASK    (SME_WEP_VAL1 | SME_WEP_VAL2 | SME_WEP_VAL3 | SME_WEP_VAL4)
>> +#define SME_WEP_VAL_MASK    GENMASK(8, 5)
>
> The original seems more readable to me.

Really? Name of the mask is pretty the same as the other names of bit
defines so just looking at this and involved bits I think using
GENMASK
is more clean and clear. But it is just my opinion :).

I didn't see this mail before sending v3 of the patch series in which
I correct the blank line between definitions and code normal
statements that
you point me out. So if this patch is no sense and the original code
is mode readable skip this patch in the series, please.

Thanks for review, Dan.

>
> regards,
> dan carpenter
>

Best regards,
   Sergio Paracuellos
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux