diff mbox series

tools/testing/cxl: Disable "missing prototypes / declarations" warnings

Message ID 170543983780.460832.10920261849128601697.stgit@dwillia2-xfh.jf.intel.com
State Accepted
Commit 68deb9972079c9904fe714c049a7f08bd997a9ee
Headers show
Series tools/testing/cxl: Disable "missing prototypes / declarations" warnings | expand

Commit Message

Dan Williams Jan. 16, 2024, 9:17 p.m. UTC
Prevent warnings of the form:

tools/testing/cxl/test/mock.c:44:6: error: no previous prototype for
‘__wrap_is_acpi_device_node’ [-Werror=missing-prototypes]

tools/testing/cxl/test/mock.c:63:5: error: no previous prototype for
‘__wrap_acpi_table_parse_cedt’ [-Werror=missing-prototypes]

tools/testing/cxl/test/mock.c:81:13: error: no previous prototype for
‘__wrap_acpi_evaluate_integer’ [-Werror=missing-prototypes]

...by locally disabling some warnings.

It turns out that:

Commit 0fcb70851fbf ("Makefile.extrawarn: turn on missing-prototypes globally")

...in addition to expanding in-tree coverage, also impacts out-of-tree
module builds like those in tools/testing/cxl/.

Filter out the warning options on unit test code that does not effect
mainline builds.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 tools/testing/cxl/Kbuild      |    2 ++
 tools/testing/cxl/test/Kbuild |    2 ++
 2 files changed, 4 insertions(+)

Comments

Alison Schofield Jan. 17, 2024, 5:24 a.m. UTC | #1
On Tue, Jan 16, 2024 at 01:17:17PM -0800, Dan Williams wrote:
> Prevent warnings of the form:
> 
> tools/testing/cxl/test/mock.c:44:6: error: no previous prototype for
> ‘__wrap_is_acpi_device_node’ [-Werror=missing-prototypes]
> 
> tools/testing/cxl/test/mock.c:63:5: error: no previous prototype for
> ‘__wrap_acpi_table_parse_cedt’ [-Werror=missing-prototypes]
> 
> tools/testing/cxl/test/mock.c:81:13: error: no previous prototype for
> ‘__wrap_acpi_evaluate_integer’ [-Werror=missing-prototypes]
> 
> ...by locally disabling some warnings.
> 
> It turns out that:
> 
> Commit 0fcb70851fbf ("Makefile.extrawarn: turn on missing-prototypes globally")
> 
> ...in addition to expanding in-tree coverage, also impacts out-of-tree
> module builds like those in tools/testing/cxl/.
> 
> Filter out the warning options on unit test code that does not effect
> mainline builds.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Alison Schofield <alison.schofield@intel.com


> ---
>  tools/testing/cxl/Kbuild      |    2 ++
>  tools/testing/cxl/test/Kbuild |    2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/tools/testing/cxl/Kbuild b/tools/testing/cxl/Kbuild
> index 0b12c36902d8..caff3834671f 100644
> --- a/tools/testing/cxl/Kbuild
> +++ b/tools/testing/cxl/Kbuild
> @@ -65,4 +65,6 @@ cxl_core-y += config_check.o
>  cxl_core-y += cxl_core_test.o
>  cxl_core-y += cxl_core_exports.o
>  
> +KBUILD_CFLAGS := $(filter-out -Wmissing-prototypes -Wmissing-declarations, $(KBUILD_CFLAGS))
> +
>  obj-m += test/
> diff --git a/tools/testing/cxl/test/Kbuild b/tools/testing/cxl/test/Kbuild
> index 61d5f7bcddf9..6b1927897856 100644
> --- a/tools/testing/cxl/test/Kbuild
> +++ b/tools/testing/cxl/test/Kbuild
> @@ -8,3 +8,5 @@ obj-m += cxl_mock_mem.o
>  cxl_test-y := cxl.o
>  cxl_mock-y := mock.o
>  cxl_mock_mem-y := mem.o
> +
> +KBUILD_CFLAGS := $(filter-out -Wmissing-prototypes -Wmissing-declarations, $(KBUILD_CFLAGS))
> 
>
diff mbox series

Patch

diff --git a/tools/testing/cxl/Kbuild b/tools/testing/cxl/Kbuild
index 0b12c36902d8..caff3834671f 100644
--- a/tools/testing/cxl/Kbuild
+++ b/tools/testing/cxl/Kbuild
@@ -65,4 +65,6 @@  cxl_core-y += config_check.o
 cxl_core-y += cxl_core_test.o
 cxl_core-y += cxl_core_exports.o
 
+KBUILD_CFLAGS := $(filter-out -Wmissing-prototypes -Wmissing-declarations, $(KBUILD_CFLAGS))
+
 obj-m += test/
diff --git a/tools/testing/cxl/test/Kbuild b/tools/testing/cxl/test/Kbuild
index 61d5f7bcddf9..6b1927897856 100644
--- a/tools/testing/cxl/test/Kbuild
+++ b/tools/testing/cxl/test/Kbuild
@@ -8,3 +8,5 @@  obj-m += cxl_mock_mem.o
 cxl_test-y := cxl.o
 cxl_mock-y := mock.o
 cxl_mock_mem-y := mem.o
+
+KBUILD_CFLAGS := $(filter-out -Wmissing-prototypes -Wmissing-declarations, $(KBUILD_CFLAGS))