drm/panfrost: fix -Wmissing-prototypes warnings
Subsystems (3)
PATCH 1/1 drm/panfrost: fix -Wmissing-prototypes warnings
We get these warnings when build kernel W=1:drivers/gpu/drm/panfrost/panfrost_perfcnt.c:35:6: warning: no previous prototype for ‘panfrost_perfcnt_clean_cache_done’ [-Wmissing-prototypes] drivers/gpu/drm/panfrost/panfrost_perfcnt.c:40:6: warning: no previous prototype for ‘panfrost_perfcnt_sample_done’ [-Wmissing-prototypes] drivers/gpu/drm/panfrost/panfrost_perfcnt.c:190:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_enable’ [-Wmissing-prototypes] drivers/gpu/drm/panfrost/panfrost_perfcnt.c:218:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_dump’ [-Wmissing-prototypes] drivers/gpu/drm/panfrost/panfrost_perfcnt.c:250:6: warning: no previous prototype for ‘panfrost_perfcnt_close’ [-Wmissing-prototypes] drivers/gpu/drm/panfrost/panfrost_perfcnt.c:264:5: warning: no previous prototype for ‘panfrost_perfcnt_init’ [-Wmissing-prototypes] drivers/gpu/drm/panfrost/panfrost_perfcnt.c:320:6: warning: no previous prototype for ‘panfrost_perfcnt_fini’ [-Wmissing-prototypes] drivers/gpu/drm/panfrost/panfrost_mmu.c:227:6: warning: no previous prototype for ‘panfrost_mmu_flush_range’ [-Wmissing-prototypes] drivers/gpu/drm/panfrost/panfrost_mmu.c:435:5: warning: no previous prototype for ‘panfrost_mmu_map_fault_addr’ [-Wmissing-prototypes]
For file panfrost_mmu.c, make functions static to fix this. For file panfrost_perfcnt.c, include head file can fix this.
--- drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 +++-- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/panfrost/panfrost_mmu.c +3 -2
@@ -224,7 +224,7 @@ static size_t get_pgsize(u64 addr, size_t size)return SZ_2M ; } -void panfrost_mmu_flush_range (struct panfrost_device *pfdev, +static void panfrost_mmu_flush_range (struct panfrost_device *pfdev,struct panfrost_mmu *mmu,u64 iova,size_t size) {
@@ -432,7 +432,8 @@ void panfrost_mmu_pgtable_free(struct panfrost_file_priv *priv)#define NUM_FAULT_PAGES (SZ_2M / PAGE_SIZE) -int panfrost_mmu_map_fault_addr (struct panfrost_device *pfdev,int as,u64 addr) +static int panfrost_mmu_map_fault_addr (struct panfrost_device *pfdev,int as, +u64 addr) {int ret, i;struct panfrost_gem_object *bo;
drivers/gpu/drm/panfrost/panfrost_perfcnt.c +1 -0
@@ -17,6 +17,7 @@#include "panfrost_job.h" #include "panfrost_mmu.h" #include "panfrost_regs.h" +#include "panfrost_perfcnt.h" #define COUNTERS_PER_BLOCK 64#define BYTES_PER_COUNTER 4
Signature · 1 line
1.8.3.1
Quoted 11 lines · Yi Wang
We get these warnings when build kernel W=1:
drivers/gpu/drm/panfrost/panfrost_perfcnt.c:35:6: warning: no previous prototype for ‘panfrost_perfcnt_clean_cache_done’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:40:6: warning: no previous prototype for ‘panfrost_perfcnt_sample_done’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:190:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_enable’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:218:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_dump’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:250:6: warning: no previous prototype for ‘panfrost_perfcnt_close’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:264:5: warning: no previous prototype for ‘panfrost_perfcnt_init’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:320:6: warning: no previous prototype for ‘panfrost_perfcnt_fini’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_mmu.c:227:6: warning: no previous prototype for ‘panfrost_mmu_flush_range’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_mmu.c:435:5: warning: no previous prototype for ‘panfrost_mmu_map_fault_addr’ [-Wmissing-prototypes]
Quoted 2 lines
For file
panfrost_mmu.c, make functions static to fix this. For filepanfrost_perfcnt.c, include head file can fix this.
Nit: s/head/header/
Quoted 2 lines
Signed-off-by Yi Wang <[email protected]>
Looks good, just a few minor style issues (below), with those fixed:
Quoted 10 lines
--- drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 +++-- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/panfrost/panfrost_mmu.c +0
-0
drivers/gpu/drm/panfrost/panfrost_mmu.c static size_t get_pgsize(u64 addr, size_t size) · line 229
Quoted 7 lines
drivers/gpu/drm/panfrost/panfrost_mmu.c +1
-1@@ -224,7 +224,7 @@ static size_t get_pgsize(u64 addr, size_t size)return SZ_2M ; } -void panfrost_mmu_flush_range (struct panfrost_device *pfdev, +static void panfrost_mmu_flush_range (struct panfrost_device *pfdev,struct panfrost_mmu *mmu,u64 iova,size_t size)
Please align the arguments with the '(' as it was before.
drivers/gpu/drm/panfrost/panfrost_mmu.c void panfrost_mmu_pgtable_free(struct panfrost_file_priv *priv) · line 436
Quoted 8 lines
drivers/gpu/drm/panfrost/panfrost_mmu.c +2
-1{@@ -432,7 +432,8 @@ void panfrost_mmu_pgtable_free(struct panfrost_file_priv *priv)#define NUM_FAULT_PAGES (SZ_2M / PAGE_SIZE) -int panfrost_mmu_map_fault_addr (struct panfrost_device *pfdev,int as,u64 addr) +static int panfrost_mmu_map_fault_addr (struct panfrost_device *pfdev,int as, +u64 addr)
Again, align 'addr' with the '('.
drivers/gpu/drm/panfrost/panfrost_perfcnt.c line 20
Quoted 12 lines
drivers/gpu/drm/panfrost/panfrost_mmu.c +0
-0{int ret, i;struct panfrost_gem_object *bo;drivers/gpu/drm/panfrost/panfrost_perfcnt.c +1
-0@@ -17,6 +17,7 @@#include "panfrost_job.h" #include "panfrost_mmu.h" #include "panfrost_regs.h" +#include "panfrost_perfcnt.h"
Please keep header includes sorted alphabetically.
Thanks,
Steve
drivers/gpu/drm/panfrost/panfrost_perfcnt.c
Quoted 4 lines
drivers/gpu/drm/panfrost/panfrost_perfcnt.c +0
-0#define COUNTERS_PER_BLOCK 64#define BYTES_PER_COUNTER 4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Steve,
Thanks a lot for your review, and I will send a v2 patch ASAP.
Quoted 29 lines · Yi Wang
Quoted 11 lines
We get these warnings when build kernel W=1:
drivers/gpu/drm/panfrost/panfrost_perfcnt.c:35:6: warning: no previous prototype for ‘panfrost_perfcnt_clean_cache_done’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:40:6: warning: no previous prototype for ‘panfrost_perfcnt_sample_done’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:190:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_enable’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:218:5: warning: no previous prototype for ‘panfrost_ioctl_perfcnt_dump’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:250:6: warning: no previous prototype for ‘panfrost_perfcnt_close’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:264:5: warning: no previous prototype for ‘panfrost_perfcnt_init’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_perfcnt.c:320:6: warning: no previous prototype for ‘panfrost_perfcnt_fini’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_mmu.c:227:6: warning: no previous prototype for ‘panfrost_mmu_flush_range’ [-Wmissing-prototypes]drivers/gpu/drm/panfrost/panfrost_mmu.c:435:5: warning: no previous prototype for ‘panfrost_mmu_map_fault_addr’ [-Wmissing-prototypes]Quoted 2 lines
For file
panfrost_mmu.c, make functions static to fix this. For filepanfrost_perfcnt.c, include head file can fix this.Nit: s/head/header/
Quoted 2 lines
Signed-off-by Yi Wang <[email protected]>Looks good, just a few minor style issues (below), with those fixed:
Reviewed-by Steven Price <[email protected]>Quoted 5 lines
--- drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 +++-- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-)
...
Quoted 13 lines
Quoted 2 lines
#include "
panfrost_regs.h"
+#include "panfrost_perfcnt.h"Please keep header includes sorted alphabetically.
Thanks,
Steve
Quoted 4 lines
#define
COUNTERS_PER_BLOCK64
#defineBYTES_PER_COUNTER4
---
Best wishes
Yi Wang
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel