diff mbox series

[v3,05/12] video: fbdev: make fbops member of struct fb_info a const pointer

Message ID 700c6b52c39c6e7babaa921f583eac354714d9fc.1575390740.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series video, drm, etc: constify fbops in struct fb_info | expand

Commit Message

Jani Nikula Dec. 3, 2019, 4:38 p.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

kernel test robot Dec. 5, 2019, 12:12 a.m. UTC | #1
Hi Jani,

I love your patch! Yet something to improve:

[auto build test ERROR on drm-intel/for-linux-next]
[cannot apply to drm-exynos/exynos-drm-next linus/master v5.4 v5.4-rc8 v5.4-rc7 next-20191203 v5.4 next-20191203]
[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/20191204-055320
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 7.5.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.5.0 make.cross ARCH=m68k 

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/udlfb.c: In function 'dlfb_ops_release':
>> drivers/video/fbdev/udlfb.c:1040:24: error: assignment of member 'fb_mmap' in read-only object
      info->fbops->fb_mmap = dlfb_ops_mmap;
                           ^
--
   drivers/video/fbdev/smscufx.c: In function 'ufx_ops_release':
>> drivers/video/fbdev/smscufx.c:1173:24: error: assignment of member 'fb_mmap' in read-only object
      info->fbops->fb_mmap = ufx_ops_mmap;
                           ^
--
   drivers/video/fbdev/core/fb_defio.c: In function 'fb_deferred_io_init':
>> drivers/video/fbdev/core/fb_defio.c:209:23: error: assignment of member 'fb_mmap' in read-only object
     info->fbops->fb_mmap = fb_deferred_io_mmap;
                          ^
   drivers/video/fbdev/core/fb_defio.c: In function 'fb_deferred_io_cleanup':
   drivers/video/fbdev/core/fb_defio.c:240:23: error: assignment of member 'fb_mmap' in read-only object
     info->fbops->fb_mmap = NULL;
                          ^

vim +/fb_mmap +1040 drivers/video/fbdev/udlfb.c

33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1026  
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1027  /*
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1028   * Assumes caller is holding info->lock mutex (for open and release at least)
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1029   */
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1030  static int dlfb_ops_release(struct fb_info *info, int user)
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1031  {
7ea46206d1706b drivers/video/fbdev/udlfb.c   Ladislav Michl  2018-01-15  1032  	struct dlfb_data *dlfb = info->par;
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1033  
7ea46206d1706b drivers/video/fbdev/udlfb.c   Ladislav Michl  2018-01-15  1034  	dlfb->fb_count--;
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1035  
7ea46206d1706b drivers/video/fbdev/udlfb.c   Ladislav Michl  2018-01-15  1036  	if ((dlfb->fb_count == 0) && (info->fbdefio)) {
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1037  		fb_deferred_io_cleanup(info);
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1038  		kfree(info->fbdefio);
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1039  		info->fbdefio = NULL;
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05 @1040  		info->fbops->fb_mmap = dlfb_ops_mmap;
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1041  	}
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1042  
5865889fe43194 drivers/video/fbdev/udlfb.c   Ladislav Michl  2018-01-16  1043  	dev_dbg(info->dev, "release, user=%d count=%d\n", user, dlfb->fb_count);
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1044  
33077b8d3042e0 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-09-05  1045  	return 0;
2469d5dbcafe06 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-02-15  1046  }
2469d5dbcafe06 drivers/staging/udlfb/udlfb.c Bernie Thompson 2010-02-15  1047  

:::::: The code at line 1040 was first introduced by commit
:::::: 33077b8d3042e01da61924973e372abe589ba297 staging: udlfb: revamp reference handling to insure successful shutdown

:::::: TO: Bernie Thompson <bernie@plugable.com>
:::::: CC: Greg Kroah-Hartman <gregkh@suse.de>

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

Patch

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 */