From: Linus Torvalds <torva...@linux-foundation.org>

[ Upstream commit cb04e8b1d2f24c4c2c92f7b7529031fc35a16fed ]

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.lai...@aculab.com>
Cc: Lorenzo Stoakes <lorenzo.stoa...@oracle.com>
Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
Signed-off-by: Eliav Farber <farb...@amazon.com>
---
 drivers/input/touchscreen/cyttsp4_core.c | 2 +-
 fs/btrfs/tree-checker.c                  | 2 +-
 lib/vsprintf.c                           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/touchscreen/cyttsp4_core.c 
b/drivers/input/touchscreen/cyttsp4_core.c
index 02a73d9a4def..c10140c9aafa 100644
--- a/drivers/input/touchscreen/cyttsp4_core.c
+++ b/drivers/input/touchscreen/cyttsp4_core.c
@@ -857,7 +857,7 @@ static void cyttsp4_get_mt_touches(struct cyttsp4_mt_data 
*md, int num_cur_tch)
        struct cyttsp4_touch tch;
        int sig;
        int i, j, t = 0;
-       int ids[max(CY_TMA1036_MAX_TCH, CY_TMA4XX_MAX_TCH)];
+       int ids[MAX(CY_TMA1036_MAX_TCH, CY_TMA4XX_MAX_TCH)];
 
        memset(ids, 0, si->si_ofs.tch_abs[CY_TCH_T].max * sizeof(int));
        for (i = 0; i < num_cur_tch; i++) {
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 35b94fe5e78e..cba6293d5574 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -587,7 +587,7 @@ static int check_dir_item(struct extent_buffer *leaf,
                 */
                if (key->type == BTRFS_DIR_ITEM_KEY ||
                    key->type == BTRFS_XATTR_ITEM_KEY) {
-                       char namebuf[max(BTRFS_NAME_LEN, XATTR_NAME_MAX)];
+                       char namebuf[MAX(BTRFS_NAME_LEN, XATTR_NAME_MAX)];
 
                        read_extent_buffer(leaf, namebuf,
                                        (unsigned long)(di + 1), name_len);
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index b08b8ee1bbc0..90372391ce90 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1078,7 +1078,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);
-- 
2.47.3

Reply via email to