Thread (36 messages) 36 messages, 6 authors, 2019-11-28

Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops

From: Jani Nikula <hidden>
Date: 2019-11-28 09:22:23
Also in: dri-devel, intel-gfx, kvm

On Wed, 27 Nov 2019, Daniel Vetter [off-list ref] wrote:
On Wed, Nov 27, 2019 at 06:32:09PM +0200, Jani Nikula wrote:
quoted
Now that the fbops member of struct fb_info is const, we can star making
the ops const as well.

Cc: Kirti Wankhede <kwankhede@nvidia.com>
Cc: kvm@vger.kernel.org
Signed-off-by: Jani Nikula <redacted>
You've missed at least drivers/staging/fbtft in your search. I guess you
need to do a full make allyesconfig on x86/arm and arm64 (the latter
because some stupid drivers only compile there, not on arm, don't ask).
Still misses a pile of mips/ppc only stuff and maybe the sparcs and
alphas, but should be good enough.
fbtft dynamically allocates the fbops, for whatever reason. There were
others like that too. Some of the drivers modify the fbops runtime to
choose different hooks for different configurations. Can't change them
all anyway.

Facilitating making the fbops const is one thing (patches 1-8), but I'm
not really sure I want to sign up for exhaustively moving fbops to
rodata on anything beyond drivers/gpu/drm. It's not like I leave stuff
broken. Besides I am trying to cover all the low hanging fruit where I
can simply add the "const" and be done with it.

BR,
Jani.
With that done, on the remaining patches:

Reviewed-by: Daniel Vetter <redacted>
quoted
---
 samples/vfio-mdev/mdpy-fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/vfio-mdev/mdpy-fb.c b/samples/vfio-mdev/mdpy-fb.c
index 2719bb259653..21dbf63d6e41 100644
--- a/samples/vfio-mdev/mdpy-fb.c
+++ b/samples/vfio-mdev/mdpy-fb.c
@@ -86,7 +86,7 @@ static void mdpy_fb_destroy(struct fb_info *info)
 		iounmap(info->screen_base);
 }
 
-static struct fb_ops mdpy_fb_ops = {
+static const struct fb_ops mdpy_fb_ops = {
 	.owner		= THIS_MODULE,
 	.fb_destroy	= mdpy_fb_destroy,
 	.fb_setcolreg	= mdpy_fb_setcolreg,
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
-- 
Jani Nikula, Intel Open Source Graphics Center
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help