diff options
author | Chen, Gong <gong.chen@linux.intel.com> | 2013-10-18 14:29:07 -0700 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2013-10-21 15:12:01 -0700 |
commit | 10ef6b0dffe404bcc54e94cb2ca1a5b18445a66b (patch) | |
tree | 6450859ffdc4494f2211442dd411b7f189cf326d /drivers/video/sis | |
parent | 88f074f4871a8c212b212b725e4dcdcdb09613c1 (diff) |
bitops: Introduce a more generic BITMASK macro
GENMASK is used to create a contiguous bitmask([hi:lo]). It is
implemented twice in current kernel. One is in EDAC driver, the other
is in SiS/XGI FB driver. Move it to a more generic place for other
usage.
Signed-off-by: Chen, Gong <gong.chen@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Borislav Petkov <bp@suse.de>
Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/video/sis')
-rw-r--r-- | drivers/video/sis/init.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/video/sis/init.c b/drivers/video/sis/init.c index f082ae55c0c9..4f26bc28e60b 100644 --- a/drivers/video/sis/init.c +++ b/drivers/video/sis/init.c @@ -3320,9 +3320,8 @@ SiSSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo) } #ifndef GETBITSTR -#define BITMASK(h,l) (((unsigned)(1U << ((h)-(l)+1))-1)<<(l)) -#define GENMASK(mask) BITMASK(1?mask,0?mask) -#define GETBITS(var,mask) (((var) & GENMASK(mask)) >> (0?mask)) +#define GENBITSMASK(mask) GENMASK(1?mask,0?mask) +#define GETBITS(var,mask) (((var) & GENBITSMASK(mask)) >> (0?mask)) #define GETBITSTR(val,from,to) ((GETBITS(val,from)) << (0?to)) #endif |