mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Vladimir Zapolskiy <vz@mleia.com>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	"Bryan O'Donoghue" <pure.logic@nexus-software.ie>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-mtd@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] mtd: sunxi_nand: fix build warning
Date: Mon,  9 Jul 2018 17:57:04 +0200	[thread overview]
Message-ID: <20180709155730.2422841-3-arnd@arndb.de> (raw)
In-Reply-To: <20180709155730.2422841-1-arnd@arndb.de>

build-testing this driver on x86 shows a new warning:

Fixes: b3d926a3d6e0 ("mtd: rawnand: sunxi: Allow selection of this driver when COMPILE_TEST=y")
drivers/mtd/nand/raw/sunxi_nand.c: In function 'sunxi_nfc_hw_ecc_read_chunks_dma':
drivers/mtd/nand/raw/sunxi_nand.c:130:22: error: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744071631273984' to '2216689664' [-Werror=overflow]
 #define NFC_PAGE_OP  (2 << 30)
drivers/mtd/nand/raw/sunxi_nand.c:1040:9: note: in expansion of macro 'NFC_PAGE_OP'
  writel(NFC_PAGE_OP | NFC_DATA_SWAP_METHOD | NFC_DATA_TRANS,
         ^~~~~~~~~~~
drivers/mtd/nand/raw/sunxi_nand.c: In function 'sunxi_nfc_hw_ecc_write_page_dma':
drivers/mtd/nand/raw/sunxi_nand.c:130:22: error: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744071632322560' to '2217738240' [-Werror=overflow]
 #define NFC_PAGE_OP  (2 << 30)
drivers/mtd/nand/raw/sunxi_nand.c:1406:9: note: in expansion of macro 'NFC_PAGE_OP'
  writel(NFC_PAGE_OP | NFC_DATA_SWAP_METHOD |

This is easy to avoid by ensuring that the constants are 'unsigned'.

Fixes: b3d926a3d6e0 ("mtd: rawnand: sunxi: Allow selection of this driver when COMPILE_TEST=y")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mtd/nand/raw/sunxi_nand.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index d831a141a196..fa5c48502fa8 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -125,9 +125,9 @@
 #define NFC_SEND_CMD3		BIT(28)
 #define NFC_SEND_CMD4		BIT(29)
 #define NFC_CMD_TYPE_MSK	GENMASK(31, 30)
-#define NFC_NORMAL_OP		(0 << 30)
-#define NFC_ECC_OP		(1 << 30)
-#define NFC_PAGE_OP		(2 << 30)
+#define NFC_NORMAL_OP		(0u << 30)
+#define NFC_ECC_OP		(1u << 30)
+#define NFC_PAGE_OP		(2u << 30)
 
 /* define bit use in NFC_RCMD_SET */
 #define NFC_READ_CMD_MSK	GENMASK(7, 0)
-- 
2.9.0


  parent reply	other threads:[~2018-07-09 15:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 15:57 [PATCH 1/3] mtd: rawnand: davinci: fix build testing on 64-bit Arnd Bergmann
2018-07-09 15:57 ` [PATCH 2/3] mtd: atmel nand: fix build warning " Arnd Bergmann
2018-07-13  9:56   ` Tudor Ambarus
2018-07-13 10:16     ` Arnd Bergmann
2018-07-17 21:05       ` Miquel Raynal
2018-07-17 21:08         ` Boris Brezillon
2018-07-18  6:56           ` Miquel Raynal
2018-07-09 15:57 ` Arnd Bergmann [this message]
2018-07-09 16:12 ` [PATCH 1/3] mtd: rawnand: davinci: fix build testing " Boris Brezillon

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=20180709155730.2422841-3-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.zabel@pengutronix.de \
    --cc=pure.logic@nexus-software.ie \
    --cc=richard@nod.at \
    --cc=vz@mleia.com \
    --cc=wens@csie.org \
    --cc=yamada.masahiro@socionext.com \
    /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

all inboxes | Powered by JetHome®