mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 07:47:50 +00:00
minmax: don't use max() in situations that want a C constant expression
We only had a couple of array[] declarations, and changing them to just use 'MAX()' instead of 'max()' fixes the issue. This will allow us to simplify our min/max macros enormously, since they can now unconditionally use temporary variables to avoid using the argument values multiple times. Cc: David Laight <David.Laight@aculab.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -1080,7 +1080,7 @@ char *resource_string(char *buf, char *end, struct resource *res,
|
||||
#define FLAG_BUF_SIZE (2 * sizeof(res->flags))
|
||||
#define DECODED_BUF_SIZE sizeof("[mem - 64bit pref window disabled]")
|
||||
#define RAW_BUF_SIZE sizeof("[mem - flags 0x]")
|
||||
char sym[max(2*RSRC_BUF_SIZE + DECODED_BUF_SIZE,
|
||||
char sym[MAX(2*RSRC_BUF_SIZE + DECODED_BUF_SIZE,
|
||||
2*RSRC_BUF_SIZE + FLAG_BUF_SIZE + RAW_BUF_SIZE)];
|
||||
|
||||
char *p = sym, *pend = sym + sizeof(sym);
|
||||
|
||||
Reference in New Issue
Block a user