On Tue, Jul 07, 2015 at 01:44:36PM +0530, Sudip Mukherjee wrote: > Define and use some new macros to work with different situations > based on little-endian and big-endian. > > Signed-off-by: Sudip Mukherjee <sudip@xxxxxxxxxxxxxxx> > --- > drivers/staging/sm7xxfb/sm7xx.h | 19 ++++++++++++++++ > drivers/staging/sm7xxfb/sm7xxfb.c | 48 ++++++++------------------------------- > 2 files changed, 29 insertions(+), 38 deletions(-) > > diff --git a/drivers/staging/sm7xxfb/sm7xx.h b/drivers/staging/sm7xxfb/sm7xx.h > index 31a21bd..6905177 100644 > --- a/drivers/staging/sm7xxfb/sm7xx.h > +++ b/drivers/staging/sm7xxfb/sm7xx.h > @@ -95,3 +95,22 @@ struct modeinit { > unsigned char init_cr30_cr4d[SIZE_CR30_CR4D]; > unsigned char init_cr90_cra7[SIZE_CR90_CRA7]; > }; > + > +#ifdef __BIG_ENDIAN > +#define pal_rgb(r, g, b, val) (((r & 0xf800) >> 8) | \ > + ((g & 0xe000) >> 13) | \ > + ((g & 0x1c00) << 3) | \ > + ((b & 0xf800) >> 3)) > +#define big_addr 0x800000 > +#define mmio_addr 0x00800000 > +#define seqw17 smtc_seqw(0x17, 0x30) > +#define big_pixel_depth(p, d) {if (p == 24) {p = 32; d = 32; } } > +#define big_swap(p) ((p & 0xff00ff00 >> 8) | (p & 0x00ff00ff << 8)) > +#else > +#define pal_rgb(r, g, b, val) val > +#define big_addr 0 > +#define mmio_addr 0x00c00000 > +#define seqw17 Odd, empty macros are not good, because: > -#ifdef __BIG_ENDIAN > if (sfb->fb->var.bits_per_pixel == 32) > - smtc_seqw(0x17, 0x30); > -#endif > + seqw17; That just looks wrong :( _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel