Skip to contentSkip to conversation

spi: spi-ti-qspi: support large flash devices

PATCH Jean Pihet 1 participant 1 message Jan 14, 2020 4 messages not in the archive SPI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jean Pihet

author
#4 lore raw

Hi Mark,

Quoted 45 lines · Mark Brown

Review

Quoted 4 lines · Jean Pihet
(quoted diff) +4 -0
+                     if (op->addr.val + op->data.nbytes > qspi->mmap_size) {
+                             max_len = qspi->mmap_size - op->addr.val;
+                             op->data.nbytes = min(op->data.nbytes, max_len);
+                     }

This introduces a massive warning splat for me (just one warning but it's very verbose):

CC drivers/spi/spi-ti-qspi.o
In file included from drivers/spi/spi-ti-qspi.c:9:
drivers/spi/spi-ti-qspi.c: In function ‘ti_qspi_adjust_op_size’:
./include/linux/kernel.h:844:29: warning: comparison of distinct pointer types lacks a cast
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))

                             ^~
./include/linux/kernel.h:858:4: note: in expansion of macro ‘__typecheck’
   (__typecheck(x, y) && __no_side_effects(x, y))
    ^~~~~~~~~~~
./include/linux/kernel.h:868:24: note: in expansion of macro ‘__safe_cmp’
  __builtin_choose_expr(__safe_cmp(x, y), \
                        ^~~~~~~~~~
./include/linux/kernel.h:877:19: note: in expansion of macro ‘__careful_cmp’
 #define min(x, y) __careful_cmp(x, y, <)
                   ^~~~~~~~~~~~~
drivers/spi/spi-ti-qspi.c:535:23: note: in expansion of macro ‘min’
     op->data.nbytes = min(op->data.nbytes, max_len);
                       ^~~
./include/linux/kernel.h:844:29: warning: comparison of distinct pointer types lacks a cast
   (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                             ^~
./include/linux/kernel.h:858:4: note: in expansion of macro ‘__typecheck’
   (__typecheck(x, y) && __no_side_effects(x, y))
    ^~~~~~~~~~~
./include/linux/kernel.h:868:24: note: in expansion of macro ‘__safe_cmp’
  __builtin_choose_expr(__safe_cmp(x, y), \
                        ^~~~~~~~~~
./include/linux/kernel.h:877:19: note: in expansion of macro ‘__careful_cmp’
 #define min(x, y) __careful_cmp(x, y, <)
                   ^~~~~~~~~~~~~
drivers/spi/spi-ti-qspi.c:545:22: note: in expansion of macro ‘min’
    op->data.nbytes = min(op->data.nbytes, max_len);
                      ^~~
Quoted 1 line

Using compilers from Debian stable.

A new v3 release has been submitted, with the warnings fixed with CONFIG_COMPILE_TEST enabled.

Thanks,
Jean