Re: [Outreachy kernel] Re: [PATCH 2/3] staging: iio: ad7152: Use GENMASK() macro for left shifts

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

 



On 02/19/2017 07:01 AM, sayli karnik wrote:
[...]
>> [...]
>>>  /* CFG2 Register Bit Designations (AD7152_REG_CFG2) */
>>> -#define AD7152_CFG2_OSR(x)           (((x) & 0x3) << 4)
>>> +#define AD7152_CFG2_OSR(x)           GENMASK(((x) & 0x3), 4)
>>
>> The extra parenthesis around (x) & 0x3 are no needed when using the macro
>> (the macro will add them).
>>
> The outer parentheses are certainly not needed but for the ones around
> x, checkpatch.pl complains otherwise-
> CHECK: Macro argument 'x' may be better as '(x)' to avoid precedence issues

The one around x are needed and should stay.

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux