diff mbox

[v2,2/2] cxl: use -Werror only with CONFIG_PPC_WERROR

Message ID 1452277810-98195-2-git-send-email-computersforpeace@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Brian Norris Jan. 8, 2016, 6:30 p.m. UTC
Some developers really like to have -Werror enabled for their code, as
it helps to ensure warning free code. Others don't want -Werror, as it
(for example) can cause problems when newer (or older) compilers have
different sets of warnings, or new warnings can appear just when turning
up the warning level (e.g., make W=1 or W=2). Thus, it seems prudent to
have the use of -Werror be configurable.

It so happens that cxl is only built on PowerPC, and PowerPC already
has a nice set of Kconfig options for this, under CONFIG_PPC_WERROR. So
let's use that, and the world is a happy place again! (Note that
PPC_WERROR defaults to =y, so the common case compile should still be
enforcing -Werror.)

Fixes: d3d73f4b38a8 ("cxl: Compile with -Werror")
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
v2: new in v2

 drivers/misc/cxl/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Ellerman Jan. 12, 2016, 12:32 p.m. UTC | #1
On Fri, 2016-08-01 at 18:30:10 UTC, Brian Norris wrote:
> Some developers really like to have -Werror enabled for their code, as
> it helps to ensure warning free code. Others don't want -Werror, as it
> (for example) can cause problems when newer (or older) compilers have
> different sets of warnings, or new warnings can appear just when turning
> up the warning level (e.g., make W=1 or W=2). Thus, it seems prudent to
> have the use of -Werror be configurable.
> 
> It so happens that cxl is only built on PowerPC, and PowerPC already
> has a nice set of Kconfig options for this, under CONFIG_PPC_WERROR. So
> let's use that, and the world is a happy place again! (Note that
> PPC_WERROR defaults to =y, so the common case compile should still be
> enforcing -Werror.)
> 
> Fixes: d3d73f4b38a8 ("cxl: Compile with -Werror")
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/57f7c3932516b9f7908d9b0a24

cheers
diff mbox

Patch

diff --git a/drivers/misc/cxl/Makefile b/drivers/misc/cxl/Makefile
index ab6f392d3504..be2ac5ce349f 100644
--- a/drivers/misc/cxl/Makefile
+++ b/drivers/misc/cxl/Makefile
@@ -1,4 +1,5 @@ 
-ccflags-y := -Werror $(call cc-disable-warning, unused-const-variable)
+ccflags-y			:= $(call cc-disable-warning, unused-const-variable)
+ccflags-$(CONFIG_PPC_WERROR)	+= -Werror
 
 cxl-y				+= main.o file.o irq.o fault.o native.o
 cxl-y				+= context.o sysfs.o debugfs.o pci.o trace.o