From patchwork Tue Feb 20 11:54:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128877 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4553633ljc; Tue, 20 Feb 2018 03:58:27 -0800 (PST) X-Google-Smtp-Source: AH8x227zg7zq79+lGiiJRn9B4YZuc0c+8bswWG0YUQsCa3dcpBLCHsxus+N7BlFN5KtJta6BHIL9 X-Received: by 10.98.202.23 with SMTP id n23mr5901832pfg.52.1519127907701; Tue, 20 Feb 2018 03:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519127907; cv=none; d=google.com; s=arc-20160816; b=l+xD4xMibVthfF30IYUMr3AzTWIjVxFJVy6EwIKug4YvtQtTvt3MWUqi0pf6DhzoyR QtE0FprXh3rkO6tKFF3aY0Xe2rwRV0KPB/yM0AApxDyNaVbPbh+G/26Dw2CU0qaTAKpx VPi1qsULMBEKacVpBVd7DCJl9YFz+Iu89vLzzCHxJL4XXGXDy2aC7ex0RJoItCotAdV0 EWZQx2aB0lgIJ8wqVcj9o1gGOvppyVp5m70h/sfCBojJQRmNMnHPw24L/AME3kRJZqZ+ UqTD2RdRGFgsmxe7Wt94ocVNsZ/3IRgJfXynBcBxMWdQnQKGRFTuwamv6whYUSKFWTAl tadA== 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=bDJS72b2GdfqrDhVpqZEctYOxr5ZlWwzAm1XQx8YQv4=; b=08rNlfda2dDblSN+m36zLyoincqtkXbK6Ei2bXH9CGPB+aCjc383XkKREwcGyHpkEX IGpNQWVHWjkH/BsIk2DIdeaBV08OEbgTwEnfW3gQfLwpT/uupT9qDt0WBcAdaXXrgb4u FZGUDsFza1mRSWXgAfhJNGU4ZOHTh0JiUMVUgJ6Ev/rpjfW3ssgqaS3sJlvTDc8LOvZV FPgDkdrZWyxBUB+RZZTpUiD9PKn4RX2S99HU97sWY8YocAMFd7QAcsrwkfXIl2XbdS7I AUpxMSE7xsrGuPflulo91qEPu82IJQrHAp1BeHxmSo0Ioq1J1akQz9CeKnxTu8Bx4gfK JrbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 h132si2645311pfe.12.2018.02.20.03.58.27; Tue, 20 Feb 2018 03:58:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751446AbeBTL60 (ORCPT + 10 others); Tue, 20 Feb 2018 06:58:26 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:45911 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751474AbeBTL6Y (ORCPT ); Tue, 20 Feb 2018 06:58:24 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0M25gB-1eVKWc3kbr-00u1xm; Tue, 20 Feb 2018 12:58:14 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Arnd Bergmann , Finn Thain , Michael Schmitz , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [4.4-stable 08/22] ncr5380: shut up gcc indentation warning Date: Tue, 20 Feb 2018 12:54:55 +0100 Message-Id: <20180220115527.1806578-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180220115527.1806578-1-arnd@arndb.de> References: <20180220115527.1806578-1-arnd@arndb.de> X-Provags-ID: V03:K0:RUU1clkYfgsUVnw1Lk3LddoZBmZfF0wyYU3cxDFccCW5k7Z70TV T2YzoVx7MGmX+Dlfga6HAoI7oUFKznNfZZtN+qrkLJaS9ty2tlr5LFJCJl6wOPx9eaO/AIe +5clOYYuzLAVVU24dJU2uVH99ZkVDpxsH73MhnOd2a1HOSHYgbtQByJ2LivRw0pYKyzTII4 r+EaYKKRKpxo4+ON2kWYA== X-UI-Out-Filterresults: notjunk:1; V01:K0:diMIuK4UFDY=:W89rTGggwEetSBNA+xw74n tSQpsokqeK6dX7Ol/fK7oxsR8U7fLg4vBtiNFgcT5u1gzan9k08G60b574kZjOX5HfGB8BxEg LcLsl3jdLYIsOZd5GRJcf/xtcDchYiI6vWQbPfi85GEb8UCvkRxcKhkzDSOcpidKw1pRaItLF dZfTxP5pikAg6P6nxnozcIClZxCnoPkLlPaYtFF0Pn25qkz8AEk0mMk6Cwq8fY0W3OMyA8BY2 RS/0diKg6VYx2xNucrLkuBDHXvaYdTTZWxkWRyv2/DePDbqLmCRSEB9oAfWkku+uy47qzq7xc ca1cUsnP2grgQFCsLoE0DtNWB3xDj+CXdGQKKFNzJe9iOJDrjjOjhgerG9OE+AFsbEH1NzPmi FjyocWu0s9rQEzVAGiByge3S6kZlUbTkOxwXkEiKeIbOXZ58O+KJ7u90V7D95EACgcqCZb1mF sQVrMrQu9v2CMd66ZsyUWwjzWN9gMYu7EVeSbNTs5lVOmZsuHMZstfE1QGiJCjnmuONjE63zD vkXT7M1NjgTOTOXzdh4HIFbGUUH9wcnjEzrJMG4atIte+k7+e+ADshbHx7C4aS7D+hlqCgEJV BB26wmj0JBVV0jiVr88A2uwzYQmcq0FbIB/lSWBOK1LnGU2nE5IcbpOg+KHw1GsyK1PLvBaIV 8dJ5NrwtQRaTTMblUQNViWNengnQLuick1IrWGhekkJEMnPP6ZsEq4aPfVS0i5dEsCevIO+58 crSMzfJZKOGYCxNcmH9YH7QO5pVsDnWWtdbkpg== Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org gcc-6 and higher warn about the way some loops are written in the ncr5380 driver: drivers/scsi/g_NCR5380.c: In function 'generic_NCR5380_pread': drivers/scsi/g_NCR5380.c:541:3: error: this 'while' clause does not guard... [-Werror=misleading-indentation] while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY); ^~~~~ drivers/scsi/g_NCR5380.c:544:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'while' This was addressed in mainline kernels as part of a rework on commit 12150797d064 ("ncr5380: Use runtime register mapping"). We don't want the entire patch backported to stable kernels, but we can backport one hunk to get rid of the warning. Signed-off-by: Arnd Bergmann --- drivers/scsi/g_NCR5380.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index f8d2478b11cc..87e081f8a386 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c @@ -538,7 +538,10 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, printk(KERN_ERR "53C400r: Got 53C80_IRQ start=%d, blocks=%d\n", start, blocks); return -1; } - while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY); + while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY) + { + // FIXME - no timeout + } #ifndef SCSI_G_NCR5380_MEM { From patchwork Tue Feb 20 11:54:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128893 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4560849ljc; Tue, 20 Feb 2018 04:04:48 -0800 (PST) X-Google-Smtp-Source: AH8x225snj8Sv7gnpJttzvwIjbNoNDYMMr6vJ8ZFHbch6azOkvRAqad8Px5sB1mW/8fmOS5/2RpV X-Received: by 2002:a17:902:694c:: with SMTP id k12-v6mr11867427plt.133.1519128288459; Tue, 20 Feb 2018 04:04:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519128288; cv=none; d=google.com; s=arc-20160816; b=kT2PHspN6fGbYNEhJj7/PDDCBfcUvUbrbYcm36CUAWbEFE/crwWbXeSA05AXEMJsin FmmpgUeUi6lQFAIgK2Z3rmLmGiAqhNpKJaeYmu2lTuyfHdQEM5dOcC4rVK7qr/U55pr6 +yLL6/iQxBjwQ/HARZg4EEcBGmKnplXUmoolZdf7w4r0+4m0RU16KfFa/xj1uYsQaiaM QkZ4hhF3gUBbApiZfXJmxQoABECXGRgN6tVsbecRa/SAlgjVqp8b6ElOV+mIwBF2Y27D WmDaUdXX+2wsv/xRwR17rhWcL+RaedNowTy86AHcw9VbjyrCE5ir6XUJFgc+a0Cvsi78 riyQ== 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=xqqLNR0AgpK6YV06ynWMyNUCYsWVSwiyqjZKNq2We4s=; b=Otgau16EKd6Bm3H6EUr+pjiI9U+IRsjjBHAPK2VIqg2zF/qb4qUUNoGXg++RGD9zWR 0NSQFqkrCZomvdAN+Nhc9PP27msdwZLUaFFg6oy4WNC9goWx9z6iLveiXqtroDvutPQt s1ZOweNHOcvTdEKLtSuHJ56kN0G3G0lPOOMA6QLMA11MzBnlbeclv3hOII6Gk/LVyqNO SvnO9m8naI36F4F8abHhSQy/g2HdvOBfNkh9en0P5WV4IhAGVsUNJm5zQzyPgXR8xrlh keL97E4vtB/wTljmqmn55Buh1ujlm65bdOUTqfwsnyfFchquCmE8+wee1jDU26UZBdh5 85iQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 bb5-v6si597675plb.800.2018.02.20.04.04.48; Tue, 20 Feb 2018 04:04:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751661AbeBTMEr (ORCPT + 10 others); Tue, 20 Feb 2018 07:04:47 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:59449 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbeBTL7Q (ORCPT ); Tue, 20 Feb 2018 06:59:16 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0M1XiL-1eUmGq1bwn-00tTjQ; Tue, 20 Feb 2018 12:59:09 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Arnd Bergmann , "David S . Miller" , netdev@vger.kernel.org Subject: [4.4-stable 11/22] netlink: fix nla_put_{u8,u16,u32} for KASAN Date: Tue, 20 Feb 2018 12:54:58 +0100 Message-Id: <20180220115527.1806578-12-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180220115527.1806578-1-arnd@arndb.de> References: <20180220115527.1806578-1-arnd@arndb.de> X-Provags-ID: V03:K0:Xu89oNkFxYuzL4uV1TH0bm+rOk3zezfVpuqv4g4cMWWAarq64Mm GBIe5b+C314ZDF+TqPe/p0gJdoBkB8lG3KfXzBbxflLJ4aSEp0Un3F5Ryauplc77+h7h8ye 8scyqDKItXN9Q3vwwAqENimoYITroWG/zFmaVqjZSEzvJdiLqGf9L3UPpnTAvmkAh8jwo8S 4QsqXFkMrII+2Y95EllHg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/89b7o/dO3E=:8zOLVFsgBm0bYiIKzqxTec tIv+StwB3Wb6bHUEMxMf74V0GtHk6cD/nWet8zRWjZihw0MPUih/yLTdFtBL+ioRTHKEndWEd OShcllop2MUkWLxCLrtQivXTgilGUoAKIlA0I4KTX9q1KxS3m04hluRFkRDeV0LFzlcgXGJUs qL03KyAmB9yhyo34VyBKDuufIqsKud80rl5YSOAZGDRTRUkFvkRalz33uwc5h8D/+uNE7zf2r sv9gAH0TMr0nuB1LypzYTruyOcaUzHi4IJ/ObwtuUdRIPdXcYZQy5tv5bQKNcxcJ6nh3cGFDn m+qvlQvNkbPC9Vqbdu6Gxf44b2ATwaL0eouucnfKEJByhqXCUmleVGwD+XD0RAgtYAefgdzEK e2At4GpdKIjlUdVjP/7ArzRqxei6b45wIoI89SBejiKBSVk/K08ebaCXMSTkTq5fvirLaa6+S lBFaKLOq6fKLbKgIagfll93K+QY7qnFGNkAL9QwIhJoWDtz4s050vw/0F3GuRY+QYOswx4dM4 cZeXEp/WvqtU/mWUki8unTbW4unaqmqkcxgXXuk63p+diO2NXqDtP5DXDQEkHJ/iIJg+kKpUn Nb7/2RPirbIVdARza4HT35AC7VtEBsCTc5e3Qexmjp/hxQR5LvE3ePqNYL2Oogh2ehbxUOTHR HidAQFKYo1aN3CK7fLDpc1GCMly4bWuSejvcATsw/cuvi2botV8vrqrdWixpgzibSzSULEvH3 TDHpxD3wg4Vcyr1zBRYlIRrE56m0mR2gDlcUog== Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org commit b4391db42308c9940944b5d7be5ca4b78fb88dd0 upstream. When CONFIG_KASAN is enabled, the "--param asan-stack=1" causes rather large stack frames in some functions. This goes unnoticed normally because CONFIG_FRAME_WARN is disabled with CONFIG_KASAN by default as of commit 3f181b4d8652 ("lib/Kconfig.debug: disable -Wframe-larger-than warnings with KASAN=y"). The kernelci.org build bot however has the warning enabled and that led me to investigate it a little further, as every build produces these warnings: net/wireless/nl80211.c:4389:1: warning: the frame size of 2240 bytes is larger than 2048 bytes [-Wframe-larger-than=] net/wireless/nl80211.c:1895:1: warning: the frame size of 3776 bytes is larger than 2048 bytes [-Wframe-larger-than=] net/wireless/nl80211.c:1410:1: warning: the frame size of 2208 bytes is larger than 2048 bytes [-Wframe-larger-than=] net/bridge/br_netlink.c:1282:1: warning: the frame size of 2544 bytes is larger than 2048 bytes [-Wframe-larger-than=] Most of this problem is now solved in gcc-8, which can consolidate the stack slots for the inline function arguments. On older compilers we can add a workaround by declaring a local variable in each function to pass the inline function argument. Cc: stable@vger.kernel.org Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller [arnd: rebased to 4.4-stable] Signed-off-by: Arnd Bergmann --- include/net/netlink.h | 73 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 18 deletions(-) -- 2.9.0 diff --git a/include/net/netlink.h b/include/net/netlink.h index 0e3172751755..5ffaea4665f8 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h @@ -745,7 +745,10 @@ static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, */ static inline int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value) { - return nla_put(skb, attrtype, sizeof(u8), &value); + /* temporary variables to work around GCC PR81715 with asan-stack=1 */ + u8 tmp = value; + + return nla_put(skb, attrtype, sizeof(u8), &tmp); } /** @@ -756,7 +759,9 @@ static inline int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value) */ static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value) { - return nla_put(skb, attrtype, sizeof(u16), &value); + u16 tmp = value; + + return nla_put(skb, attrtype, sizeof(u16), &tmp); } /** @@ -767,7 +772,9 @@ static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value) */ static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value) { - return nla_put(skb, attrtype, sizeof(__be16), &value); + __be16 tmp = value; + + return nla_put(skb, attrtype, sizeof(__be16), &tmp); } /** @@ -778,7 +785,9 @@ static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value) */ static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value) { - return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, value); + __be16 tmp = value; + + return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, tmp); } /** @@ -789,7 +798,9 @@ static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value) */ static inline int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value) { - return nla_put(skb, attrtype, sizeof(__le16), &value); + __le16 tmp = value; + + return nla_put(skb, attrtype, sizeof(__le16), &tmp); } /** @@ -800,7 +811,9 @@ static inline int nla_put_le16(struct sk_buff *skb, int attrtype, __le16 value) */ static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value) { - return nla_put(skb, attrtype, sizeof(u32), &value); + u32 tmp = value; + + return nla_put(skb, attrtype, sizeof(u32), &tmp); } /** @@ -811,7 +824,9 @@ static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value) */ static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value) { - return nla_put(skb, attrtype, sizeof(__be32), &value); + __be32 tmp = value; + + return nla_put(skb, attrtype, sizeof(__be32), &tmp); } /** @@ -822,7 +837,9 @@ static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value) */ static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value) { - return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, value); + __be32 tmp = value; + + return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, tmp); } /** @@ -833,7 +850,9 @@ static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value) */ static inline int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value) { - return nla_put(skb, attrtype, sizeof(__le32), &value); + __le32 tmp = value; + + return nla_put(skb, attrtype, sizeof(__le32), &tmp); } /** @@ -844,7 +863,9 @@ static inline int nla_put_le32(struct sk_buff *skb, int attrtype, __le32 value) */ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) { - return nla_put(skb, attrtype, sizeof(u64), &value); + u64 tmp = value; + + return nla_put(skb, attrtype, sizeof(u64), &tmp); } /** @@ -855,7 +876,9 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) */ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value) { - return nla_put(skb, attrtype, sizeof(__be64), &value); + __be64 tmp = value; + + return nla_put(skb, attrtype, sizeof(__be64), &tmp); } /** @@ -866,7 +889,9 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value) */ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value) { - return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value); + __be64 tmp = value; + + return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, tmp); } /** @@ -877,7 +902,9 @@ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value) */ static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value) { - return nla_put(skb, attrtype, sizeof(__le64), &value); + __le64 tmp = value; + + return nla_put(skb, attrtype, sizeof(__le64), &tmp); } /** @@ -888,7 +915,9 @@ static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value) */ static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value) { - return nla_put(skb, attrtype, sizeof(s8), &value); + s8 tmp = value; + + return nla_put(skb, attrtype, sizeof(s8), &tmp); } /** @@ -899,7 +928,9 @@ static inline int nla_put_s8(struct sk_buff *skb, int attrtype, s8 value) */ static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value) { - return nla_put(skb, attrtype, sizeof(s16), &value); + s16 tmp = value; + + return nla_put(skb, attrtype, sizeof(s16), &tmp); } /** @@ -910,7 +941,9 @@ static inline int nla_put_s16(struct sk_buff *skb, int attrtype, s16 value) */ static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value) { - return nla_put(skb, attrtype, sizeof(s32), &value); + s32 tmp = value; + + return nla_put(skb, attrtype, sizeof(s32), &tmp); } /** @@ -921,7 +954,9 @@ static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value) */ static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value) { - return nla_put(skb, attrtype, sizeof(s64), &value); + s64 tmp = value; + + return nla_put(skb, attrtype, sizeof(s64), &tmp); } /** @@ -969,7 +1004,9 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, static inline int nla_put_in_addr(struct sk_buff *skb, int attrtype, __be32 addr) { - return nla_put_be32(skb, attrtype, addr); + __be32 tmp = addr; + + return nla_put_be32(skb, attrtype, tmp); } /** From patchwork Tue Feb 20 11:55:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128891 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4559738ljc; Tue, 20 Feb 2018 04:03:49 -0800 (PST) X-Google-Smtp-Source: AH8x225+BbJPFNB6zdz0GLUiEG0bgPAcA3YANhuRIZD++Ti6ifSHxCk0srnanON+dhSQpG0lE9cc X-Received: by 2002:a17:902:7182:: with SMTP id b2-v6mr17091872pll.331.1519128229119; Tue, 20 Feb 2018 04:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519128229; cv=none; d=google.com; s=arc-20160816; b=hvWdHt5BQuAms8miEHyTfkHTBzSgr91AmEFenWt9CO3j/zmsNBMtlhx4UZfFi3L8DT YP9oD3RfrK4hvYcUqZq+N9FsiyDXl+++qrxUhdx8Yjxle34vnmzLlENYS7p3AOa+kwsa tKw9LSfLZqsIwZzDcQ5p0R/kKV5h2xud22P+zwjCWdQvY9xd3hd8b3wTHEdngo95zhy0 Wbxe56dk5UHZfMmifCK2FOAW29aL1o3NpFh3kCh+FFeEJwx5Mv0qC5g4Tuz6Fn7M8kYU mmXt4uHxOg3TYzm7X/Luxaiso5yvKQ8E/WjpCfxm+7ER8GhQndr7arbrf4BopGLy7Jzd nquw== 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=BSMY3QHYJVeiTCS8YsbcByc2ivKYqApa3wqOoW8mehU=; b=fey9XrMFF0q27e0Qr+GwnTZyt/NuuoDsNoBi7KTZxNKxsFtUj7sEhxr0oKNjWWcq/j mYUYXMT1N6iT3XppsbIELBLdhBAt7dC/SFwp+GKtyzmHqpdmzcJQ9nB/ID2qWxKn2SnV u8XODmLxKq1EKnhfkd0hcOSe2NDTtxjT8iXXndLroLNRPQd2J5580MjVs3gs+MRkQeLp IUZ31kIHe3I4rwq8XZNsq8n8uZZkIwegiaGBf725ftZPJMfR7bKlId0k7407uIUlKj9F YpvH7H73HXh5RPhrGfbIHOFPMaOTtsJbFn6npiCAYZJg4x8/RSpsRrtggaxpIgUBV+G/ NgbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 bi12-v6si4320405plb.682.2018.02.20.04.03.48; Tue, 20 Feb 2018 04:03:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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 stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbeBTMDr (ORCPT + 10 others); Tue, 20 Feb 2018 07:03:47 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:59271 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751549AbeBTL7q (ORCPT ); Tue, 20 Feb 2018 06:59:46 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LzJj7-1ekEkD0Jhx-014XP2; Tue, 20 Feb 2018 12:59:36 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Cc: Greg KH , linux-kernel@vger.kernel.org, Jun Nie , Vinod Koul , Arnd Bergmann , Dan Williams , Shawn Guo , Sasha Levin , dmaengine@vger.kernel.org Subject: [4.4-stable 16/22] dmaengine: zx: fix build warning Date: Tue, 20 Feb 2018 12:55:03 +0100 Message-Id: <20180220115527.1806578-17-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180220115527.1806578-1-arnd@arndb.de> References: <20180220115527.1806578-1-arnd@arndb.de> X-Provags-ID: V03:K0:tc+AkfOPIj+mbEMAmdIVXHozh5l7Chf65N3urJFqVsks5T7RYDh +cED9PmjxbruYoGzjmlEw6dM9fRafibBqI/6zsGpjFmWI/HUeWrA1seiHns2YjHUpIEWTBM dnrKI1MxCUDG1EebyHzKeEGOza58KP5an265IRrI/0TQ4m/8SPZz0FwYZFaVasnHvxEUAQ1 fPisZh1ernhpvFdior7Kg== X-UI-Out-Filterresults: notjunk:1; V01:K0:A27fwyVOJN4=:pGHD7iCr1oftl9xxeLztwu WfCkVPzeRKFZuhidyIDrn0ln3aYZa57G8RlITvXCYbEwk5RH/iu4Xj/fgBk+7lXhLD1XSpZC7 NYCaFmg6pSV0gYM0p8AR9uSdxJqp6lUelhevyl1S0s9AG9w/0x5iS+Q2481LUq68tEQjmA37A MA3BtD2sclVLSTiwD/TVGt1mKnDTIcMFi/FfWgj/PSBDBDQxpdpYuAu5PC1QyuTw2etxWHKxc 5l/lWzvWpW8HEA0Ynuq6xgcpVdDguo9Iwkr+cOM4n/DpuPc36jsKvCd+md+l6TA2J/ug+9uTS 7Dx3GNkwy+qLH8FLyRVt/K/ZWjI1veC8RUSoU4l2ng+f8l+rcTGxMFB2MGuG1bOKUKrcM5Ht0 Ht0b7Gc2tuG2oxJoMNGQzQiZBu42LIBKVTv5YeBc4xt6Be5CPjbct2P0g3oYC7s0ND6hZNn3d YDqAbdSsD6t0+oiiZIJII8jg/inZTe5AFwgIMa6Txxwso6Mddndv3PHXK3PW64UxUuJJWPvWF vvi8KG/NkztRzG8ZgiFOfap9tNp/ssiuyLnifrkJE1Z0MFosRIpyleUFvGCi2TySrekdnWXxx SWaaNPOg0CM1f1YAgl6vvC09fEOTnbaonfKR1w7AoZIpDTsoxqvyAf/2UDAofoM3i6em6+X/p pJh1HwCnXbNuCZpi7g71fVqXBKtMlQ7xSbNx0QgnlmUDXaI8CYIEzrybdFcIiOAv+og6cOZ27 mkMhBWRLov1ucLcKU/g/NbNjpwFv1vjB19DoKA== Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jun Nie commit 067fdeb2f391bfa071f741a2b3eb74b8ff3785cd upstream. Fix build warning that related to PAGE_SIZE. The maximum DMA length has nothing to do with PAGE_SIZE, just use a fix number for the definition. drivers/dma/zx_dma.c: In function 'zx_dma_prep_memcpy': drivers/dma/zx_dma.c:523:8: warning: division by zero [-Wdiv-by-zero] drivers/dma/zx_dma.c: In function 'zx_dma_prep_slave_sg': drivers/dma/zx_dma.c:567:11: warning: division by zero [-Wdiv-by-zero] Signed-off-by: Jun Nie Tested-by: Shawn Guo Signed-off-by: Vinod Koul [arnd: rebased to 4.4-stable] Signed-off-by: Arnd Bergmann --- drivers/dma/zx296702_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/dma/zx296702_dma.c b/drivers/dma/zx296702_dma.c index 6059d81e701a..8e55403847b2 100644 --- a/drivers/dma/zx296702_dma.c +++ b/drivers/dma/zx296702_dma.c @@ -26,7 +26,7 @@ #define DRIVER_NAME "zx-dma" #define DMA_ALIGN 4 -#define DMA_MAX_SIZE (0x10000 - PAGE_SIZE) +#define DMA_MAX_SIZE (0x10000 - 512) #define LLI_BLOCK_SIZE (4 * PAGE_SIZE) #define REG_ZX_SRC_ADDR 0x00