From: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>
To: "Christian König" <deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Darren Hart <dvhart-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH 1/1] vga_switcheroo: Constify vga_switcheroo_handler
Date: Tue, 20 Oct 2015 20:19:53 +0200 [thread overview]
Message-ID: <20151020181953.GY13786@phenom.ffwll.local> (raw)
In-Reply-To: <5626223C.1040605-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
On Tue, Oct 20, 2015 at 01:15:08PM +0200, Christian König wrote:
> On 18.10.2015 13:05, Lukas Wunner wrote:
> >vga_switcheroo_client_ops has always been declared const since its
> >introduction with 26ec685ff9d9 ("vga_switcheroo: Introduce struct
> >vga_switcheroo_client_ops").
> >
> >Do so for vga_switcheroo_handler as well.
> >
> > drivers/gpu/drm/amd/amdgpu/amdgpu.ko:
> > 6 .rodata 00009888
> >- 19 .data 00001f00
> >+ 19 .data 00001ee0
> > drivers/gpu/drm/nouveau/nouveau.ko:
> > 6 .rodata 000460b8
> > 17 .data 00018fe0
> > drivers/gpu/drm/radeon/radeon.ko:
> >- 7 .rodata 00030944
> >+ 7 .rodata 00030964
> >- 21 .data 0000d6a0
> >+ 21 .data 0000d678
> > drivers/platform/x86/apple-gmux.ko:
> >- 7 .rodata 00000140
> >+ 7 .rodata 00000160
> >- 11 .data 000000e0
> >+ 11 .data 000000b8
> >
> >Cc: Ben Skeggs <bskeggs@redhat.com>
> >Cc: Darren Hart <dvhart@linux.intel.com>
> >Cc: Alex Deucher <alexander.deucher@amd.com>
> >Signed-off-by: Lukas Wunner <lukas@wunner.de>
>
> Looks like it makes sense and at least I don't need this split up between
> drivers.
>
> Patch is Reviewed-by: Christian König <christian.koenig@amd.com>.
Applied to drm-misc, thanks.
-Daniel
>
> Regards,
> Christian.
>
> >---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 2 +-
> > drivers/gpu/drm/nouveau/nouveau_acpi.c | 2 +-
> > drivers/gpu/drm/radeon/radeon_atpx_handler.c | 2 +-
> > drivers/gpu/vga/vga_switcheroo.c | 4 ++--
> > drivers/platform/x86/apple-gmux.c | 2 +-
> > include/linux/vga_switcheroo.h | 4 ++--
> > 6 files changed, 8 insertions(+), 8 deletions(-)
> >
> >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> >index 3f7aaa4..dc565a4 100644
> >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> >@@ -501,7 +501,7 @@ static int amdgpu_atpx_get_client_id(struct pci_dev *pdev)
> > return VGA_SWITCHEROO_DIS;
> > }
> >-static struct vga_switcheroo_handler amdgpu_atpx_handler = {
> >+static const struct vga_switcheroo_handler amdgpu_atpx_handler = {
> > .switchto = amdgpu_atpx_switchto,
> > .power_state = amdgpu_atpx_power_state,
> > .init = amdgpu_atpx_init,
> >diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
> >index df2d981..8b8332e 100644
> >--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
> >+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
> >@@ -206,7 +206,7 @@ static int nouveau_dsm_get_client_id(struct pci_dev *pdev)
> > return VGA_SWITCHEROO_DIS;
> > }
> >-static struct vga_switcheroo_handler nouveau_dsm_handler = {
> >+static const struct vga_switcheroo_handler nouveau_dsm_handler = {
> > .switchto = nouveau_dsm_switchto,
> > .power_state = nouveau_dsm_power_state,
> > .get_client_id = nouveau_dsm_get_client_id,
> >diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
> >index 8bc7d0b..714508a 100644
> >--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
> >+++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
> >@@ -499,7 +499,7 @@ static int radeon_atpx_get_client_id(struct pci_dev *pdev)
> > return VGA_SWITCHEROO_DIS;
> > }
> >-static struct vga_switcheroo_handler radeon_atpx_handler = {
> >+static const struct vga_switcheroo_handler radeon_atpx_handler = {
> > .switchto = radeon_atpx_switchto,
> > .power_state = radeon_atpx_power_state,
> > .init = radeon_atpx_init,
> >diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
> >index af0d372..56bbbd6 100644
> >--- a/drivers/gpu/vga/vga_switcheroo.c
> >+++ b/drivers/gpu/vga/vga_switcheroo.c
> >@@ -140,7 +140,7 @@ struct vgasr_priv {
> > int registered_clients;
> > struct list_head clients;
> >- struct vga_switcheroo_handler *handler;
> >+ const struct vga_switcheroo_handler *handler;
> > };
> > #define ID_BIT_AUDIO 0x100
> >@@ -195,7 +195,7 @@ static void vga_switcheroo_enable(void)
> > *
> > * Return: 0 on success, -EINVAL if a handler was already registered.
> > */
> >-int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler)
> >+int vga_switcheroo_register_handler(const struct vga_switcheroo_handler *handler)
> > {
> > mutex_lock(&vgasr_mutex);
> > if (vgasr_priv.handler) {
> >diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
> >index 0dec3f5..976efeb 100644
> >--- a/drivers/platform/x86/apple-gmux.c
> >+++ b/drivers/platform/x86/apple-gmux.c
> >@@ -346,7 +346,7 @@ gmux_active_client(struct apple_gmux_data *gmux_data)
> > return VGA_SWITCHEROO_DIS;
> > }
> >-static struct vga_switcheroo_handler gmux_handler = {
> >+static const struct vga_switcheroo_handler gmux_handler = {
> > .switchto = gmux_switchto,
> > .power_state = gmux_set_power_state,
> > .get_client_id = gmux_get_client_id,
> >diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
> >index c557511..786bc93 100644
> >--- a/include/linux/vga_switcheroo.h
> >+++ b/include/linux/vga_switcheroo.h
> >@@ -137,7 +137,7 @@ int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
> > void vga_switcheroo_client_fb_set(struct pci_dev *dev,
> > struct fb_info *info);
> >-int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler);
> >+int vga_switcheroo_register_handler(const struct vga_switcheroo_handler *handler);
> > void vga_switcheroo_unregister_handler(void);
> > int vga_switcheroo_process_delayed_switch(void);
> >@@ -155,7 +155,7 @@ static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {}
> > static inline int vga_switcheroo_register_client(struct pci_dev *dev,
> > const struct vga_switcheroo_client_ops *ops, bool driver_power_control) { return 0; }
> > static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {}
> >-static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; }
> >+static inline int vga_switcheroo_register_handler(const struct vga_switcheroo_handler *handler) { return 0; }
> > static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
> > const struct vga_switcheroo_client_ops *ops,
> > enum vga_switcheroo_client_id id) { return 0; }
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
prev parent reply other threads:[~2015-10-20 18:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 10:07 [PATCH 0/1] vga_switcheroo: Constify vga_switcheroo_handler Lukas Wunner
2015-10-18 11:05 ` [PATCH 1/1] " Lukas Wunner
2015-10-20 11:15 ` Christian König
[not found] ` <5626223C.1040605-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2015-10-20 18:19 ` Daniel Vetter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151020181953.GY13786@phenom.ffwll.local \
--to=daniel-/w4ywyx8dfk@public.gmane.org \
--cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=dvhart-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox