fbdev: Remove FBINFO_FLAG_DEFAULT from framebuffer_alloc()'ed structs
authorThomas Zimmermann <tzimmermann@suse.de>
Sat, 15 Jul 2023 18:51:56 +0000 (20:51 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 24 Jul 2023 14:50:39 +0000 (16:50 +0200)
The flag FBINFO_FLAG_DEFAULT is 0 and has no effect, as struct
fbinfo.flags has been allocated to zero by framebuffer_alloc(). So
do not set it.

Flags should signal differences from the default values. After cleaning
up all occurrences of FBINFO_DEFAULT, the token will be removed.

v4:
* clarify commit message (Geert, Dan)
v2:
* fix commit message (Miguel)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Jaya Kumar <jayalk@intworks.biz>
Cc: Helge Deller <deller@gmx.de>
Cc: Peter Jones <pjones@redhat.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Maik Broemme <mbroemme@libmpq.org>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Michal Januszewski <spock@gentoo.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230715185343.7193-15-tzimmermann@suse.de
24 files changed:
drivers/video/fbdev/arcfb.c
drivers/video/fbdev/aty/aty128fb.c
drivers/video/fbdev/broadsheetfb.c
drivers/video/fbdev/da8xx-fb.c
drivers/video/fbdev/efifb.c
drivers/video/fbdev/goldfishfb.c
drivers/video/fbdev/gxt4500.c
drivers/video/fbdev/hecubafb.c
drivers/video/fbdev/imxfb.c
drivers/video/fbdev/intelfb/intelfbdrv.c
drivers/video/fbdev/metronomefb.c
drivers/video/fbdev/mx3fb.c
drivers/video/fbdev/omap/omapfb_main.c
drivers/video/fbdev/omap2/omapfb/omapfb-main.c
drivers/video/fbdev/s3c-fb.c
drivers/video/fbdev/sh_mobile_lcdcfb.c
drivers/video/fbdev/sis/sis_main.c
drivers/video/fbdev/sm501fb.c
drivers/video/fbdev/sm712fb.c
drivers/video/fbdev/uvesafb.c
drivers/video/fbdev/vesafb.c
drivers/video/fbdev/vfb.c
drivers/video/fbdev/vga16fb.c
drivers/video/fbdev/xen-fbfront.c

index 9aaea3b..cff11cb 100644 (file)
@@ -546,7 +546,6 @@ static int arcfb_probe(struct platform_device *dev)
        par->c2io_addr = c2io_addr;
        par->cslut[0] = 0x00;
        par->cslut[1] = 0x06;
-       info->flags = FBINFO_FLAG_DEFAULT;
        spin_lock_init(&par->lock);
        if (irq) {
                par->irq = irq;
index 2d9320a..b44fc78 100644 (file)
@@ -1927,7 +1927,6 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        /* fill in info */
        info->fbops = &aty128fb_ops;
-       info->flags = FBINFO_FLAG_DEFAULT;
 
        par->lcd_on = default_lcd_on;
        par->crt_on = default_crt_on;
index f7b69d5..bace1f0 100644 (file)
@@ -1069,7 +1069,7 @@ static int broadsheetfb_probe(struct platform_device *dev)
 
        mutex_init(&par->io_lock);
 
-       info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB;
+       info->flags = FBINFO_VIRTFB;
 
        info->fbdefio = &broadsheetfb_defio;
        fb_deferred_io_init(info);
index 60cd128..988dedc 100644 (file)
@@ -1463,7 +1463,6 @@ static int fb_probe(struct platform_device *device)
        da8xx_fb_var.bits_per_pixel = lcd_cfg->bpp;
 
        /* Initialize fbinfo */
-       da8xx_fb_info->flags = FBINFO_FLAG_DEFAULT;
        da8xx_fb_info->fix = da8xx_fb_fix;
        da8xx_fb_info->var = da8xx_fb_var;
        da8xx_fb_info->fbops = &da8xx_fb_ops;
index 3d7be69..3391c8e 100644 (file)
@@ -555,7 +555,6 @@ static int efifb_probe(struct platform_device *dev)
        info->fbops = &efifb_ops;
        info->var = efifb_defined;
        info->fix = efifb_fix;
-       info->flags = FBINFO_FLAG_DEFAULT;
 
        orientation = drm_get_panel_orientation_quirk(efifb_defined.xres,
                                                      efifb_defined.yres);
index 6fa2108..ef2528c 100644 (file)
@@ -212,7 +212,6 @@ static int goldfish_fb_probe(struct platform_device *pdev)
        height = readl(fb->reg_base + FB_GET_HEIGHT);
 
        fb->fb.fbops            = &goldfish_fb_ops;
-       fb->fb.flags            = FBINFO_FLAG_DEFAULT;
        fb->fb.pseudo_palette   = fb->cmap;
        fb->fb.fix.type         = FB_TYPE_PACKED_PIXELS;
        fb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
index 5f42d3d..8d09765 100644 (file)
@@ -690,8 +690,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 #endif
 
        info->fbops = &gxt4500_ops;
-       info->flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_XPAN |
-                                           FBINFO_HWACCEL_YPAN;
+       info->flags = FBINFO_HWACCEL_XPAN | FBINFO_HWACCEL_YPAN;
 
        err = fb_alloc_cmap(&info->cmap, 256, 0);
        if (err) {
index 5043d08..c493855 100644 (file)
@@ -189,7 +189,7 @@ static int hecubafb_probe(struct platform_device *dev)
        par->send_command = apollo_send_command;
        par->send_data = apollo_send_data;
 
-       info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB;
+       info->flags = FBINFO_VIRTFB;
 
        info->fbdefio = &hecubafb_defio;
        fb_deferred_io_init(info);
index adf3669..5b1ddce 100644 (file)
@@ -698,8 +698,7 @@ static int imxfb_init_fbinfo(struct platform_device *pdev)
        info->var.vmode                 = FB_VMODE_NONINTERLACED;
 
        info->fbops                     = &imxfb_ops;
-       info->flags                     = FBINFO_FLAG_DEFAULT |
-                                         FBINFO_READS_FAST;
+       info->flags                     = FBINFO_READS_FAST;
 
        np = pdev->dev.of_node;
        info->var.grayscale = of_property_read_bool(np,
index 85a6341..3d334f1 100644 (file)
@@ -1098,7 +1098,6 @@ static int intelfb_set_fbinfo(struct intelfb_info *dinfo)
 
        DBG_MSG("intelfb_set_fbinfo\n");
 
-       info->flags = FBINFO_FLAG_DEFAULT;
        info->fbops = &intel_fb_ops;
        info->pseudo_palette = dinfo->pseudo_palette;
 
index 12565ee..eb15b9d 100644 (file)
@@ -642,7 +642,7 @@ static int metronomefb_probe(struct platform_device *dev)
        if (retval < 0)
                goto err_free_irq;
 
-       info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB;
+       info->flags = FBINFO_VIRTFB;
 
        info->fbdefio = &metronomefb_defio;
        fb_deferred_io_init(info);
index 63c186e..3a05300 100644 (file)
@@ -1406,7 +1406,6 @@ static struct fb_info *mx3fb_init_fbinfo(struct device *dev,
        fbi->var.activate       = FB_ACTIVATE_NOW;
 
        fbi->fbops              = ops;
-       fbi->flags              = FBINFO_FLAG_DEFAULT;
        fbi->pseudo_palette     = mx3fbi->pseudo_palette;
 
        mutex_init(&mx3fbi->mutex);
index ad65554..783bbe0 100644 (file)
@@ -1451,7 +1451,6 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
        int                             r = 0;
 
        info->fbops = &omapfb_ops;
-       info->flags = FBINFO_FLAG_DEFAULT;
 
        strscpy(fix->id, MODULE_NAME, sizeof(fix->id));
 
index c053806..b5acad8 100644 (file)
@@ -1732,7 +1732,6 @@ static int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi)
        int r = 0;
 
        fbi->fbops = &omapfb_ops;
-       fbi->flags = FBINFO_FLAG_DEFAULT;
        fbi->pseudo_palette = fbdev->pseudo_palette;
 
        if (ofbi->region->size == 0) {
index 1ce707e..c50b92c 100644 (file)
@@ -1244,7 +1244,6 @@ static int s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
        fbinfo->var.vmode       = FB_VMODE_NONINTERLACED;
        fbinfo->var.bits_per_pixel = windata->default_bpp;
        fbinfo->fbops           = &s3c_fb_ops;
-       fbinfo->flags           = FBINFO_FLAG_DEFAULT;
        fbinfo->pseudo_palette  = &win->pseudo_palette;
 
        /* prepare to actually start the framebuffer */
index 0adb2ba..1364daf 100644 (file)
@@ -1565,7 +1565,6 @@ sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl)
 
        ovl->info = info;
 
-       info->flags = FBINFO_FLAG_DEFAULT;
        info->fbops = &sh_mobile_lcdc_overlay_ops;
        info->device = priv->dev;
        info->screen_buffer = ovl->fb_mem;
@@ -2052,7 +2051,6 @@ sh_mobile_lcdc_channel_fb_init(struct sh_mobile_lcdc_chan *ch,
 
        ch->info = info;
 
-       info->flags = FBINFO_FLAG_DEFAULT;
        info->fbops = &sh_mobile_lcdc_ops;
        info->device = priv->dev;
        info->screen_buffer = ch->fb_mem;
index 2beb351..0f5374f 100644 (file)
@@ -6477,8 +6477,6 @@ error_3:  vfree(ivideo->bios_abase);
                                     FBINFO_HWACCEL_COPYAREA    |
                                     FBINFO_HWACCEL_FILLRECT    |
                                     ((ivideo->accel) ? 0 : FBINFO_HWACCEL_DISABLED);
-#else
-               sis_fb_info->flags = FBINFO_FLAG_DEFAULT;
 #endif
                sis_fb_info->var = ivideo->default_var;
                sis_fb_info->fix = ivideo->sisfb_fix;
index 46951a0..65c799a 100644 (file)
@@ -1731,7 +1731,7 @@ static int sm501fb_init_fb(struct fb_info *fb, enum sm501_controller head,
                par->ops.fb_cursor = NULL;
 
        fb->fbops = &par->ops;
-       fb->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST |
+       fb->flags = FBINFO_READS_FAST |
                FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT |
                FBINFO_HWACCEL_XPAN | FBINFO_HWACCEL_YPAN;
 
index f929091..db129ed 100644 (file)
@@ -1528,7 +1528,6 @@ static int smtcfb_pci_probe(struct pci_dev *pdev,
        sfb->fb = info;
        sfb->chip_id = ent->device;
        sfb->pdev = pdev;
-       info->flags = FBINFO_FLAG_DEFAULT;
        info->fbops = &smtcfb_ops;
        info->fix = smtcfb_fix;
        info->var = smtcfb_var;
index 78d85da..df2574d 100644 (file)
@@ -1508,8 +1508,7 @@ static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
                par->ypan = 0;
        }
 
-       info->flags = FBINFO_FLAG_DEFAULT |
-                       (par->ypan ? FBINFO_HWACCEL_YPAN : 0);
+       info->flags = (par->ypan ? FBINFO_HWACCEL_YPAN : 0);
 
        if (!par->ypan)
                uvesafb_ops.fb_pan_display = NULL;
index 7451c60..422a1c5 100644 (file)
@@ -457,7 +457,7 @@ static int vesafb_probe(struct platform_device *dev)
        info->fbops = &vesafb_ops;
        info->var = vesafb_defined;
        info->fix = vesafb_fix;
-       info->flags = FBINFO_FLAG_DEFAULT | (ypan ? FBINFO_HWACCEL_YPAN : 0);
+       info->flags = (ypan ? FBINFO_HWACCEL_YPAN : 0);
 
        if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
                err = -ENOMEM;
index cf3c727..1b7c338 100644 (file)
@@ -455,7 +455,6 @@ static int vfb_probe(struct platform_device *dev)
        info->fix = vfb_fix;
        info->pseudo_palette = info->par;
        info->par = NULL;
-       info->flags = FBINFO_FLAG_DEFAULT;
 
        retval = fb_alloc_cmap(&info->cmap, 256, 0);
        if (retval < 0)
index 34d0034..b43c874 100644 (file)
@@ -1359,7 +1359,7 @@ static int vga16fb_probe(struct platform_device *dev)
        info->fix = vga16fb_fix;
        /* supports rectangles with widths of multiples of 8 */
        info->pixmap.blit_x = 1 << 7 | 1 << 15 | 1 << 23 | 1 << 31;
-       info->flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_YPAN;
+       info->flags = FBINFO_HWACCEL_YPAN;
 
        i = (info->var.bits_per_pixel == 8) ? 256 : 16;
        ret = fb_alloc_cmap(&info->cmap, i, 0);
index 6664dc7..9a4c29c 100644 (file)
@@ -432,7 +432,7 @@ static int xenfb_probe(struct xenbus_device *dev,
        fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
        fb_info->fix.accel = FB_ACCEL_NONE;
 
-       fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB;
+       fb_info->flags = FBINFO_VIRTFB;
 
        ret = fb_alloc_cmap(&fb_info->cmap, 256, 0);
        if (ret < 0) {