OSDN Git Service

staging: sm750fb: replace PADDING macro with ALIGN
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 26 Oct 2015 07:05:52 +0000 (09:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Oct 2015 08:04:57 +0000 (17:04 +0900)
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@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/sm750.c
drivers/staging/sm750fb/sm750.h
drivers/staging/sm750fb/sm750_hw.c

index 3fbcee6..e046123 100644 (file)
@@ -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;
index 2a785ca..81e856e 100644 (file)
@@ -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;
 
 
index 8343d2b..8e7daf6 100644 (file)
@@ -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)|