From patchwork Mon Jul 9 15:57:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 141462 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2830244ljj; Mon, 9 Jul 2018 08:59:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc1kSltIcYZQ28m4jR8v4oZ3jYDVtw6qoTxByz4tMPz/FJMMlfav7poKscUiKHrSWcY0Wwt X-Received: by 2002:a17:902:8b8c:: with SMTP id ay12-v6mr21078404plb.74.1531151985517; Mon, 09 Jul 2018 08:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531151985; cv=none; d=google.com; s=arc-20160816; b=mUDR8MWwgqQysWnSrZYLmcH/mxUQr6b6OQAWTmkrRBU52pcMwqyZB7LZG3z0upKwIE 0YV0sT53T4xS9lHCIAqgJ9u7U0VmCDTrtCsGFCtROYXjJkFSI6XHdZVjAJwzZEwICj57 +K7VvvVHMn98HIMXbSSq7BPerur7GiT4Gt+S2f54tCtjFkVTD1NV+InLPeL+oyN0VEMP f6ZY1lG7rgW+mUIlyTEtYNZo15n4lPOsC6OoSXtnMb3i1MTepqeDvs8pbS4pFKdTDbiA bDviBEn9ulgcaPSaaSSTeVwXMyjnaTIHZquVUmBeIgLch9jqRdz2GbDgajFolrJhFkcJ hpGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Pni9DQs90C3b3QCbn/c0xnGH2HfshfCvbxOvEn4yACI=; b=i+pTpljurT3tOPXi/HKTw5ZheezMW1JtkVEwg2pWvbscbKCXAHzyAqdwXLI3pZIkVj N4vIjEiMjFYpDSEqbn/qUGmpROBrDsVEZo+QVKqCvBxS2P3L6mWWm6MJlaIY3lmZzkZO uxLltw5Q3bTL6LEH4DV16BLUZXif3LOvg6pctNZUVKKG4DDdqyJlLBIA4xlWGsqLAz5N GhnTvPYi+ZWkWdBWuUrg7tnuizMKuPZulttaEQe+17IPKfgiIUSco0uKiW5NxTlYAF+C 2RCHiGW04v9cuNnC6d6Giq0ZjV1Ck+UTr467VrX4M+I9YxHTKqv8tgQ7yRgSjeCF33/N rQVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x62-v6si16638260pfd.124.2018.07.09.08.59.45; Mon, 09 Jul 2018 08:59:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934083AbeGIP7n (ORCPT + 29 others); Mon, 9 Jul 2018 11:59:43 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:42377 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933565AbeGIP7k (ORCPT ); Mon, 9 Jul 2018 11:59:40 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0MFKbs-1fqu1w2NG8-00EMEx; Mon, 09 Jul 2018 17:58:20 +0200 From: Arnd Bergmann To: Boris Brezillon Cc: Arnd Bergmann , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Maxime Ripard , Chen-Yu Tsai , Masahiro Yamada , Vladimir Zapolskiy , H Hartley Sweeten , "Bryan O'Donoghue" , Philipp Zabel , 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 Message-Id: <20180709155730.2422841-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180709155730.2422841-1-arnd@arndb.de> References: <20180709155730.2422841-1-arnd@arndb.de> X-Provags-ID: V03:K1:rs37fhogpXsDddcc/Tg/tg9RyRGZES2mpCS2k8fM/bageXDxj0G Uvplqtd0sa94pn4FviKHPFaKDCplZ8MGTjZdvi0I5ZvbZ1kruA299+TzpLQUTycdWKCBQ0x YmGgJhg6fq071b4+gp32U+1sfQw3DXWQ1ly2+4WYMvgK3kvicleQ0ANI9iCGQDlKBTisw3h TmIR5xdtwbnbFkFJJZ46A== X-UI-Out-Filterresults: notjunk:1; V01:K0:j+AbLGmx0kQ=:Gz4zVvVpyB1kYk+nRQlNCB clCz+JHxRzHCtuFEwEoROzXKQ3GMC9e6WYVmg40CqBuTnPV0ogLlCghP4ZxBO0MXv4QiFfzPH 2UwPrKGLzDLewq6QlDQ9fPNfI+CvHivZ99OzYIoTQ2IH+xw31DV/UcS4BDy0aUqNxNPo/+rfa cTBOAymHEW5YzfTujnFlKTjULkIzv1vSCxTZw3RTgqE6vCtTec5av+zW9R4OPeXQ1kmvnPjoz 6khRakSrMmxAqWvyoKZbcTY4rvm+wbBvDhTaTUm2D+a1LVT6EyuVk5drRAyFc1mcCnQh4ZtWj 8cfFAei+KiJxMNibi1nHdooF5McC284JEejNJXAS+S5HF1un6PkdtUwjmhhf4NovoT03xXwGJ WAnAEVuk2EH9lqQCUwlraJqQ3CVrx4P06JG8Ca/YAwV7d98YSOKAx/n9BHcmus8tFnTk2h5YT yAT6c8DWprWrEAemKGUxs05owlJlDUItciTpXsdbvffXxzegdSL2GtEylcpABMR78IpGE/Op5 bqGnaRiN3WV2RNYEhN8xGVTONsq/6Fd9rnBs0YS9HxuSSdOlWDmnF8u5mw7V2IuN8W1pIvtX3 hIX1r6sCbhZcMoAzvszLTTNlV4dyDpFoDDWWE63bFLb5QT745I7B0Y6Cs1IFvt2dllajRJnVn wfpkuY48s9Lh3rK9iipgpOAoaxcb2xBi/2nKYdj2em2pFiylVX9YEkvxZHLxosWnYx+A= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/mtd/nand/raw/sunxi_nand.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 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)