From e3a3f9f5123683bc87ce70189c9912a15b76b91b Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Mon, 26 Oct 2015 09:05:52 +0200 Subject: [PATCH] staging: sm750fb: replace PADDING macro with ALIGN 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 Signed-off-by: Greg Kroah-Hartman --- 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 3fbcee68c567..e046123b4792 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 2a785cafe1dd..81e856e4b63f 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 8343d2b8542e..8e7daf69afec 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.39.5