The custom macro PADDING differs from standard kernel ALIGN only in parameters order. Replace PADDING with ALIGN and remove it's definition. Signed-off-by: Mike Rapoport <mike.rapoport@xxxxxxxxx> --- drivers/staging/sm750fb/sm750.c | 8 ++++---- drivers/staging/sm750fb/sm750.h | 2 -- drivers/staging/sm750fb/sm750_hw.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 3fbcee6..e046123 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -331,7 +331,7 @@ static int lynxfb_ops_set_par(struct fb_info *info) /* fix structur is not so FIX ... */ line_length = var->xres_virtual * var->bits_per_pixel / 8; - line_length = PADDING(crtc->line_pad, line_length); + line_length = ALIGN(line_length, crtc->line_pad); fix->line_length = line_length; pr_info("fix->line_length = %d\n", fix->line_length); @@ -574,7 +574,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, request = var->xres_virtual * (var->bits_per_pixel >> 3); /* defaulty crtc->channel go with par->index */ - request = PADDING(crtc->line_pad, request); + request = ALIGN(request, crtc->line_pad); request = request * var->yres_virtual; if (crtc->vidmem_size < request) { pr_err("not enough video memory for mode\n"); @@ -865,8 +865,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) par->info = info; /* set info */ - line_length = PADDING(crtc->line_pad, - (var->xres_virtual * var->bits_per_pixel / 8)); + line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8), + crtc->line_pad); info->pseudo_palette = &par->pseudo_palette[0]; info->screen_base = crtc->vScreen; diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 2a785ca..81e856e 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -6,8 +6,6 @@ #define FB_ACCEL_SMI 0xab #define MHZ(x) ((x) * 1000000) -/* align should be 2,4,8,16 */ -#define PADDING(align, data) (((data)+(align)-1)&(~((align) - 1))) extern int smi_indent; diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 8343d2b..8e7daf6 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -330,7 +330,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, reg = var->xres * (var->bits_per_pixel >> 3); /* crtc->channel is not equal to par->index on numeric,be aware of that */ - reg = PADDING(crtc->line_pad, reg); + reg = ALIGN(reg, crtc->line_pad); POKE32(PANEL_FB_WIDTH, FIELD_VALUE(0, PANEL_FB_WIDTH, WIDTH, reg)| @@ -362,7 +362,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, POKE32(CRT_FB_ADDRESS, crtc->oScreen); reg = var->xres * (var->bits_per_pixel >> 3); /* crtc->channel is not equal to par->index on numeric,be aware of that */ - reg = PADDING(crtc->line_pad, reg); + reg = ALIGN(reg, crtc->line_pad); POKE32(CRT_FB_WIDTH, FIELD_VALUE(0, CRT_FB_WIDTH, WIDTH, reg)| -- 2.1.0 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel