* [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs
@ 2021-02-09 23:48 Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 1/3] drm/amdgpu/ttm: constify static vm_operations_struct Rikard Falkeborn
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2021-02-09 23:48 UTC (permalink / raw)
To: David Airlie, Daniel Vetter
Cc: dri-devel, nouveau, Felix Kuehling, linux-kernel, amd-gfx,
Rikard Falkeborn, Ben Skeggs, Alex Deucher, Likun Gao,
Christian König
Constify a few static vm_operations_struct that are never modified. Their
only usage is to assign their address to the vm_ops field in the
vm_area_struct, which is a pointer to const vm_operations_struct. Make them
const to allow the compiler to put them in read-only memory.
With this series applied, all static struct vm_operations_struct in the
kernel tree are const.
Rikard Falkeborn (3):
drm/amdgpu/ttm: constify static vm_operations_struct
drm/radeon/ttm: constify static vm_operations_struct
drm/nouveau/ttm: constify static vm_operations_struct
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--
2.30.0
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Nouveau] [PATCH 1/3] drm/amdgpu/ttm: constify static vm_operations_struct
2021-02-09 23:48 [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Rikard Falkeborn
@ 2021-02-09 23:48 ` Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 2/3] drm/radeon/ttm: " Rikard Falkeborn
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2021-02-09 23:48 UTC (permalink / raw)
To: David Airlie, Daniel Vetter
Cc: dri-devel, nouveau, Felix Kuehling, linux-kernel, amd-gfx,
Rikard Falkeborn, Ben Skeggs, Alex Deucher, Likun Gao,
Christian König
The only usage of amdgpu_ttm_vm_ops is to assign its address to the
vm_ops field in the vm_area_struct struct. Make it const to allow the
compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 29cfb0809634..a785acc09f20 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2002,7 +2002,7 @@ static vm_fault_t amdgpu_ttm_fault(struct vm_fault *vmf)
return ret;
}
-static struct vm_operations_struct amdgpu_ttm_vm_ops = {
+static const struct vm_operations_struct amdgpu_ttm_vm_ops = {
.fault = amdgpu_ttm_fault,
.open = ttm_bo_vm_open,
.close = ttm_bo_vm_close,
--
2.30.0
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Nouveau] [PATCH 2/3] drm/radeon/ttm: constify static vm_operations_struct
2021-02-09 23:48 [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 1/3] drm/amdgpu/ttm: constify static vm_operations_struct Rikard Falkeborn
@ 2021-02-09 23:48 ` Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 3/3] drm/nouveau/ttm: " Rikard Falkeborn
2021-02-10 7:45 ` [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Christian König
3 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2021-02-09 23:48 UTC (permalink / raw)
To: David Airlie, Daniel Vetter
Cc: dri-devel, nouveau, Felix Kuehling, linux-kernel, amd-gfx,
Rikard Falkeborn, Ben Skeggs, Alex Deucher, Likun Gao,
Christian König
The only usage of radeon_ttm_vm_ops is to assign its address to the
vm_ops field in the vm_area_struct struct. Make it const to allow the
compiler to put it in read-only memory
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index c45e919e03c5..5fc8bae401af 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -835,7 +835,7 @@ static vm_fault_t radeon_ttm_fault(struct vm_fault *vmf)
return ret;
}
-static struct vm_operations_struct radeon_ttm_vm_ops = {
+static const struct vm_operations_struct radeon_ttm_vm_ops = {
.fault = radeon_ttm_fault,
.open = ttm_bo_vm_open,
.close = ttm_bo_vm_close,
--
2.30.0
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Nouveau] [PATCH 3/3] drm/nouveau/ttm: constify static vm_operations_struct
2021-02-09 23:48 [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 1/3] drm/amdgpu/ttm: constify static vm_operations_struct Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 2/3] drm/radeon/ttm: " Rikard Falkeborn
@ 2021-02-09 23:48 ` Rikard Falkeborn
2021-02-10 7:45 ` [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Christian König
3 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2021-02-09 23:48 UTC (permalink / raw)
To: David Airlie, Daniel Vetter
Cc: dri-devel, nouveau, Felix Kuehling, linux-kernel, amd-gfx,
Rikard Falkeborn, Ben Skeggs, Alex Deucher, Likun Gao,
Christian König
The only usage of nouveau_ttm_vm_ops is to assign its address to the
vm_ops field in the vm_area_struct struct. Make it const to allow the
compiler to put it in read-only memory
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index 495288182c2d..b81ae90b8449 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -154,7 +154,7 @@ static vm_fault_t nouveau_ttm_fault(struct vm_fault *vmf)
return ret;
}
-static struct vm_operations_struct nouveau_ttm_vm_ops = {
+static const struct vm_operations_struct nouveau_ttm_vm_ops = {
.fault = nouveau_ttm_fault,
.open = ttm_bo_vm_open,
.close = ttm_bo_vm_close,
--
2.30.0
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs
2021-02-09 23:48 [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Rikard Falkeborn
` (2 preceding siblings ...)
2021-02-09 23:48 ` [Nouveau] [PATCH 3/3] drm/nouveau/ttm: " Rikard Falkeborn
@ 2021-02-10 7:45 ` Christian König
2021-02-10 13:14 ` Daniel Vetter
3 siblings, 1 reply; 8+ messages in thread
From: Christian König @ 2021-02-10 7:45 UTC (permalink / raw)
To: Rikard Falkeborn, David Airlie, Daniel Vetter
Cc: amd-gfx, nouveau, Felix Kuehling, linux-kernel, dri-devel,
Ben Skeggs, Alex Deucher, Likun Gao
Reviewed-by: Christian König <christian.koenig@amd.com> for the series.
Am 10.02.21 um 00:48 schrieb Rikard Falkeborn:
> Constify a few static vm_operations_struct that are never modified. Their
> only usage is to assign their address to the vm_ops field in the
> vm_area_struct, which is a pointer to const vm_operations_struct. Make them
> const to allow the compiler to put them in read-only memory.
>
> With this series applied, all static struct vm_operations_struct in the
> kernel tree are const.
>
> Rikard Falkeborn (3):
> drm/amdgpu/ttm: constify static vm_operations_struct
> drm/radeon/ttm: constify static vm_operations_struct
> drm/nouveau/ttm: constify static vm_operations_struct
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
> drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs
2021-02-10 7:45 ` [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Christian König
@ 2021-02-10 13:14 ` Daniel Vetter
2021-02-23 17:31 ` Alex Deucher
0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2021-02-10 13:14 UTC (permalink / raw)
To: Christian König
Cc: amd-gfx, dri-devel, David Airlie, nouveau, Felix Kuehling,
linux-kernel, Rikard Falkeborn, Ben Skeggs, Daniel Vetter,
Alex Deucher, Likun Gao
On Wed, Feb 10, 2021 at 08:45:56AM +0100, Christian König wrote:
> Reviewed-by: Christian König <christian.koenig@amd.com> for the series.
Smash it into -misc?
-Daniel
>
> Am 10.02.21 um 00:48 schrieb Rikard Falkeborn:
> > Constify a few static vm_operations_struct that are never modified. Their
> > only usage is to assign their address to the vm_ops field in the
> > vm_area_struct, which is a pointer to const vm_operations_struct. Make them
> > const to allow the compiler to put them in read-only memory.
> >
> > With this series applied, all static struct vm_operations_struct in the
> > kernel tree are const.
> >
> > Rikard Falkeborn (3):
> > drm/amdgpu/ttm: constify static vm_operations_struct
> > drm/radeon/ttm: constify static vm_operations_struct
> > drm/nouveau/ttm: constify static vm_operations_struct
> >
> > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
> > drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
> > drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> >
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs
2021-02-10 13:14 ` Daniel Vetter
@ 2021-02-23 17:31 ` Alex Deucher
2021-02-26 7:52 ` Christian König
0 siblings, 1 reply; 8+ messages in thread
From: Alex Deucher @ 2021-02-23 17:31 UTC (permalink / raw)
To: Christian König, Rikard Falkeborn, David Airlie,
Alex Deucher, Ben Skeggs, Felix Kuehling, Likun Gao,
amd-gfx list, Maling list - DRI developers, LKML, nouveau
On Wed, Feb 10, 2021 at 8:14 AM Daniel Vetter <daniel@ffwll.ch> wrote:
>
> On Wed, Feb 10, 2021 at 08:45:56AM +0100, Christian König wrote:
> > Reviewed-by: Christian König <christian.koenig@amd.com> for the series.
>
> Smash it into -misc?
@Christian Koenig did these ever land? I don't see them in drm-misc.
Alex
> -Daniel
>
> >
> > Am 10.02.21 um 00:48 schrieb Rikard Falkeborn:
> > > Constify a few static vm_operations_struct that are never modified. Their
> > > only usage is to assign their address to the vm_ops field in the
> > > vm_area_struct, which is a pointer to const vm_operations_struct. Make them
> > > const to allow the compiler to put them in read-only memory.
> > >
> > > With this series applied, all static struct vm_operations_struct in the
> > > kernel tree are const.
> > >
> > > Rikard Falkeborn (3):
> > > drm/amdgpu/ttm: constify static vm_operations_struct
> > > drm/radeon/ttm: constify static vm_operations_struct
> > > drm/nouveau/ttm: constify static vm_operations_struct
> > >
> > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
> > > drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
> > > drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
> > > 3 files changed, 3 insertions(+), 3 deletions(-)
> > >
> >
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs
2021-02-23 17:31 ` Alex Deucher
@ 2021-02-26 7:52 ` Christian König
0 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2021-02-26 7:52 UTC (permalink / raw)
To: Alex Deucher, Rikard Falkeborn, David Airlie, Alex Deucher,
Ben Skeggs, Felix Kuehling, Likun Gao, amd-gfx list,
Maling list - DRI developers, LKML, nouveau
Am 23.02.21 um 18:31 schrieb Alex Deucher:
> On Wed, Feb 10, 2021 at 8:14 AM Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Wed, Feb 10, 2021 at 08:45:56AM +0100, Christian König wrote:
>>> Reviewed-by: Christian König <christian.koenig@amd.com> for the series.
>> Smash it into -misc?
> @Christian Koenig did these ever land? I don't see them in drm-misc.
I've just pushed them to drm-misc-next. Sorry for the delay, totally
forgot about them.
Christian.
>
> Alex
>
>> -Daniel
>>
>>> Am 10.02.21 um 00:48 schrieb Rikard Falkeborn:
>>>> Constify a few static vm_operations_struct that are never modified. Their
>>>> only usage is to assign their address to the vm_ops field in the
>>>> vm_area_struct, which is a pointer to const vm_operations_struct. Make them
>>>> const to allow the compiler to put them in read-only memory.
>>>>
>>>> With this series applied, all static struct vm_operations_struct in the
>>>> kernel tree are const.
>>>>
>>>> Rikard Falkeborn (3):
>>>> drm/amdgpu/ttm: constify static vm_operations_struct
>>>> drm/radeon/ttm: constify static vm_operations_struct
>>>> drm/nouveau/ttm: constify static vm_operations_struct
>>>>
>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
>>>> drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +-
>>>> drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
>>>> 3 files changed, 3 insertions(+), 3 deletions(-)
>>>>
>> --
>> Daniel Vetter
>> Software Engineer, Intel Corporation
>> https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.ffwll.ch%2F&data=04%7C01%7Cchristian.koenig%40amd.com%7C9d730e56efe54d3215ee08d8d820d642%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637496982837619645%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=b4UU8bzeX%2Ba1VfObe8mta7fwtjVv%2F1wo4%2FPVuGZFW8Q%3D&reserved=0
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=04%7C01%7Cchristian.koenig%40amd.com%7C9d730e56efe54d3215ee08d8d820d642%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637496982837629638%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=RKJh6p%2BTxaD0lH6M%2B0s3nah3tBatRFqoTvy3Mh7Lz5M%3D&reserved=0
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2021-02-26 7:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 23:48 [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 1/3] drm/amdgpu/ttm: constify static vm_operations_struct Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 2/3] drm/radeon/ttm: " Rikard Falkeborn
2021-02-09 23:48 ` [Nouveau] [PATCH 3/3] drm/nouveau/ttm: " Rikard Falkeborn
2021-02-10 7:45 ` [Nouveau] [PATCH 0/3] drm/ttm: constify static vm_operations_structs Christian König
2021-02-10 13:14 ` Daniel Vetter
2021-02-23 17:31 ` Alex Deucher
2021-02-26 7:52 ` Christian König
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).