[v2,08/14] video: fbdev: make fbops member of struct fb_info a const pointer
diff mbox series

Message ID 2dd4e6fb18637e3315bd57d422c6ae4a2080e844.1575022735.git.jani.nikula@intel.com
State New
Headers show
Series
  • video, drm, etc: constify fbops in struct fb_info
Related show

Commit Message

Jani Nikula Nov. 29, 2019, 10:29 a.m. UTC
Now that we no longer modify the fbops, or hold non-const pointers to
it, we can make it const. After this, we can start making the fbops
const all over the place.

Cc: linux-fbdev@vger.kernel.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 include/linux/fb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

kbuild test robot Nov. 30, 2019, 1:41 a.m. UTC | #1
Hi Jani,

I love your patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v5.4 next-20191129]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jani-Nikula/video-drm-etc-constify-fbops-in-struct-fb_info/20191129-193852
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/video/fbdev/uvesafb.c: In function 'uvesafb_init_info':
>> drivers/video/fbdev/uvesafb.c:1443:25: error: assignment of member 'fb_blank' in read-only object
      info->fbops->fb_blank = NULL;
                            ^
   drivers/video/fbdev/uvesafb.c:1513:31: error: assignment of member 'fb_pan_display' in read-only object
      info->fbops->fb_pan_display = NULL;
                                  ^
--
   drivers/video/fbdev/aty/atyfb_base.c: In function 'atyfb_set_par':
>> drivers/video/fbdev/aty/atyfb_base.c:1319:24: error: assignment of member 'fb_sync' in read-only object
      info->fbops->fb_sync = atyfb_sync;
                           ^
   drivers/video/fbdev/aty/atyfb_base.c:1322:24: error: assignment of member 'fb_sync' in read-only object
      info->fbops->fb_sync = NULL;
                           ^
--
   drivers/video/fbdev/mb862xx/mb862xxfb_accel.c: In function 'mb862xxfb_init_accel':
>> drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:311:28: error: assignment of member 'fb_fillrect' in read-only object
      info->fbops->fb_fillrect = cfb_fillrect;
                               ^
>> drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:312:28: error: assignment of member 'fb_copyarea' in read-only object
      info->fbops->fb_copyarea = cfb_copyarea;
                               ^
>> drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:313:29: error: assignment of member 'fb_imageblit' in read-only object
      info->fbops->fb_imageblit = cfb_imageblit;
                                ^
   drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:316:28: error: assignment of member 'fb_fillrect' in read-only object
      info->fbops->fb_fillrect = mb86290fb_fillrect;
                               ^
   drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:317:28: error: assignment of member 'fb_copyarea' in read-only object
      info->fbops->fb_copyarea = mb86290fb_copyarea;
                               ^
   drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:318:29: error: assignment of member 'fb_imageblit' in read-only object
      info->fbops->fb_imageblit = mb86290fb_imageblit;
                                ^
--
   drivers/video/fbdev/nvidia/nvidia.c: In function 'nvidiafb_set_par':
>> drivers/video/fbdev/nvidia/nvidia.c:663:29: error: assignment of member 'fb_imageblit' in read-only object
      info->fbops->fb_imageblit = nvidiafb_imageblit;
                                ^
>> drivers/video/fbdev/nvidia/nvidia.c:664:28: error: assignment of member 'fb_fillrect' in read-only object
      info->fbops->fb_fillrect = nvidiafb_fillrect;
                               ^
   drivers/video/fbdev/nvidia/nvidia.c:665:28: error: assignment of member 'fb_copyarea' in read-only object
      info->fbops->fb_copyarea = nvidiafb_copyarea;
                               ^
   drivers/video/fbdev/nvidia/nvidia.c:666:24: error: assignment of member 'fb_sync' in read-only object
      info->fbops->fb_sync = nvidiafb_sync;
                           ^
   drivers/video/fbdev/nvidia/nvidia.c:672:29: error: assignment of member 'fb_imageblit' in read-only object
      info->fbops->fb_imageblit = cfb_imageblit;
                                ^
   drivers/video/fbdev/nvidia/nvidia.c:673:28: error: assignment of member 'fb_fillrect' in read-only object
      info->fbops->fb_fillrect = cfb_fillrect;
                               ^
   drivers/video/fbdev/nvidia/nvidia.c:674:28: error: assignment of member 'fb_copyarea' in read-only object
      info->fbops->fb_copyarea = cfb_copyarea;
                               ^
   drivers/video/fbdev/nvidia/nvidia.c:675:24: error: assignment of member 'fb_sync' in read-only object
      info->fbops->fb_sync = NULL;
                           ^
   drivers/video/fbdev/nvidia/nvidia.c: In function 'nvidia_set_fbinfo':
   drivers/video/fbdev/nvidia/nvidia.c:1168:29: error: assignment of member 'fb_cursor' in read-only object
         info->fbops->fb_cursor = NULL;
                                ^

vim +/fb_blank +1443 drivers/video/fbdev/uvesafb.c

8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1427  
48c68c4f1b5424 drivers/video/uvesafb.c       Greg Kroah-Hartman 2012-12-21  1428  static void uvesafb_init_info(struct fb_info *info, struct vbe_mode_ib *mode)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1429  {
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1430  	unsigned int size_vmode;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1431  	unsigned int size_remap;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1432  	unsigned int size_total;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1433  	struct uvesafb_par *par = info->par;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1434  	int i, h;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1435  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1436  	info->pseudo_palette = ((u8 *)info->par + sizeof(struct uvesafb_par));
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1437  	info->fix = uvesafb_fix;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1438  	info->fix.ypanstep = par->ypan ? 1 : 0;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1439  	info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1440  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1441  	/* Disable blanking if the user requested so. */
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1442  	if (!blank)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16 @1443  		info->fbops->fb_blank = NULL;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1444  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1445  	/*
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1446  	 * Find out how much IO memory is required for the mode with
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1447  	 * the highest resolution.
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1448  	 */
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1449  	size_remap = 0;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1450  	for (i = 0; i < par->vbe_modes_cnt; i++) {
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1451  		h = par->vbe_modes[i].bytes_per_scan_line *
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1452  					par->vbe_modes[i].y_res;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1453  		if (h > size_remap)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1454  			size_remap = h;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1455  	}
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1456  	size_remap *= 2;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1457  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1458  	/*
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1459  	 *   size_vmode -- that is the amount of memory needed for the
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1460  	 *                 used video mode, i.e. the minimum amount of
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1461  	 *                 memory we need.
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1462  	 */
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1463  	size_vmode = info->var.yres * mode->bytes_per_scan_line;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1464  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1465  	/*
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1466  	 *   size_total -- all video memory we have. Used for mtrr
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1467  	 *                 entries, resource allocation and bounds
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1468  	 *                 checking.
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1469  	 */
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1470  	size_total = par->vbe_ib.total_memory * 65536;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1471  	if (vram_total)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1472  		size_total = vram_total * 1024 * 1024;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1473  	if (size_total < size_vmode)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1474  		size_total = size_vmode;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1475  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1476  	/*
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1477  	 *   size_remap -- the amount of video memory we are going to
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1478  	 *                 use for vesafb.  With modern cards it is no
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1479  	 *                 option to simply use size_total as th
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1480  	 *                 wastes plenty of kernel address space.
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1481  	 */
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1482  	if (vram_remap)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1483  		size_remap = vram_remap * 1024 * 1024;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1484  	if (size_remap < size_vmode)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1485  		size_remap = size_vmode;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1486  	if (size_remap > size_total)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1487  		size_remap = size_total;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1488  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1489  	info->fix.smem_len = size_remap;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1490  	info->fix.smem_start = mode->phys_base_ptr;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1491  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1492  	/*
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1493  	 * We have to set yres_virtual here because when setup_var() was
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1494  	 * called, smem_len wasn't defined yet.
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1495  	 */
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1496  	info->var.yres_virtual = info->fix.smem_len /
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1497  				 mode->bytes_per_scan_line;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1498  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1499  	if (par->ypan && info->var.yres_virtual > info->var.yres) {
a8feae09110675 drivers/video/fbdev/uvesafb.c Joe Perches        2017-06-14  1500  		pr_info("scrolling: %s using protected mode interface, yres_virtual=%d\n",
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1501  			(par->ypan > 1) ? "ywrap" : "ypan",
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1502  			info->var.yres_virtual);
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1503  	} else {
a8feae09110675 drivers/video/fbdev/uvesafb.c Joe Perches        2017-06-14  1504  		pr_info("scrolling: redraw\n");
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1505  		info->var.yres_virtual = info->var.yres;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1506  		par->ypan = 0;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1507  	}
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1508  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1509  	info->flags = FBINFO_FLAG_DEFAULT |
1cc9fb6dbf915e drivers/video/uvesafb.c       Roel Kluin         2009-03-31  1510  			(par->ypan ? FBINFO_HWACCEL_YPAN : 0);
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1511  
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1512  	if (!par->ypan)
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1513  		info->fbops->fb_pan_display = NULL;
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1514  }
8bdb3a2d7df48b drivers/video/uvesafb.c       Michal Januszewski 2007-10-16  1515  

:::::: The code at line 1443 was first introduced by commit
:::::: 8bdb3a2d7df48b861972c4bfb58490853a228f51 uvesafb: the driver core

:::::: TO: Michal Januszewski <spock@gentoo.org>
:::::: CC: Linus Torvalds <torvalds@woody.linux-foundation.org>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

Patch
diff mbox series

diff --git a/include/linux/fb.h b/include/linux/fb.h
index a6ad528990de..6557fabdea62 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -472,7 +472,7 @@  struct fb_info {
 	struct fb_deferred_io *fbdefio;
 #endif
 
-	struct fb_ops *fbops;
+	const struct fb_ops *fbops;
 	struct device *device;		/* This is the parent */
 	struct device *dev;		/* This is this fb device */
 	int class_flag;                    /* private sysfs flags */