drivers/crypto/dwc-spacc/spacc_manager.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Hi all,
After merging the crypto tree, today's linux-next build (x86_64
allmodconfig) failed like this:
drivers/crypto/dwc-spacc/spacc_manager.c:5: error: "MIN" redefined [-Werror]
5 | #define MIN(x, y) (((x) < (y)) ? (x) : (y))
|
In file included from include/linux/kernel.h:28,
from include/linux/interrupt.h:6,
from drivers/crypto/dwc-spacc/spacc_core.h:7,
from drivers/crypto/dwc-spacc/spacc_manager.c:3:
include/linux/minmax.h:329: note: this is the location of the previous definition
329 | #define MIN(a,b) __cmp(min,a,b)
|
cc1: all warnings being treated as errors
Caused by commit
c8981d9230d8 ("crypto: spacc - Add SPAcc Skcipher support")
interacting with commit
1a251f52cfdc ("minmax: make generic MIN() and MAX() macros available everywhere")
from Linus' tree (in v6.11-rc2).
I applied the following merge fix patch. I added the include of
minmax.h just in case it was not included implicitly for some other
build config.
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 12 Aug 2024 10:36:30 +1000
Subject: [PATCH] fixup for "crypto: spacc - Add SPAcc Skcipher support"
interacting with commit
1a251f52cfdc ("minmax: make generic MIN() and MAX() macros available everywhere")
from Linus' tree.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/crypto/dwc-spacc/spacc_manager.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/dwc-spacc/spacc_manager.c b/drivers/crypto/dwc-spacc/spacc_manager.c
index 3b26b27a998f..67c4360334e2 100644
--- a/drivers/crypto/dwc-spacc/spacc_manager.c
+++ b/drivers/crypto/dwc-spacc/spacc_manager.c
@@ -1,9 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
+#include <linux/minmax.h>
#include "spacc_core.h"
-#define MIN(x, y) (((x) < (y)) ? (x) : (y))
-
/* prevent reading past the end of the buffer */
static void read_from_buf(unsigned char *dst, unsigned char *src,
int off, int n, int max)
--
2.43.0
--
Cheers,
Stephen Rothwell
On Mon, Aug 12, 2024 at 10:42:35AM +1000, Stephen Rothwell wrote: > > From: Stephen Rothwell <sfr@canb.auug.org.au> > Date: Mon, 12 Aug 2024 10:36:30 +1000 > Subject: [PATCH] fixup for "crypto: spacc - Add SPAcc Skcipher support" > > interacting with commit > > 1a251f52cfdc ("minmax: make generic MIN() and MAX() macros available everywhere") > > from Linus' tree. > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> > --- > drivers/crypto/dwc-spacc/spacc_manager.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Thanks Stephen. I've applied your patch but I kept the macro but added an ifndef MIN around it. This way it should work either with or without Linus's patch. Cheers, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Hi Herbert, On Tue, 13 Aug 2024 12:16:55 +0800 Herbert Xu <herbert@gondor.apana.org.au> wrote: > > Thanks Stephen. I've applied your patch but I kept the macro but > added an ifndef MIN around it. This way it should work either with > or without Linus's patch. Good idea. Thanks, one less thing for me to carry. -- Cheers, Stephen Rothwell
© 2016 - 2025 Red Hat, Inc.