All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Staging: iio: use the BIT macro in .h and adc
@ 2015-03-22 18:17 Haneen Mohammed
  2015-03-22 18:23 ` [PATCH 1/2] Staging: iio: use the BIT macro in .h files Haneen Mohammed
  2015-03-22 18:28 ` [PATCH 2/2] Staging: iio: use the BIT macro in adc Haneen Mohammed
  0 siblings, 2 replies; 7+ messages in thread
From: Haneen Mohammed @ 2015-03-22 18:17 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Haneen Mohammed

This patchset replace bit shifting on 0,1,2, and 3 with the BIT(x) macro.
Issue addressed by checkpatch.pl with --strict flag.

This was done with the help of the following Coccinelle script:

@r1@ 
constant int g; 
@@
(
0<<g
|
1<<g
|
2<<g
|
3<<g
)

@script:python b@
g2 <<r1.g;
y;
@@
coccinelle.y = int(g2) + 1

@c@
constant int r1.g;
identifier b.y;
@@
(
-(1 << g)
+BIT(g)
|
-(0 << g)
+ 0
|
-(2 << g)
+BIT(y)
|
-(3 << g)
+(BIT(y)| BIT(g))
)


Haneen Mohammed (2):
  Staging: iio: use the BIT macro in .h files
  Staging: iio: use the BIT macro in adc

 drivers/staging/iio/accel/adis16201.h | 18 +++++-----
 drivers/staging/iio/accel/adis16203.h | 24 ++++++-------
 drivers/staging/iio/accel/adis16204.h | 22 ++++++------
 drivers/staging/iio/accel/adis16209.h | 22 ++++++------
 drivers/staging/iio/accel/adis16220.h | 40 ++++++++++-----------
 drivers/staging/iio/accel/adis16240.h | 30 ++++++++--------
 drivers/staging/iio/adc/ad7192.c      | 64 +++++++++++++++++-----------------
 drivers/staging/iio/adc/ad7280a.c     | 58 +++++++++++++++----------------
 drivers/staging/iio/adc/ad7280a.h     |  8 ++---
 drivers/staging/iio/adc/ad7780.c      | 18 +++++-----
 drivers/staging/iio/adc/ad7816.c      |  2 +-
 drivers/staging/iio/adc/mxs-lradc.c   | 65 ++++++++++++++++++-----------------
 drivers/staging/iio/adc/spear_adc.c   |  6 ++--
 13 files changed, 189 insertions(+), 188 deletions(-)

-- 
1.9.1



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

end of thread, other threads:[~2015-03-25 23:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-22 18:17 [PATCH 0/2] Staging: iio: use the BIT macro in .h and adc Haneen Mohammed
2015-03-22 18:23 ` [PATCH 1/2] Staging: iio: use the BIT macro in .h files Haneen Mohammed
2015-03-22 18:28 ` [PATCH 2/2] Staging: iio: use the BIT macro in adc Haneen Mohammed
2015-03-23 21:25   ` [Outreachy kernel] " Greg KH
2015-03-24 15:34     ` [PATCH v2] " Haneen Mohammed
2015-03-25 11:15       ` [Outreachy kernel] " Greg KH
2015-03-25 23:23       ` [PATCH v3] " Haneen Mohammed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.