public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: mxs-lradc: Prefer using the BIT macro
@ 2015-11-09 14:26 Nizam Haider
  2015-11-09 14:40 ` kbuild test robot
  2015-11-15 11:12 ` Jonathan Cameron
  0 siblings, 2 replies; 4+ messages in thread
From: Nizam Haider @ 2015-11-09 14:26 UTC (permalink / raw)
  To: gregkh
  Cc: jic23, knaack.h, lars, pmeerw, marex, stefan.wahren,
	kristina.martsenko, ciorneiioana, hamohammed.sa,
	alexandre.belloni, linux-iio, devel, linux-kernel, Nizam Haider,
	Nizam Haider

Replaces bit shifting on 1 with the BIT(x) macro

Signed-off-by: Nizam Haider <nijamh@cdac.in>
---
 drivers/staging/iio/adc/mxs-lradc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index d997d9c..5f1375c 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -324,7 +324,7 @@ struct mxs_lradc {
 #define	LRADC_DELAY_TRIGGER(x) \
 				(((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
 				LRADC_DELAY_TRIGGER_LRADCS_MASK)
-#define	LRADC_DELAY_KICK			(1 << 20)
+#define	LRADC_DELAY_KICK			BIT(20)
 #define	LRADC_DELAY_TRIGGER_DELAYS_MASK		(0xf << 16)
 #define	LRADC_DELAY_TRIGGER_DELAYS_OFFSET	16
 #define	LRADC_DELAY_TRIGGER_DELAYS(x) \
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: mxs-lradc: Prefer using the BIT macro
  2015-11-09 14:26 [PATCH] iio: adc: mxs-lradc: Prefer using the BIT macro Nizam Haider
@ 2015-11-09 14:40 ` kbuild test robot
  2015-11-15 11:10   ` Jonathan Cameron
  2015-11-15 11:12 ` Jonathan Cameron
  1 sibling, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2015-11-09 14:40 UTC (permalink / raw)
  To: Nizam Haider
  Cc: kbuild-all, gregkh, marex, stefan.wahren, lars, hamohammed.sa,
	linux-iio, Nizam Haider, devel, Nizam Haider, linux-kernel,
	alexandre.belloni, pmeerw, knaack.h, ciorneiioana, jic23

[-- Attachment #1: Type: text/plain, Size: 4567 bytes --]

Hi Nizam,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.3 next-20151109]

url:    https://github.com/0day-ci/linux/commits/Nizam-Haider/iio-adc-mxs-lradc-Prefer-using-the-BIT-macro/20151109-222735
config: sparc64-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=sparc64 

All warnings (new ones prefixed by >>):

   drivers/staging/iio/adc/mxs-lradc.c: In function 'mxs_lradc_complete_touch_event':
>> drivers/staging/iio/adc/mxs-lradc.c:325:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
        (((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
        ^
>> drivers/staging/iio/adc/mxs-lradc.c:734:7: note: in expansion of macro 'LRADC_DELAY_TRIGGER'
          LRADC_DELAY_TRIGGER(1 << TOUCHSCREEN_VCHANNEL1) |
          ^
   drivers/staging/iio/adc/mxs-lradc.c: In function 'mxs_lradc_buffer_preenable':
   drivers/staging/iio/adc/mxs-lradc.c:322:42: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    #define LRADC_DELAY_TRIGGER_LRADCS_MASK  (0xff << 24)
                                             ^
>> drivers/staging/iio/adc/mxs-lradc.c:1308:29: note: in expansion of macro 'LRADC_DELAY_TRIGGER_LRADCS_MASK'
     mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |
                                ^
   drivers/staging/iio/adc/mxs-lradc.c: In function 'mxs_lradc_buffer_postdisable':
   drivers/staging/iio/adc/mxs-lradc.c:322:42: warning: large integer implicitly truncated to unsigned type [-Woverflow]
    #define LRADC_DELAY_TRIGGER_LRADCS_MASK  (0xff << 24)
                                             ^
   drivers/staging/iio/adc/mxs-lradc.c:1327:29: note: in expansion of macro 'LRADC_DELAY_TRIGGER_LRADCS_MASK'
     mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |
                                ^

vim +325 drivers/staging/iio/adc/mxs-lradc.c

06ddd353 Marek Vasut     2013-01-11  309  #define	LRADC_STATUS				0x40
418880f5 Haneen Mohammed 2015-03-26  310  #define	LRADC_STATUS_TOUCH_DETECT_RAW		BIT(0)
06ddd353 Marek Vasut     2013-01-11  311  
bc2c90c9 Marek Vasut     2012-08-12  312  #define	LRADC_CH(n)				(0x50 + (0x10 * (n)))
418880f5 Haneen Mohammed 2015-03-26  313  #define	LRADC_CH_ACCUMULATE			BIT(29)
bc2c90c9 Marek Vasut     2012-08-12  314  #define	LRADC_CH_NUM_SAMPLES_MASK		(0x1f << 24)
bc2c90c9 Marek Vasut     2012-08-12  315  #define	LRADC_CH_NUM_SAMPLES_OFFSET		24
dee05308 Juergen Beisert 2013-09-23  316  #define	LRADC_CH_NUM_SAMPLES(x) \
dee05308 Juergen Beisert 2013-09-23  317  				((x) << LRADC_CH_NUM_SAMPLES_OFFSET)
bc2c90c9 Marek Vasut     2012-08-12  318  #define	LRADC_CH_VALUE_MASK			0x3ffff
bc2c90c9 Marek Vasut     2012-08-12  319  #define	LRADC_CH_VALUE_OFFSET			0
bc2c90c9 Marek Vasut     2012-08-12  320  
bc2c90c9 Marek Vasut     2012-08-12  321  #define	LRADC_DELAY(n)				(0xd0 + (0x10 * (n)))
bc2c90c9 Marek Vasut     2012-08-12  322  #define	LRADC_DELAY_TRIGGER_LRADCS_MASK		(0xff << 24)
bc2c90c9 Marek Vasut     2012-08-12  323  #define	LRADC_DELAY_TRIGGER_LRADCS_OFFSET	24
dee05308 Juergen Beisert 2013-09-23  324  #define	LRADC_DELAY_TRIGGER(x) \
dee05308 Juergen Beisert 2013-09-23 @325  				(((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
dee05308 Juergen Beisert 2013-09-23  326  				LRADC_DELAY_TRIGGER_LRADCS_MASK)
33365872 Nizam Haider    2015-11-09  327  #define	LRADC_DELAY_KICK			BIT(20)
bc2c90c9 Marek Vasut     2012-08-12  328  #define	LRADC_DELAY_TRIGGER_DELAYS_MASK		(0xf << 16)
bc2c90c9 Marek Vasut     2012-08-12  329  #define	LRADC_DELAY_TRIGGER_DELAYS_OFFSET	16
dee05308 Juergen Beisert 2013-09-23  330  #define	LRADC_DELAY_TRIGGER_DELAYS(x) \
dee05308 Juergen Beisert 2013-09-23  331  				(((x) << LRADC_DELAY_TRIGGER_DELAYS_OFFSET) & \
dee05308 Juergen Beisert 2013-09-23  332  				LRADC_DELAY_TRIGGER_DELAYS_MASK)
bc2c90c9 Marek Vasut     2012-08-12  333  #define	LRADC_DELAY_LOOP_COUNT_MASK		(0x1f << 11)

:::::: The code at line 325 was first introduced by commit
:::::: dee05308f6029caed91e1a015cafb1545958ba27 Staging/iio/adc/touchscreen/MXS: add interrupt driven touch detection

:::::: TO: Juergen Beisert <jbe@pengutronix.de>
:::::: CC: Jonathan Cameron <jic23@kernel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 44395 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: mxs-lradc: Prefer using the BIT macro
  2015-11-09 14:40 ` kbuild test robot
@ 2015-11-15 11:10   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2015-11-15 11:10 UTC (permalink / raw)
  To: kbuild test robot, Nizam Haider
  Cc: kbuild-all, gregkh, marex, stefan.wahren, lars, hamohammed.sa,
	linux-iio, Nizam Haider, devel, linux-kernel, alexandre.belloni,
	pmeerw, knaack.h, ciorneiioana

On 09/11/15 14:40, kbuild test robot wrote:
> Hi Nizam,
Wow, this one opens up a can of worms that as far as I can tell is in no
way actually connected to your patch Nizam!
(just in case you were wondering).

I'm not actually certain what did trigger this. 

Right now I haven't found any cases that actually overflow but
maybe I'm missing something...
> 
> [auto build test WARNING on staging/staging-testing]
> [also build test WARNING on v4.3 next-20151109]
> 
> url:    https://github.com/0day-ci/linux/commits/Nizam-Haider/iio-adc-mxs-lradc-Prefer-using-the-BIT-macro/20151109-222735
> config: sparc64-allyesconfig (attached as .config)
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=sparc64 
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/staging/iio/adc/mxs-lradc.c: In function 'mxs_lradc_complete_touch_event':
>>> drivers/staging/iio/adc/mxs-lradc.c:325:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
>         (((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
>         ^
>>> drivers/staging/iio/adc/mxs-lradc.c:734:7: note: in expansion of macro 'LRADC_DELAY_TRIGGER'
>           LRADC_DELAY_TRIGGER(1 << TOUCHSCREEN_VCHANNEL1) |
>           ^
>    drivers/staging/iio/adc/mxs-lradc.c: In function 'mxs_lradc_buffer_preenable':
>    drivers/staging/iio/adc/mxs-lradc.c:322:42: warning: large integer implicitly truncated to unsigned type [-Woverflow]
>     #define LRADC_DELAY_TRIGGER_LRADCS_MASK  (0xff << 24)
>                                              ^
>>> drivers/staging/iio/adc/mxs-lradc.c:1308:29: note: in expansion of macro 'LRADC_DELAY_TRIGGER_LRADCS_MASK'
>      mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |
>                                 ^
>    drivers/staging/iio/adc/mxs-lradc.c: In function 'mxs_lradc_buffer_postdisable':
>    drivers/staging/iio/adc/mxs-lradc.c:322:42: warning: large integer implicitly truncated to unsigned type [-Woverflow]
>     #define LRADC_DELAY_TRIGGER_LRADCS_MASK  (0xff << 24)
>                                              ^
>    drivers/staging/iio/adc/mxs-lradc.c:1327:29: note: in expansion of macro 'LRADC_DELAY_TRIGGER_LRADCS_MASK'
>      mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |
>                                 ^
> 
> vim +325 drivers/staging/iio/adc/mxs-lradc.c
> 
> 06ddd353 Marek Vasut     2013-01-11  309  #define	LRADC_STATUS				0x40
> 418880f5 Haneen Mohammed 2015-03-26  310  #define	LRADC_STATUS_TOUCH_DETECT_RAW		BIT(0)
> 06ddd353 Marek Vasut     2013-01-11  311  
> bc2c90c9 Marek Vasut     2012-08-12  312  #define	LRADC_CH(n)				(0x50 + (0x10 * (n)))
> 418880f5 Haneen Mohammed 2015-03-26  313  #define	LRADC_CH_ACCUMULATE			BIT(29)
> bc2c90c9 Marek Vasut     2012-08-12  314  #define	LRADC_CH_NUM_SAMPLES_MASK		(0x1f << 24)
> bc2c90c9 Marek Vasut     2012-08-12  315  #define	LRADC_CH_NUM_SAMPLES_OFFSET		24
> dee05308 Juergen Beisert 2013-09-23  316  #define	LRADC_CH_NUM_SAMPLES(x) \
> dee05308 Juergen Beisert 2013-09-23  317  				((x) << LRADC_CH_NUM_SAMPLES_OFFSET)
> bc2c90c9 Marek Vasut     2012-08-12  318  #define	LRADC_CH_VALUE_MASK			0x3ffff
> bc2c90c9 Marek Vasut     2012-08-12  319  #define	LRADC_CH_VALUE_OFFSET			0
> bc2c90c9 Marek Vasut     2012-08-12  320  
> bc2c90c9 Marek Vasut     2012-08-12  321  #define	LRADC_DELAY(n)				(0xd0 + (0x10 * (n)))
> bc2c90c9 Marek Vasut     2012-08-12  322  #define	LRADC_DELAY_TRIGGER_LRADCS_MASK		(0xff << 24)
> bc2c90c9 Marek Vasut     2012-08-12  323  #define	LRADC_DELAY_TRIGGER_LRADCS_OFFSET	24
> dee05308 Juergen Beisert 2013-09-23  324  #define	LRADC_DELAY_TRIGGER(x) \
> dee05308 Juergen Beisert 2013-09-23 @325  				(((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
> dee05308 Juergen Beisert 2013-09-23  326  				LRADC_DELAY_TRIGGER_LRADCS_MASK)
> 33365872 Nizam Haider    2015-11-09  327  #define	LRADC_DELAY_KICK			BIT(20)
> bc2c90c9 Marek Vasut     2012-08-12  328  #define	LRADC_DELAY_TRIGGER_DELAYS_MASK		(0xf << 16)
> bc2c90c9 Marek Vasut     2012-08-12  329  #define	LRADC_DELAY_TRIGGER_DELAYS_OFFSET	16
> dee05308 Juergen Beisert 2013-09-23  330  #define	LRADC_DELAY_TRIGGER_DELAYS(x) \
> dee05308 Juergen Beisert 2013-09-23  331  				(((x) << LRADC_DELAY_TRIGGER_DELAYS_OFFSET) & \
> dee05308 Juergen Beisert 2013-09-23  332  				LRADC_DELAY_TRIGGER_DELAYS_MASK)
> bc2c90c9 Marek Vasut     2012-08-12  333  #define	LRADC_DELAY_LOOP_COUNT_MASK		(0x1f << 11)
> 
> :::::: The code at line 325 was first introduced by commit
> :::::: dee05308f6029caed91e1a015cafb1545958ba27 Staging/iio/adc/touchscreen/MXS: add interrupt driven touch detection
> 
> :::::: TO: Juergen Beisert <jbe@pengutronix.de>
> :::::: CC: Jonathan Cameron <jic23@kernel.org>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: mxs-lradc: Prefer using the BIT macro
  2015-11-09 14:26 [PATCH] iio: adc: mxs-lradc: Prefer using the BIT macro Nizam Haider
  2015-11-09 14:40 ` kbuild test robot
@ 2015-11-15 11:12 ` Jonathan Cameron
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2015-11-15 11:12 UTC (permalink / raw)
  To: Nizam Haider, gregkh
  Cc: knaack.h, lars, pmeerw, marex, stefan.wahren, kristina.martsenko,
	ciorneiioana, hamohammed.sa, alexandre.belloni, linux-iio, devel,
	linux-kernel, Nizam Haider

On 09/11/15 14:26, Nizam Haider wrote:
> Replaces bit shifting on 1 with the BIT(x) macro
> 
> Signed-off-by: Nizam Haider <nijamh@cdac.in>
Applied to the togreg branch of iio.git - guess I'm going to start
getting the autobuilder warnings shortly!

Will be pushed out as testing for the autobuilders to play with it.

Jonathan
> ---
>  drivers/staging/iio/adc/mxs-lradc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index d997d9c..5f1375c 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -324,7 +324,7 @@ struct mxs_lradc {
>  #define	LRADC_DELAY_TRIGGER(x) \
>  				(((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
>  				LRADC_DELAY_TRIGGER_LRADCS_MASK)
> -#define	LRADC_DELAY_KICK			(1 << 20)
> +#define	LRADC_DELAY_KICK			BIT(20)
>  #define	LRADC_DELAY_TRIGGER_DELAYS_MASK		(0xf << 16)
>  #define	LRADC_DELAY_TRIGGER_DELAYS_OFFSET	16
>  #define	LRADC_DELAY_TRIGGER_DELAYS(x) \
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-15 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-09 14:26 [PATCH] iio: adc: mxs-lradc: Prefer using the BIT macro Nizam Haider
2015-11-09 14:40 ` kbuild test robot
2015-11-15 11:10   ` Jonathan Cameron
2015-11-15 11:12 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox