kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 13/13] samples: vfio-mdev: constify fb ops
       [not found] <cover.1574871797.git.jani.nikula@intel.com>
@ 2019-11-27 16:32 ` Jani Nikula
  2019-11-27 18:29   ` Daniel Vetter
  2019-11-28  8:31   ` Christophe de Dinechin
  0 siblings, 2 replies; 6+ messages in thread
From: Jani Nikula @ 2019-11-27 16:32 UTC (permalink / raw)
  To: linux-fbdev, dri-devel
  Cc: ville.syrjala, intel-gfx, jani.nikula, Kirti Wankhede, kvm

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 <jani.nikula@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
  2019-11-27 16:32 ` [PATCH 13/13] samples: vfio-mdev: constify fb ops Jani Nikula
@ 2019-11-27 18:29   ` Daniel Vetter
  2019-11-28  9:22     ` Jani Nikula
  2019-11-28  8:31   ` Christophe de Dinechin
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Vetter @ 2019-11-27 18:29 UTC (permalink / raw)
  To: Jani Nikula; +Cc: linux-fbdev, dri-devel, intel-gfx, Kirti Wankhede, kvm

On Wed, Nov 27, 2019 at 06:32:09PM +0200, Jani Nikula wrote:
> 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 <jani.nikula@intel.com>

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.

With that done, on the remaining patches:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
  2019-11-27 16:32 ` [PATCH 13/13] samples: vfio-mdev: constify fb ops Jani Nikula
  2019-11-27 18:29   ` Daniel Vetter
@ 2019-11-28  8:31   ` Christophe de Dinechin
  2019-11-28 10:35     ` Jani Nikula
  1 sibling, 1 reply; 6+ messages in thread
From: Christophe de Dinechin @ 2019-11-28  8:31 UTC (permalink / raw)
  To: Jani Nikula
  Cc: linux-fbdev, dri-devel, ville.syrjala, intel-gfx, Kirti Wankhede, kvm



> On 27 Nov 2019, at 17:32, Jani Nikula <jani.nikula@intel.com> wrote:
> 
> Now that the fbops member of struct fb_info is const, we can star making
s/star/start/

> the ops const as well.
> 
> Cc: Kirti Wankhede <kwankhede@nvidia.com>
> Cc: kvm@vger.kernel.org
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> 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
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
  2019-11-27 18:29   ` Daniel Vetter
@ 2019-11-28  9:22     ` Jani Nikula
  2019-11-28 10:11       ` Daniel Vetter
  0 siblings, 1 reply; 6+ messages in thread
From: Jani Nikula @ 2019-11-28  9:22 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: linux-fbdev, dri-devel, intel-gfx, Kirti Wankhede, kvm

On Wed, 27 Nov 2019, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Nov 27, 2019 at 06:32:09PM +0200, Jani Nikula wrote:
>> 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 <jani.nikula@intel.com>
>
> 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 <daniel.vetter@ffwll.ch>
>
>> ---
>>  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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
  2019-11-28  9:22     ` Jani Nikula
@ 2019-11-28 10:11       ` Daniel Vetter
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2019-11-28 10:11 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Daniel Vetter, linux-fbdev, dri-devel, intel-gfx, Kirti Wankhede, kvm

On Thu, Nov 28, 2019 at 11:22:23AM +0200, Jani Nikula wrote:
> On Wed, 27 Nov 2019, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, Nov 27, 2019 at 06:32:09PM +0200, Jani Nikula wrote:
> >> 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 <jani.nikula@intel.com>
> >
> > 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.

Uh indeed, I didn't check the output of my grep with sufficient finesses.
r-b as-is on that pile.

Since fbdev is officially in drm-misc you can just merge it all once the
prep is done - feels silly not to when you've done the work already.
-Daniel

> 
> BR,
> Jani.
> 
> >
> > With that done, on the remaining patches:
> >
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> >> ---
> >>  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

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 13/13] samples: vfio-mdev: constify fb ops
  2019-11-28  8:31   ` Christophe de Dinechin
@ 2019-11-28 10:35     ` Jani Nikula
  0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2019-11-28 10:35 UTC (permalink / raw)
  To: Christophe de Dinechin
  Cc: linux-fbdev, dri-devel, ville.syrjala, intel-gfx, Kirti Wankhede, kvm

On Thu, 28 Nov 2019, Christophe de Dinechin <christophe.de.dinechin@gmail.com> wrote:
>> On 27 Nov 2019, at 17:32, Jani Nikula <jani.nikula@intel.com> wrote:
>> 
>> Now that the fbops member of struct fb_info is const, we can star making
> s/star/start/

Ooops, thanks.

BR,
Jani.

>
>> the ops const as well.
>> 
>> Cc: Kirti Wankhede <kwankhede@nvidia.com>
>> Cc: kvm@vger.kernel.org
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> 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
>> 
>

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-28 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1574871797.git.jani.nikula@intel.com>
2019-11-27 16:32 ` [PATCH 13/13] samples: vfio-mdev: constify fb ops Jani Nikula
2019-11-27 18:29   ` Daniel Vetter
2019-11-28  9:22     ` Jani Nikula
2019-11-28 10:11       ` Daniel Vetter
2019-11-28  8:31   ` Christophe de Dinechin
2019-11-28 10:35     ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).