* Re: [PATCH] staging: vchiq_arm: mark vchiq_platform_init() static
2023-05-16 20:25 [PATCH] staging: vchiq_arm: mark vchiq_platform_init() static Arnd Bergmann
@ 2023-05-16 23:29 ` Florian Fainelli
2023-05-17 4:13 ` Umang Jain
2023-05-28 9:13 ` Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2023-05-16 23:29 UTC (permalink / raw)
To: Arnd Bergmann, Florian Fainelli, Greg Kroah-Hartman,
Stefan Wahren
Cc: Arnd Bergmann, Broadcom internal kernel review list, Umang Jain,
Adrien Thierry, Phil Elwell, Peter Zijlstra,
Uwe Kleine-König, linux-rpi-kernel, linux-arm-kernel,
linux-staging, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1654 bytes --]
On 5/16/23 13:25, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This function has no callers from other files, and the declaration
> was removed a while ago, causing a W=1 warning:
>
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:465:5: error: no previous prototype for 'vchiq_platform_init'
>
> Marking it static solves this problem but introduces a new warning
> since gcc determines that 'g_fragments_base' is never initialized
> in some kernel configurations:
>
> In file included from include/linux/string.h:254,
> from include/linux/bitmap.h:11,
> from include/linux/cpumask.h:12,
> from include/linux/mm_types_task.h:14,
> from include/linux/mm_types.h:5,
> from include/linux/buildid.h:5,
> from include/linux/module.h:14,
> from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8:
> In function 'memcpy_to_page',
> inlined from 'free_pagelist' at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:433:4:
> include/linux/fortify-string.h:57:33: error: argument 2 null where non-null expected [-Werror=nonnull]
> include/linux/highmem.h:427:9: note: in expansion of macro 'memcpy'
> 427 | memcpy(to + offset, from, len);
> | ^~~~~~
>
> Add a NULL pointer check for this in addition to the static annotation
> to avoid both.
>
> Fixes: 89cc4218f640 ("staging: vchiq_arm: drop unnecessary declarations")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] staging: vchiq_arm: mark vchiq_platform_init() static
2023-05-16 20:25 [PATCH] staging: vchiq_arm: mark vchiq_platform_init() static Arnd Bergmann
2023-05-16 23:29 ` Florian Fainelli
@ 2023-05-17 4:13 ` Umang Jain
2023-05-28 9:13 ` Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Umang Jain @ 2023-05-17 4:13 UTC (permalink / raw)
To: Arnd Bergmann, Florian Fainelli, Greg Kroah-Hartman,
Stefan Wahren
Cc: Arnd Bergmann, Broadcom internal kernel review list,
Adrien Thierry, Phil Elwell, Peter Zijlstra,
Uwe Kleine-König, linux-rpi-kernel, linux-arm-kernel,
linux-staging, linux-kernel
Hi
On 5/17/23 1:55 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This function has no callers from other files, and the declaration
> was removed a while ago, causing a W=1 warning:
>
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:465:5: error: no previous prototype for 'vchiq_platform_init'
>
> Marking it static solves this problem but introduces a new warning
> since gcc determines that 'g_fragments_base' is never initialized
> in some kernel configurations:
>
> In file included from include/linux/string.h:254,
> from include/linux/bitmap.h:11,
> from include/linux/cpumask.h:12,
> from include/linux/mm_types_task.h:14,
> from include/linux/mm_types.h:5,
> from include/linux/buildid.h:5,
> from include/linux/module.h:14,
> from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8:
> In function 'memcpy_to_page',
> inlined from 'free_pagelist' at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:433:4:
> include/linux/fortify-string.h:57:33: error: argument 2 null where non-null expected [-Werror=nonnull]
> include/linux/highmem.h:427:9: note: in expansion of macro 'memcpy'
> 427 | memcpy(to + offset, from, len);
> | ^~~~~~
>
> Add a NULL pointer check for this in addition to the static annotation
> to avoid both.
>
> Fixes: 89cc4218f640 ("staging: vchiq_arm: drop unnecessary declarations")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index 90a3958d1f29..aa2313f3bcab 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -415,7 +415,7 @@ free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagel
> pagelistinfo->scatterlist_mapped = 0;
>
> /* Deal with any partial cache lines (fragments) */
> - if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS) {
> + if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS && g_fragments_base) {
> char *fragments = g_fragments_base +
> (pagelist->type - PAGELIST_READ_WITH_FRAGMENTS) *
> g_fragments_size;
> @@ -462,7 +462,7 @@ free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagel
> cleanup_pagelistinfo(instance, pagelistinfo);
> }
>
> -int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
> +static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
> {
> struct device *dev = &pdev->dev;
> struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] staging: vchiq_arm: mark vchiq_platform_init() static
2023-05-16 20:25 [PATCH] staging: vchiq_arm: mark vchiq_platform_init() static Arnd Bergmann
2023-05-16 23:29 ` Florian Fainelli
2023-05-17 4:13 ` Umang Jain
@ 2023-05-28 9:13 ` Greg Kroah-Hartman
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2023-05-28 9:13 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Florian Fainelli, Stefan Wahren, Arnd Bergmann,
Broadcom internal kernel review list, Umang Jain, Adrien Thierry,
Phil Elwell, Peter Zijlstra, Uwe Kleine-König,
linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel
On Tue, May 16, 2023 at 10:25:55PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This function has no callers from other files, and the declaration
> was removed a while ago, causing a W=1 warning:
>
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:465:5: error: no previous prototype for 'vchiq_platform_init'
>
> Marking it static solves this problem but introduces a new warning
> since gcc determines that 'g_fragments_base' is never initialized
> in some kernel configurations:
>
> In file included from include/linux/string.h:254,
> from include/linux/bitmap.h:11,
> from include/linux/cpumask.h:12,
> from include/linux/mm_types_task.h:14,
> from include/linux/mm_types.h:5,
> from include/linux/buildid.h:5,
> from include/linux/module.h:14,
> from drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:8:
> In function 'memcpy_to_page',
> inlined from 'free_pagelist' at drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:433:4:
> include/linux/fortify-string.h:57:33: error: argument 2 null where non-null expected [-Werror=nonnull]
> include/linux/highmem.h:427:9: note: in expansion of macro 'memcpy'
> 427 | memcpy(to + offset, from, len);
> | ^~~~~~
>
> Add a NULL pointer check for this in addition to the static annotation
> to avoid both.
>
> Fixes: 89cc4218f640 ("staging: vchiq_arm: drop unnecessary declarations")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Nice, thanks for finally fixing this up, it's been a low-grade annoyance
for a very long time.
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread