diff mbox series

[v3,14/14] btrfs: Enable W=1 checks for btrfs

Message ID 20210122095805.620458-15-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series Make btrfs W=1 clean | expand

Commit Message

Nikolay Borisov Jan. 22, 2021, 9:58 a.m. UTC
Now that the btrfs' codebase is clean of W=1 warning let's enable those
checks unconditionally for the entire fs/btrfs/ and its subdirectories.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/Makefile | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

David Sterba Jan. 22, 2021, 4:35 p.m. UTC | #1
On Fri, Jan 22, 2021 at 11:58:05AM +0200, Nikolay Borisov wrote:
> Now that the btrfs' codebase is clean of W=1 warning let's enable those
> checks unconditionally for the entire fs/btrfs/ and its subdirectories.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  fs/btrfs/Makefile | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
> index 9f1b1a88e317..44faee776027 100644
> --- a/fs/btrfs/Makefile
> +++ b/fs/btrfs/Makefile
> @@ -1,5 +1,22 @@
>  # SPDX-License-Identifier: GPL-2.0
>  
> +subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
> +subdir-ccflags-y += -Wmissing-declarations
> +subdir-ccflags-y += -Wmissing-format-attribute
> +subdir-ccflags-y += -Wmissing-prototypes
> +subdir-ccflags-y += -Wold-style-definition
> +subdir-ccflags-y += -Wmissing-include-dirs
> +subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
> +subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)

-Wunused-const-variable triggers the zstd warning, I would leave it out
for now until the zstd patch is merged as I want to add the rest of the
series to misc-next and this would not be a clean build.



> +subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
> +subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
> +# The following turn off the warnings enabled by -Wextra
> +subdir-ccflags-y += -Wno-missing-field-initializers
> +subdir-ccflags-y += -Wno-sign-compare
> +subdir-ccflags-y += -Wno-type-limits
> +
> +cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $<

I'll add a comment what this means

>  obj-$(CONFIG_BTRFS_FS) := btrfs.o
>  
>  btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \
> -- 
> 2.25.1
diff mbox series

Patch

diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index 9f1b1a88e317..44faee776027 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -1,5 +1,22 @@ 
 # SPDX-License-Identifier: GPL-2.0
 
+subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
+subdir-ccflags-y += -Wmissing-declarations
+subdir-ccflags-y += -Wmissing-format-attribute
+subdir-ccflags-y += -Wmissing-prototypes
+subdir-ccflags-y += -Wold-style-definition
+subdir-ccflags-y += -Wmissing-include-dirs
+subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
+subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
+subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
+subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
+# The following turn off the warnings enabled by -Wextra
+subdir-ccflags-y += -Wno-missing-field-initializers
+subdir-ccflags-y += -Wno-sign-compare
+subdir-ccflags-y += -Wno-type-limits
+
+cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $<
+
 obj-$(CONFIG_BTRFS_FS) := btrfs.o
 
 btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \