linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhen Lei <thunder.leizhen@huawei.com>
To: Mark Brown <broonie@kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>,
	Yanteng Si <siyanteng@loongson.cn>,
	Pratyush Yadav <p.yadav@ti.com>
Subject: [PATCH 0/1] spi: cadence-quadspi: Fix a compilation warning for 64-bit platform
Date: Tue, 12 Jan 2021 18:06:36 +0800	[thread overview]
Message-ID: <20210112100637.747-1-thunder.leizhen@huawei.com> (raw)

[-- 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



             reply	other threads:[~2021-01-12 10:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 10:06 Zhen Lei [this message]
2021-01-12 10:06 ` [PATCH 1/1] spi: cadence-quadspi: Fix a compilation warning for 64-bit platform 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210112100637.747-1-thunder.leizhen@huawei.com \
    --to=thunder.leizhen@huawei.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=p.yadav@ti.com \
    --cc=siyanteng@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).