linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] spi: cadence-quadspi: Fix a compilation warning for 64-bit platform
@ 2021-01-12 10:06 Zhen Lei
  2021-01-12 10:06 ` [PATCH 1/1] " Zhen Lei
  2021-01-12 12:47 ` [PATCH 0/1] " Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Zhen Lei @ 2021-01-12 10:06 UTC (permalink / raw)
  To: Mark Brown, linux-spi, linux-kernel; +Cc: Zhen Lei, Yanteng Si, Pratyush Yadav

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 1870 bytes --]

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(-)

-- 
1.8.3



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-12 12:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 10:06 [PATCH 0/1] spi: cadence-quadspi: Fix a compilation warning for 64-bit platform Zhen Lei
2021-01-12 10:06 ` [PATCH 1/1] " Zhen Lei
2021-01-12 10:16   ` Pratyush Yadav
2021-01-12 11:23     ` Leizhen (ThunderTown)
2021-01-12 12:47 ` [PATCH 0/1] " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).