staging: comedi: amplc_pci230: Convert macro GAT_CONFIG to static inline function
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Tue, 22 Mar 2016 04:58:51 +0000 (10:28 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
commit094c0741dec38c73793f674293dcd2026d1e77d7
treee0ceca2d02ca04c726ce0a06b51ed80b6f223020
parent896802a8e208997faff6e38d711cd9b13c7a2e23
staging: comedi: amplc_pci230: Convert macro GAT_CONFIG to static inline function

Convert macro GAT_CONFIG to static inline function as static inline
functions are preferred over macros. This change is possible since the
arguments at all call sites have the same type.

This was done using Coccinelle:

@r@
expression e;
@@
- #define GAT_CONFIG(chan, src) e
+ static inline unsigned int pci230_gat_config(unsigned int chan,
+                                              unsigned int src)
+{
+       return ((chan & 3) << 3) | (src & 7);
+}

@r1@
expression dev,reg,chan,src;
@@
-GAT_CONFIG(chan, src)
+pci230_gat_config(chan, src)

Also, the comment describing the macro has been removed manually.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/amplc_pci230.c