mbox series

[0/1] spi: cadence-quadspi: Fix a compilation warning for 64-bit platform

Message ID 20210112100637.747-1-thunder.leizhen@huawei.com (mailing list archive)
Headers show
Series spi: cadence-quadspi: Fix a compilation warning for 64-bit platform | expand

Message

Zhen Lei Jan. 12, 2021, 10:06 a.m. UTC
This patch is based on the latest linux-next. So the Fixes commit-id
maybe changed when it merged int v5.12-rc1. For details about the problem
analysis, see the patch description. The auxiliary information is listed here.

1) the type of size_t on 32-bit and 64-bit platforms
include/uapi/asm-generic/posix_types.h:
typedef unsigned long   __kernel_ulong_t;

#if __BITS_PER_LONG != 64
typedef unsigned int    __kernel_size_t;
#else
typedef __kernel_ulong_t __kernel_size_t;
#endif

include/linux/types.h:
typedef __kernel_size_t         size_t;

2) The compilation warning information on arm64:
In file included from ./include/linux/kernel.h:14,
                 from ./include/linux/clk.h:13,
                 from drivers/spi/spi-cadence-quadspi.c:9:
drivers/spi/spi-cadence-quadspi.c: In function ‘cqspi_direct_read_execute’:
./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
   18 |  (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
      |                            ^~
./include/linux/minmax.h:32:4: note: in expansion of macro ‘__typecheck’
   32 |   (__typecheck(x, y) && __no_side_effects(x, y))
      |    ^~~~~~~~~~~
./include/linux/minmax.h:42:24: note: in expansion of macro ‘__safe_cmp’
   42 |  __builtin_choose_expr(__safe_cmp(x, y), \
      |                        ^~~~~~~~~~
./include/linux/minmax.h:58:19: note: in expansion of macro ‘__careful_cmp’
   58 | #define max(x, y) __careful_cmp(x, y, >)
      |                   ^~~~~~~~~~~~~
drivers/spi/spi-cadence-quadspi.c:1153:24: note: in expansion of macro ‘max’
 1153 |       msecs_to_jiffies(max(len, 500U)))) {
      |                        ^~~


Zhen Lei (1):
  spi: cadence-quadspi: Fix a compilation warning for 64-bit platform

 drivers/spi/spi-cadence-quadspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Jan. 12, 2021, 12:47 p.m. UTC | #1
On Tue, Jan 12, 2021 at 06:06:36PM +0800, Zhen Lei wrote:
> This patch is based on the latest linux-next. So the Fixes commit-id
> maybe changed when it merged int v5.12-rc1. For details about the problem
> analysis, see the patch description. The auxiliary information is listed here.

Please don't send cover letters for single patches, if there is anything
that needs saying put it in the changelog of the patch or after the ---
if it's administrative stuff.  This reduces mail volume and ensures that 
any important information is recorded in the changelog rather than being
lost.