Re: [PATCH 2/3] staging: iio: ad7280a: Add parentheses to macros

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

 



On Wed, Mar 20, 2019 at 10:38:06AM +0300, Dan Carpenter wrote:
> On Sun, Mar 17, 2019 at 11:53:11PM +0300, Vladimir Petrigo wrote:
> > Fix CHECK Macro argument 'c' may be better as '(c)' to
> > avoid precedence issues
> > 
> > Signed-off-by: Vladimir Petrigo <vladimir.petrigo@xxxxxxxxx>
> > 
> > diff --git a/drivers/staging/iio/adc/ad7280a.c
> > b/drivers/staging/iio/adc/ad7280a.c index d9df126..98cf876
> > 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++
> > b/drivers/staging/iio/adc/ad7280a.c @@ -97,9 +97,9 @@
> >  #define AD7280A_NUM_CH (AD7280A_AUX_ADC_6 - \
> >  					AD7280A_CELL_VOLTAGE_1
> > + 1)
> > 
> > -#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) ((d *
> > AD7280A_CELLS_PER_DEV) + c) -#define
> > AD7280A_CALC_TEMP_CHAN_NUM(d, c) ((d *
> > AD7280A_CELLS_PER_DEV) + \ - c - AD7280A_CELLS_PER_DEV)
> > +#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) (((d) *
> > AD7280A_CELLS_PER_DEV) + (c)) +#define
> > AD7280A_CALC_TEMP_CHAN_NUM(d, c) (((d) *
> > AD7280A_CELLS_PER_DEV) + \ + (c) - AD7280A_CELLS_PER_DEV)
> > 
> >  #define AD7280A_DEVADDR_MASTER 0 define
> >  #AD7280A_DEVADDR_ALL 0x1F
> 
> I don't know how this diff got added to the commit message, but
> obviously we don't want that.
> 
> regards,
> dan carpenter
> 
> > ---
> >  drivers/staging/iio/adc/ad7280a.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> > index d9df126..98cf876 100644
> > --- a/drivers/staging/iio/adc/ad7280a.c
> > +++ b/drivers/staging/iio/adc/ad7280a.c
> > @@ -97,9 +97,9 @@
> >  #define AD7280A_NUM_CH			(AD7280A_AUX_ADC_6 - \
> >  					AD7280A_CELL_VOLTAGE_1 + 1)
> >  
> > -#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) ((d * AD7280A_CELLS_PER_DEV) + c)
> > -#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    ((d * AD7280A_CELLS_PER_DEV) + \
> > -					     c - AD7280A_CELLS_PER_DEV)
> > +#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) (((d) * AD7280A_CELLS_PER_DEV) + (c))
> > +#define AD7280A_CALC_TEMP_CHAN_NUM(d, c)    (((d) * AD7280A_CELLS_PER_DEV) + \
> > +					     (c) - AD7280A_CELLS_PER_DEV)
> >  
> >  #define AD7280A_DEVADDR_MASTER		0
> >  #define AD7280A_DEVADDR_ALL		0x1F
> > -- 
> > 2.7.4
> > 
> > _______________________________________________
> > devel mailing list
> > devel@xxxxxxxxxxxxxxxxxxxxxx
> > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Yes, something went wrong, will fix that in the v2.

Best regards,
Vladimir Petrigo



[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