Message ID | 20230516202257.559952-1-arnd@kernel.org (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | fbdev: fbmem: mark get_fb_unmapped_area() static | expand |
Hi Arnd, On Tue, May 16, 2023 at 10:23 PM Arnd Bergmann <arnd@kernel.org> wrote: > From: Arnd Bergmann <arnd@arndb.de> > > There is a global function with this name on sparc, but no > global declaration: > > drivers/video/fbdev/core/fbmem.c:1469:15: error: no previous prototype for 'get_fb_unmapped_area' > > Make the generic definition static to avoid this warning. On > sparc, this is never seen. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Thanks for your patch! > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -1468,7 +1468,7 @@ __releases(&info->lock) > } > > #if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU) > -unsigned long get_fb_unmapped_area(struct file *filp, > +static unsigned long get_fb_unmapped_area(struct file *filp, > unsigned long addr, unsigned long len, > unsigned long pgoff, unsigned long flags) > { LGTM, as this is unrelated to the SPARC function, and SPARC does not support nommu (yet? ;-) drivers/video/fbdev/Kconfig:config FB_PROVIDE_GET_FB_UNMAPPED_AREA drivers/video/fbdev/Kconfig- bool drivers/video/fbdev/Kconfig- depends on FB drivers/video/fbdev/Kconfig- help drivers/video/fbdev/Kconfig- Allow generic frame-buffer to provide get_fb_unmapped_area drivers/video/fbdev/Kconfig- function. Probably you want to update this help text, too. E.g. "to provide shareable character device support on nommu"? This seems to be selected only by DRM_STM. Gr{oetje,eeting}s, Geert
* Geert Uytterhoeven <geert@linux-m68k.org>: > Hi Arnd, > > On Tue, May 16, 2023 at 10:23 PM Arnd Bergmann <arnd@kernel.org> wrote: > > From: Arnd Bergmann <arnd@arndb.de> > > > > There is a global function with this name on sparc, but no > > global declaration: > > > > drivers/video/fbdev/core/fbmem.c:1469:15: error: no previous prototype for 'get_fb_unmapped_area' > > > > Make the generic definition static to avoid this warning. On > > sparc, this is never seen. > > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > > --- a/drivers/video/fbdev/core/fbmem.c > > +++ b/drivers/video/fbdev/core/fbmem.c > > @@ -1468,7 +1468,7 @@ __releases(&info->lock) > > } > > > > #if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU) > > -unsigned long get_fb_unmapped_area(struct file *filp, > > +static unsigned long get_fb_unmapped_area(struct file *filp, > > unsigned long addr, unsigned long len, > > unsigned long pgoff, unsigned long flags) > > { > > LGTM, as this is unrelated to the SPARC function, and SPARC does > not support nommu (yet? ;-) > > drivers/video/fbdev/Kconfig:config FB_PROVIDE_GET_FB_UNMAPPED_AREA > drivers/video/fbdev/Kconfig- bool > drivers/video/fbdev/Kconfig- depends on FB > drivers/video/fbdev/Kconfig- help > drivers/video/fbdev/Kconfig- Allow generic frame-buffer to > provide get_fb_unmapped_area > drivers/video/fbdev/Kconfig- function. > > Probably you want to update this help text, too. E.g. > "to provide shareable character device support on nommu"? I've added Geerts suggestions and made it dependend on !MMU. Applied to fbdev git tree as below. Thanks! Helge From 9adfa68ca0ddd63007cdce60a8ffcb493bb30d97 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann <arnd@arndb.de> Subject: [PATCH] fbdev: fbmem: mark get_fb_unmapped_area() static There is a global function with this name on sparc, but no global declaration: drivers/video/fbdev/core/fbmem.c:1469:15: error: no previous prototype for 'get_fb_unmapped_area' Make the generic definition static to avoid this warning. On sparc, this is never seen. Edit by Helge: Update Kconfig text as suggested by Geert Uytterhoeven and make it dependend on !MMU. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Helge Deller <deller@gmx.de> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 96e91570cdd3..1688875a07de 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -121,10 +121,10 @@ config FB_SYS_IMAGEBLIT config FB_PROVIDE_GET_FB_UNMAPPED_AREA bool - depends on FB + depends on FB && !MMU help Allow generic frame-buffer to provide get_fb_unmapped_area - function. + function to provide shareable character device support on nommu. menuconfig FB_FOREIGN_ENDIAN bool "Framebuffer foreign endianness support" diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index e808dc86001c..21a108d9f08e 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1467,8 +1467,8 @@ __releases(&info->lock) return 0; } -#if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU) -unsigned long get_fb_unmapped_area(struct file *filp, +#if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) +static unsigned long get_fb_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { @@ -1494,8 +1494,7 @@ static const struct file_operations fb_fops = { .open = fb_open, .release = fb_release, #if defined(HAVE_ARCH_FB_UNMAPPED_AREA) || \ - (defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && \ - !defined(CONFIG_MMU)) + defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) .get_unmapped_area = get_fb_unmapped_area, #endif #ifdef CONFIG_FB_DEFERRED_IO
Hi Helge, On Fri, May 19, 2023 at 4:37 PM Helge Deller <deller@gmx.de> wrote: > * Geert Uytterhoeven <geert@linux-m68k.org>: > > On Tue, May 16, 2023 at 10:23 PM Arnd Bergmann <arnd@kernel.org> wrote: > > > From: Arnd Bergmann <arnd@arndb.de> > > > > > > There is a global function with this name on sparc, but no > > > global declaration: > > > > > > drivers/video/fbdev/core/fbmem.c:1469:15: error: no previous prototype for 'get_fb_unmapped_area' > > > > > > Make the generic definition static to avoid this warning. On > > > sparc, this is never seen. > > > > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > > > > > --- a/drivers/video/fbdev/core/fbmem.c > > > +++ b/drivers/video/fbdev/core/fbmem.c > > > @@ -1468,7 +1468,7 @@ __releases(&info->lock) > > > } > > > > > > #if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU) > > > -unsigned long get_fb_unmapped_area(struct file *filp, > > > +static unsigned long get_fb_unmapped_area(struct file *filp, > > > unsigned long addr, unsigned long len, > > > unsigned long pgoff, unsigned long flags) > > > { > > > > LGTM, as this is unrelated to the SPARC function, and SPARC does > > not support nommu (yet? ;-) > > > > drivers/video/fbdev/Kconfig:config FB_PROVIDE_GET_FB_UNMAPPED_AREA > > drivers/video/fbdev/Kconfig- bool > > drivers/video/fbdev/Kconfig- depends on FB > > drivers/video/fbdev/Kconfig- help > > drivers/video/fbdev/Kconfig- Allow generic frame-buffer to > > provide get_fb_unmapped_area > > drivers/video/fbdev/Kconfig- function. > > > > Probably you want to update this help text, too. E.g. > > "to provide shareable character device support on nommu"? > > I've added Geerts suggestions and made it dependend on !MMU. > > Applied to fbdev git tree as below. > > Thanks! > Helge > > > From 9adfa68ca0ddd63007cdce60a8ffcb493bb30d97 Mon Sep 17 00:00:00 2001 > From: Arnd Bergmann <arnd@arndb.de> > Subject: [PATCH] fbdev: fbmem: mark get_fb_unmapped_area() static > > There is a global function with this name on sparc, but no > global declaration: > > drivers/video/fbdev/core/fbmem.c:1469:15: error: no previous prototype for 'get_fb_unmapped_area' > > Make the generic definition static to avoid this warning. On > sparc, this is never seen. > > Edit by Helge: > Update Kconfig text as suggested by Geert Uytterhoeven and make it dependend on > !MMU. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > Signed-off-by: Helge Deller <deller@gmx.de> > > diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig > index 96e91570cdd3..1688875a07de 100644 > --- a/drivers/video/fbdev/Kconfig > +++ b/drivers/video/fbdev/Kconfig > @@ -121,10 +121,10 @@ config FB_SYS_IMAGEBLIT > > config FB_PROVIDE_GET_FB_UNMAPPED_AREA > bool > - depends on FB > + depends on FB && !MMU I expect this to cause a Kconfig warning when enabling DRM_STM with MMU=y (e.g. multi_v7_defconfig). ARCH_STM32 seems to support both MMU=y and MMU=n. > help > Allow generic frame-buffer to provide get_fb_unmapped_area > - function. > + function to provide shareable character device support on nommu. > Gr{oetje,eeting}s, Geert
On 5/19/23 16:44, Geert Uytterhoeven wrote: > Hi Helge, > > On Fri, May 19, 2023 at 4:37 PM Helge Deller <deller@gmx.de> wrote: >> * Geert Uytterhoeven <geert@linux-m68k.org>: >>> On Tue, May 16, 2023 at 10:23 PM Arnd Bergmann <arnd@kernel.org> wrote: >>>> From: Arnd Bergmann <arnd@arndb.de> >>>> >>>> There is a global function with this name on sparc, but no >>>> global declaration: >>>> >>>> drivers/video/fbdev/core/fbmem.c:1469:15: error: no previous prototype for 'get_fb_unmapped_area' >>>> >>>> Make the generic definition static to avoid this warning. On >>>> sparc, this is never seen. >>>> >>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de> >>> >>>> --- a/drivers/video/fbdev/core/fbmem.c >>>> +++ b/drivers/video/fbdev/core/fbmem.c >>>> @@ -1468,7 +1468,7 @@ __releases(&info->lock) >>>> } >>>> >>>> #if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU) >>>> -unsigned long get_fb_unmapped_area(struct file *filp, >>>> +static unsigned long get_fb_unmapped_area(struct file *filp, >>>> unsigned long addr, unsigned long len, >>>> unsigned long pgoff, unsigned long flags) >>>> { >>> >>> LGTM, as this is unrelated to the SPARC function, and SPARC does >>> not support nommu (yet? ;-) >>> >>> drivers/video/fbdev/Kconfig:config FB_PROVIDE_GET_FB_UNMAPPED_AREA >>> drivers/video/fbdev/Kconfig- bool >>> drivers/video/fbdev/Kconfig- depends on FB >>> drivers/video/fbdev/Kconfig- help >>> drivers/video/fbdev/Kconfig- Allow generic frame-buffer to >>> provide get_fb_unmapped_area >>> drivers/video/fbdev/Kconfig- function. >>> >>> Probably you want to update this help text, too. E.g. >>> "to provide shareable character device support on nommu"? >> >> I've added Geerts suggestions and made it dependend on !MMU. >> >> Applied to fbdev git tree as below. >> >> Thanks! >> Helge >> >> >> From 9adfa68ca0ddd63007cdce60a8ffcb493bb30d97 Mon Sep 17 00:00:00 2001 >> From: Arnd Bergmann <arnd@arndb.de> >> Subject: [PATCH] fbdev: fbmem: mark get_fb_unmapped_area() static >> >> There is a global function with this name on sparc, but no >> global declaration: >> >> drivers/video/fbdev/core/fbmem.c:1469:15: error: no previous prototype for 'get_fb_unmapped_area' >> >> Make the generic definition static to avoid this warning. On >> sparc, this is never seen. >> >> Edit by Helge: >> Update Kconfig text as suggested by Geert Uytterhoeven and make it dependend on >> !MMU. >> >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> >> Signed-off-by: Helge Deller <deller@gmx.de> >> >> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig >> index 96e91570cdd3..1688875a07de 100644 >> --- a/drivers/video/fbdev/Kconfig >> +++ b/drivers/video/fbdev/Kconfig >> @@ -121,10 +121,10 @@ config FB_SYS_IMAGEBLIT >> >> config FB_PROVIDE_GET_FB_UNMAPPED_AREA >> bool >> - depends on FB >> + depends on FB && !MMU > > I expect this to cause a Kconfig warning when enabling DRM_STM > with MMU=y (e.g. multi_v7_defconfig). > ARCH_STM32 seems to support both MMU=y and MMU=n. yes, probably. I revert that part again, as it's the least invasive change. Thanks. Helge
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index e808dc86001c..28739f1cb5e7 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1468,7 +1468,7 @@ __releases(&info->lock) } #if defined(CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA) && !defined(CONFIG_MMU) -unsigned long get_fb_unmapped_area(struct file *filp, +static unsigned long get_fb_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) {