Fix two instances of -Wstrict-prototypes in drm/amd
Subsystems (4)
cover Fix two instances of -Wstrict-prototypes in drm/amd
Hi everyone,
These two patches resolve two instances of -Wstrict-prototypes with newer versions of clang that are present in 5.4. The main Makefile makes this a hard error.
The first patch is upstream commit 63617d8b125e ("drm/amdkfd: add missing void argument to function kgd2kfd_init"), which showed up in 5.5.
The second patch has no upstream equivalent, as the code in question was removed in commit e392c887df97 ("drm/amdkfd: Use array to probe kfd2kgd_calls") upstream, which is part of a larger series that did not look reasonable for stable. I opted to just fix the warning in the same manner as the prior patch, which is less risky and accomplishes the same end result of no warning.
Colin Ian King (1):
drm/amdkfd: add missing void argument to function kgd2kfd_init
Nathan Chancellor (1):
drm/amdkfd: Fix -Wstrict-prototypes from
amdgpu_amdkfd_gfx_10_0_get_functions()
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_module.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
base-commit: 2845ff3fd34499603249676495c524a35e795b45
Signature · 1 line
2.35.1
PATCH 1/2 drm/amdkfd: add missing void argument to function kgd2kfd_init
From: Colin Ian King <[email protected]>
commit 63617d8b125ed9f674133dd000b6df58d6b2965a upstream.
Function kgd2kfd_init is missing a void argument, add it to clean up the non-ANSI function declaration.
--- drivers/gpu/drm/amd/amdkfd/kfd_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_module.c +1 -1
@@ -82,7 +82,7 @@ static void kfd_exit(void)kfd_chardev_exit (); } -int kgd2kfd_init () +int kgd2kfd_init (void ) {return kfd_init (); }
Signature · 1 line
2.35.1
PATCH 2/2 drm/amdkfd: Fix -Wstrict-prototypes from amdgpu_amdkfd_gfx_10_0_get_functions()
In reply to Nathan ChancellorThis patch is for linux-5.4.y only, it has no equivalent change upstream.
When building x86_64 allmodconfig with tip of tree clang, there is an instance of -Wstrict-prototypes:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c:168:59: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] struct kfd2kgd_calls *amdgpu_amdkfd_gfx_10_0_get_functions()
^
void1 error generated.
amdgpu_amdkfd_gfx_10_0_get_functions() is prototyped properly in drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h but its definition in amdgpu_amdkfd_gfx_v10.c does not have the argument types specified, which causes the warning. GCC does not warn because it permits an old-style definition if the prototype has the argument types.
This code was eliminated by commit e392c887df97 ("drm/amdkfd: Use array to probe kfd2kgd_calls"), which was a part of a larger series that does not look very suitable for stable. Just fix this one location, as it was the only instance of this new warning across a variety of builds.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +1 -1
@@ -165,7 +165,7 @@ static const struct kfd2kgd_calls kfd2kgd = { .get_tile_config = amdgpu_amdkfd_get_tile_config, }; -struct kfd2kgd_calls *amdgpu_amdkfd_gfx_10_0_get_functions () +struct kfd2kgd_calls *amdgpu_amdkfd_gfx_10_0_get_functions (void ) {return (struct kfd2kgd_calls *)&kfd2kgd; }
Signature · 1 line
2.35.1
[Public]
Quoted 28 lines
-----Original Message-----
From: Nathan Chancellor <[email protected]>
Sent: Monday, April 11, 2022 12:43 PM
To: Greg Kroah-Hartman <[email protected]>; Sasha Levin <[email protected]>
Cc: Kuehling, Felix <[email protected]>; Deucher, Alexander <[email protected]>; Nick Desaulniers <[email protected]>; [email protected]; [email protected]; [email protected]; Nathan Chancellor <[email protected]>
Subject: [PATCH 5.4 0/2] Fix two instances of -Wstrict-prototypes in drm/amdHi everyone,
These two patches resolve two instances of -Wstrict-prototypes with newer versions of clang that are present in 5.4. The main
Makefilemakes this a hard error.The first patch is upstream commit
63617d8b125e("drm/amdkfd: add missing void argument to functionkgd2kfd_init"), which showed up in 5.5.The second patch has no upstream equivalent, as the code in question was removed in commit
e392c887df97("drm/amdkfd: Use array to probekfd2kgd_calls") upstream, which is part of a larger series that did not look reasonable for stable. I opted to just fix the warning in the same manner as the prior patch, which is less risky and accomplishes the same end result of no warning.
Quoted 6 lines
Colin Ian King (1):
drm/amdkfd: add missing void argument to functionkgd2kfd_initNathan Chancellor (1):
drm/amdkfd: Fix -Wstrict-prototypes fromamdgpu_amdkfd_gfx_10_0_get_functions()
Series is:
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_module.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)base-commit:
2845ff3fd34499603249676495c524a35e795b45--
2.35.1
Patch "drm/amdkfd: add missing void argument to function kgd2kfd_init" has been added to the 5.4-stable tree
In reply to Nathan ChancellorThis is a note to let you know that I've just added the patch titled
drm/amdkfd: add missing void argument to function kgd2kfd_init
to the 5.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-amdkfd-add-missing-void-argument-to-function-kgd2kfd_init.patch
and it can be found in the queue-5.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From foo@baz Mon Apr 11 06:48:58 PM CEST 2022
From: Nathan Chancellor <[email protected]>
Date: Mon, 11 Apr 2022 09:43:07 -0700
Subject: drm/amdkfd: add missing void argument to function kgd2kfd_init
To: Greg Kroah-Hartman <[email protected]>, Sasha Levin <[email protected]>
Cc: Felix Kuehling <[email protected]>, Alex Deucher <[email protected]>, Nick Desaulniers <[email protected]>, [email protected], [email protected], [email protected], Colin Ian King <[email protected]>, Randy Dunlap <[email protected]>, Nathan Chancellor <[email protected]>
Message-ID: <[email protected]>
From: Nathan Chancellor <[email protected]>
From: Colin Ian King <[email protected]>
commit 63617d8b125ed9f674133dd000b6df58d6b2965a upstream.
Function kgd2kfd_init is missing a void argument, add it to clean up the non-ANSI function declaration.
--- drivers/gpu/drm/amd/amdkfd/kfd_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_module.c +1 -1
@@ -82,7 +82,7 @@ static void kfd_exit(void)kfd_chardev_exit (); } -int kgd2kfd_init () +int kgd2kfd_init (void ) {return kfd_init (); }
Patches currently in stable-queue which might be from [email protected] are
queue-5.4/drm-amdkfd-fix-wstrict-prototypes-from-amdgpu_amdkfd_gfx_10_0_get_functions.patch queue-5.4/drm-amdkfd-add-missing-void-argument-to-function-kgd2kfd_init.patch queue-5.4/arm64-module-remove-noload-from-linker-script.patch queue-5.4/tools-build-filter-out-options-and-warnings-not-supported-by-clang.patch queue-5.4/riscv-module-remove-noload.patch queue-5.4/tools-build-use-shell-instead-of-to-get-embedded-libperl-s-ccopts.patch
Patch "drm/amdkfd: Fix -Wstrict-prototypes from amdgpu_amdkfd_gfx_10_0_get_functions()" has been added to the 5.4-stable tree
In reply to Nathan ChancellorThis is a note to let you know that I've just added the patch titled
drm/amdkfd: Fix -Wstrict-prototypes from amdgpu_amdkfd_gfx_10_0_get_functions()
to the 5.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-amdkfd-fix-wstrict-prototypes-from-amdgpu_amdkfd_gfx_10_0_get_functions.patch
and it can be found in the queue-5.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From foo@baz Mon Apr 11 06:48:58 PM CEST 2022
From: Nathan Chancellor <[email protected]>
Date: Mon, 11 Apr 2022 09:43:08 -0700
Subject: drm/amdkfd: Fix -Wstrict-prototypes from amdgpu_amdkfd_gfx_10_0_get_functions()
To: Greg Kroah-Hartman <[email protected]>, Sasha Levin <[email protected]>
Cc: Felix Kuehling <[email protected]>, Alex Deucher <[email protected]>, Nick Desaulniers <[email protected]>, [email protected], [email protected], [email protected], Nathan Chancellor <[email protected]>
Message-ID: <[email protected]>
From: Nathan Chancellor <[email protected]>
This patch is for linux-5.4.y only, it has no equivalent change upstream.
When building x86_64 allmodconfig with tip of tree clang, there is an instance of -Wstrict-prototypes:
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c:168:59: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] struct kfd2kgd_calls *amdgpu_amdkfd_gfx_10_0_get_functions()
^
void1 error generated.
amdgpu_amdkfd_gfx_10_0_get_functions() is prototyped properly in drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h but its definition in amdgpu_amdkfd_gfx_v10.c does not have the argument types specified, which causes the warning. GCC does not warn because it permits an old-style definition if the prototype has the argument types.
This code was eliminated by commit e392c887df97 ("drm/amdkfd: Use array to probe kfd2kgd_calls"), which was a part of a larger series that does not look very suitable for stable. Just fix this one location, as it was the only instance of this new warning across a variety of builds.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +1 -1
@@ -165,7 +165,7 @@ static const struct kfd2kgd_calls kfd2kg .get_tile_config = amdgpu_amdkfd_get_tile_config, }; -struct kfd2kgd_calls *amdgpu_amdkfd_gfx_10_0_get_functions () +struct kfd2kgd_calls *amdgpu_amdkfd_gfx_10_0_get_functions (void ) {return (struct kfd2kgd_calls *)&kfd2kgd; }
Patches currently in stable-queue which might be from [email protected] are
queue-5.4/drm-amdkfd-fix-wstrict-prototypes-from-amdgpu_amdkfd_gfx_10_0_get_functions.patch queue-5.4/drm-amdkfd-add-missing-void-argument-to-function-kgd2kfd_init.patch queue-5.4/arm64-module-remove-noload-from-linker-script.patch queue-5.4/tools-build-filter-out-options-and-warnings-not-supported-by-clang.patch queue-5.4/riscv-module-remove-noload.patch queue-5.4/tools-build-use-shell-instead-of-to-get-embedded-libperl-s-ccopts.patch
Greg Kroah-Hartman
maintainerQuoted 22 lines · Nathan Chancellor
Hi everyone,
These two patches resolve two instances of -Wstrict-prototypes with newer versions of clang that are present in 5.4. The main
Makefilemakes this a hard error.The first patch is upstream commit
63617d8b125e("drm/amdkfd: add missing void argument to functionkgd2kfd_init"), which showed up in 5.5.The second patch has no upstream equivalent, as the code in question was removed in commit
e392c887df97("drm/amdkfd: Use array to probekfd2kgd_calls") upstream, which is part of a larger series that did not look reasonable for stable. I opted to just fix the warning in the same manner as the prior patch, which is less risky and accomplishes the same end result of no warning.Colin Ian King (1):
drm/amdkfd: add missing void argument to functionkgd2kfd_initNathan Chancellor (1):
drm/amdkfd: Fix -Wstrict-prototypes from
Quoted 11 lines
amdgpu_amdkfd_gfx_10_0_get_functions()drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_module.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)base-commit:
2845ff3fd34499603249676495c524a35e795b45Signature · 1 line
2.35.1
Now queued up, thanks.
greg k-h