Skip to contentSkip to conversation

Small fixes around cacheflush.h

PATCH In review Nathan Chancellor 4 participants 7 messages Jun 22, 2020 – Jun 23, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Small fixes around cacheflush.h

Hi all,

These two patches are the culmination of the small discussion here:

https://lore.kernel.org/lkml/CAMuHMdVSduTOi5bUgF9sLQdGADwyL1+qALWsKgin1TeOLGhAKQ@mail.gmail.com/

I have fallen behind on fixing issues so sorry for not sending these sooner and letting these warnings slip into mainline. Please let me know if there are any comments or concerns. They are two completely independent patches so if they need to be routed via separate trees, that is fine. It was just easier to send them together since they are dealing with the same problem.

Cheers,
Nathan

#1 lore raw

PATCH 1/2 media: omap3isp: Remove cacheflush.h

After mm.h was removed from the asm-generic version of cacheflush.h, s390 allyesconfig shows several warnings of the following nature:

In file included from ./arch/s390/include/generated/asm/cacheflush.h:1,
from drivers/media/platform/omap3isp/isp.c:42:
./include/asm-generic/cacheflush.h:16:42: warning: 'struct mm_struct' declared inside parameter list will not be visible outside of this definition or declaration

As Geert and Laurent point out, this driver does not need this header in the two files that include it. Remove it so there are no warnings.

Fixes e0cf615d725c ("asm-generic: don't include <linux/mm.h> in cacheflush.h")
---
 drivers/media/platform/omap3isp/isp.c      | 2 --
 drivers/media/platform/omap3isp/ispvideo.c | 1 -
 2 files changed, 3 deletions(-)
drivers/media/platform/omap3isp/isp.c +0 -2
index a4ee6b86663e..b91e472ee764 100644
@@ -39,8 +39,6 @@
  *	Troy Laramy <[email protected]>
  */
 
-#include <asm/cacheflush.h>
-
 #include <linux/clk.h>
 #include <linux/clkdev.h>
 #include <linux/delay.h>
drivers/media/platform/omap3isp/ispvideo.c +0 -1
index 10c214bd0903..1ac9aef70dff 100644
@@ -18,7 +18,6 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <asm/cacheflush.h>
 
 #include <media/v4l2-dev.h>
 #include <media/v4l2-ioctl.h>

base-commit: 27f11fea33608cbd321a97cbecfa2ef97dcc1821

Signature · 1 line
2.27.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] media: omap3isp: Remove cacheflush.h

Hi Nathan,

Thank you for the patch.

Quoted 9 lines · Nathan Chancellor

After mm.h was removed from the asm-generic version of cacheflush.h, s390 allyesconfig shows several warnings of the following nature:

In file included from ./arch/s390/include/generated/asm/cacheflush.h:1,
from drivers/media/platform/omap3isp/isp.c:42:
./include/asm-generic/cacheflush.h:16:42: warning: 'struct mm_struct' declared inside parameter list will not be visible outside of this definition or declaration

Quoted 7 lines

As Geert and Laurent point out, this driver does not need this header in the two files that include it. Remove it so there are no warnings.

Fixes e0cf615d725c ("asm-generic: don't include <linux/mm.h> in cacheflush.h")
Quoted 32 lines
---
 drivers/media/platform/omap3isp/isp.c      | 2 --
 drivers/media/platform/omap3isp/ispvideo.c | 1 -
 2 files changed, 3 deletions(-)
drivers/media/platform/omap3isp/isp.c +0 -2
index a4ee6b86663e..b91e472ee764 100644
@@ -39,8 +39,6 @@
  *	Troy Laramy <[email protected]>
  */
 
-#include <asm/cacheflush.h>
-
 #include <linux/clk.h>
 #include <linux/clkdev.h>
 #include <linux/delay.h>
drivers/media/platform/omap3isp/ispvideo.c +0 -1
index 10c214bd0903..1ac9aef70dff 100644
@@ -18,7 +18,6 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <asm/cacheflush.h>
 
 #include <media/v4l2-dev.h>
 #include <media/v4l2-ioctl.h>

base-commit: 27f11fea33608cbd321a97cbecfa2ef97dcc1821

Signature · 3 lines
Regards,

Laurent Pinchart
Reviewed-by on v1 1/2
#4 lore raw

Re: [PATCH 1/2] media: omap3isp: Remove cacheflush.h

In reply to Nathan Chancellor

Em Mon, 22 Jun 2020 16:47:39 -0700
Nathan Chancellor <[email protected]> escreveu:

Quoted 9 lines

After mm.h was removed from the asm-generic version of cacheflush.h, s390 allyesconfig shows several warnings of the following nature:

In file included from ./arch/s390/include/generated/asm/cacheflush.h:1,
from drivers/media/platform/omap3isp/isp.c:42:
./include/asm-generic/cacheflush.h:16:42: warning: 'struct mm_struct' declared inside parameter list will not be visible outside of this definition or declaration

Quoted 7 lines

As Geert and Laurent point out, this driver does not need this header in the two files that include it. Remove it so there are no warnings.

Fixes e0cf615d725c ("asm-generic: don't include <linux/mm.h> in cacheflush.h")
Quoted 31 lines
---
 drivers/media/platform/omap3isp/isp.c      | 2 --
 drivers/media/platform/omap3isp/ispvideo.c | 1 -
 2 files changed, 3 deletions(-)
drivers/media/platform/omap3isp/isp.c +0 -2
index a4ee6b86663e..b91e472ee764 100644
@@ -39,8 +39,6 @@
  *	Troy Laramy <[email protected]>
  */
 
-#include <asm/cacheflush.h>
-
 #include <linux/clk.h>
 #include <linux/clkdev.h>
 #include <linux/delay.h>
drivers/media/platform/omap3isp/ispvideo.c +0 -1
index 10c214bd0903..1ac9aef70dff 100644
@@ -18,7 +18,6 @@
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <asm/cacheflush.h>
 
 #include <media/v4l2-dev.h>
 #include <media/v4l2-ioctl.h>
Quoted 1 line

base-commit: 27f11fea33608cbd321a97cbecfa2ef97dcc1821

Thanks,
Mauro

#5 lore raw

PATCH 2/2 asm-generic: Make cacheflush.h self-contained

In reply to Nathan Chancellor

Currently, cacheflush.h has to be included after mm.h to avoid several -Wvisibility warnings:

$ clang -Wvisibility -fsyntax-only include/asm-generic/cacheflush.h
include/asm-generic/cacheflush.h:16:42: warning: declaration of 'struct
mm_struct' will not be visible outside of this function [-Wvisibility]
static inline void flush_cache_mm(struct mm_struct *mm)
                                         ^
...
include/asm-generic/cacheflush.h:28:45: warning: declaration of 'struct
vm_area_struct' will not be visible outside of this function
[-Wvisibility]
static inline void flush_cache_range(struct vm_area_struct *vma,
                                            ^
...

Add a few forward declarations should that there are no warnings and the ordering of the includes does not matter.

Fixes e0cf615d725c ("asm-generic: don't include <linux/mm.h> in cacheflush.h")
---
 include/asm-generic/cacheflush.h | 5 +++++
 1 file changed, 5 insertions(+)
include/asm-generic/cacheflush.h +5 -0
index 907fa5d16494..093b743da596 100644
@@ -2,6 +2,11 @@
 #ifndef _ASM_GENERIC_CACHEFLUSH_H
 #define _ASM_GENERIC_CACHEFLUSH_H
 
+struct address_space;
+struct mm_struct;
+struct page;
+struct vm_area_struct;
+
 /*
  * The cache doesn't need to be flushed when TLB entries change when
  * the cache is mapped to physical memory, not virtual memory
Signature · 1 line
2.27.0