From patchwork Thu May 4 20:51:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98569 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806343qgd; Thu, 4 May 2017 13:52:21 -0700 (PDT) X-Received: by 10.84.218.14 with SMTP id q14mr58755458pli.80.1493931141566; Thu, 04 May 2017 13:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1493931141; cv=none; d=google.com; s=arc-20160816; b=NELk67ND6BaXnDm97QDhI4a8rBzZAflidDtL9ESGE6lQ/00zMrvaGoVjIgy3aLhlDL OG0I2Zkl/JQzokEb+keOUF5eQSiRE8EIs4yu9W5xjQklz2Yz/xettCBtTa0fakHn7HnF wcp/pEi4N2u+EcJCvNSw5SmdoiL3PIxDOCcwfDK+ZpizSp72U2svnqJnEwYoJutfFcTN 5h+0wxryG5xo3bc/Qqj/8D3Fbp+3YEl6wjHnhdGkw3vFvHEiSHMHnjUX7MEr3ReboDX7 Jx682tUK5HZAF1X7r8Xx4SvA2lnjUfKCQF74XJX1fEhTmL4mg0xjxKeE28PLUuudgIsR nNYQ== 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=JYCWZysKxGhvVGHv39m+ULOw/R/ym7A/BcoBLM428oc=; b=HSupA2yq60U3d/fRoN0LMCVtRNIC7P7Zkhc3RXeFvM3muFyjFYZPDUW7gXebuYqwIf YF7okW3ydauJT1PWpk9pk9lrzHomfLADVbWgFPeKDPyJiZ1c2OcQqwsWYZ/1ierTHPeW 3KbsJ6CSXysRsLgc/noiDJy9BEVv0b2Yd0jinkVW8WV+jIUN95Q8nzdRM8nOSHS7U2Gu ZKytl7qw7ZeiVrWMPXiPGBdvfZiP8RYKMeGQYv837qOLjjCVp8uZa1MBphuzUHvgYFeh gF29n4s96aZ9RLKlpgLcauQJOZCRQl1xh+8fJSDDcZatVmLlzQfeudnFL90YhxKqo2ju oO4g== 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 x7si3136031pls.89.2017.05.04.13.52.21; Thu, 04 May 2017 13:52:21 -0700 (PDT) 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 S1751249AbdEDUwU (ORCPT + 6 others); Thu, 4 May 2017 16:52:20 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:57740 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbdEDUwU (ORCPT ); Thu, 4 May 2017 16:52:20 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0MA0VM-1dD1a41wU4-00B27d; Thu, 04 May 2017 22:52:16 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 01/13] [3.18-stable] ARM: cns3xxx: shut up frame size warning Date: Thu, 4 May 2017 22:51:57 +0200 Message-Id: <20170504205209.498721-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:CABgUcPqvDGK336RTiMNC1wzIO6ReYvYKV+fGyhsqBXB7whY+ok LgX6DLSCotYTDG5b4l93TD/vgQJu8zkxv1+fGMht2U91ujYPxftsIYfGXxFdAlEA387F5yh 1cBDpX8+7obkMLMzhRTsWxbRA+pn9+DihcN4R1LPR/NLBRZ+tGGaYbDId3Nd1kXawerOuU5 JxIluF31qP1at0mNLGZJQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:MADKrGKNzOM=:QMW+th3TPjUZOKzGFtyM8z NMjaC5FbaXAamXuUBIFeOTVAJnhqHKHEyA7jlTLcWVMYxXBq68aLJttWYMzrvpjvaUeLJNoTR ZjlKk0fmGGlzliYYd3+xBBtapv5ohE4vt+7C1+b8nY5XGLPzbBfNsh/DBIPnAD7PN1rlC42kt dRkxfqTtM9INQ2sg6BGZVkxxRB4XKlxp6Do9qbQFvbc/uEupphSK4RDLDMuSBHPX6M32ulQET k4EzvyT312y5J+gGHOlMMDm3CmgtC5EyNLu2J+xaMRbFToR5jSRkh9Thjj7NYYAemTfhEAPze /Povu0Zx2S0QKP3oE4OGwmfmyBQi+EX8+Iy8iy33xlnQFcLAEZA8EEcCmOcazXAFTyhfrOpN5 hkQA5uu97KcbAP30dTSABMhMEGCvFFBO6MQEYZ2NjEM8milCAnpK8uZuEOzPecdy2d95wGD3d E3bVW/S1vWOstROn7ZpOQOdjJ1EEq1uxHtVAkuh4W5LRk3IC1JP3UkjAM7v0/lrwDqjIf4jwi 5T+9vzVl0Zs/IECDmvO0Mg2OGBUYslG9o4ylL+MqXS+z2E2xjgj2Vzswfm+yTd3sA1jZm/StG OlNeanZyEQ54NICSpIsrV5nSbrmiMSTMxNexOgiW4yulZ3KsIEQhQ80QmFg91UqFEQTmbAvdt yxYhdtzAiyyxYFrai+ynirYI7QCvUbHYZIkhSdKEXk1/Vv6RTqds/3BiVH7vlm/ZYT3c= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This shuts up a warning in the 3.18-stable series that has been fixed in newer kernels with commit 498a92d42596 ("ARM: cns3xxx: pci: avoid potential stack overflow"): arch/arm/mach-cns3xxx/pcie.c: In function 'cns3xxx_pcie_hw_init': arch/arm/mach-cns3xxx/pcie.c:313:1: error: the frame size of 1080 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] The fix that went into v4.4 is known to be buggy and was later fixed again with commit 88e9da9a2a70 ("CNS3xxx: Fix PCI cns3xxx_write_config()"). While we could backport both to 3.18, they are fairly invasive and the warning is definitely harmless here as the call chain is known to not overflow the stack of the init task. This simply adds a Makefile flag to extend the limit for this one file. Signed-off-by: Arnd Bergmann --- We do want 88e9da9a2a70 ("CNS3xxx: Fix PCI cns3xxx_write_config()") backported into v4.4 though. --- arch/arm/mach-cns3xxx/Makefile | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/arch/arm/mach-cns3xxx/Makefile b/arch/arm/mach-cns3xxx/Makefile index a1ff10848698..fd610561616e 100644 --- a/arch/arm/mach-cns3xxx/Makefile +++ b/arch/arm/mach-cns3xxx/Makefile @@ -2,4 +2,5 @@ obj-$(CONFIG_ARCH_CNS3XXX) += cns3xxx.o cns3xxx-y += core.o pm.o cns3xxx-$(CONFIG_ATAGS) += devices.o cns3xxx-$(CONFIG_PCI) += pcie.o +CFLAGS_pcie.o += -Wframe-larger-than=1536 # override default 1024, this is safe here cns3xxx-$(CONFIG_MACH_CNS3420VB) += cns3420vb.o From patchwork Thu May 4 20:51:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98577 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806379qgd; Thu, 4 May 2017 13:52:28 -0700 (PDT) X-Received: by 10.84.224.66 with SMTP id a2mr24247827plt.191.1493931147958; Thu, 04 May 2017 13:52:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.27; Thu, 04 May 2017 13:52:27 -0700 (PDT) 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 S1751353AbdEDUw1 (ORCPT + 6 others); Thu, 4 May 2017 16:52:27 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:52704 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbdEDUwZ (ORCPT ); Thu, 4 May 2017 16:52:25 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0M8u2m-1dE7Vl3Sea-00C8aL; Thu, 04 May 2017 22:52:17 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Fabio Estevam , Will Deacon , Arnd Bergmann Subject: [PATCH 02/13] [3.18-stable] arm64: Provide a namespace to NCAPS Date: Thu, 4 May 2017 22:51:58 +0200 Message-Id: <20170504205209.498721-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:/rrOTj/TEtxiLXolz36/DhNLJtJSPTob3hzB2QpeRg7ld8blkza fyG81Qn4noHCTjx3BwC+3BvLX9uTAScMnsvBb+fl/J8T5c+75FCf0U6dT2IpMCoG8AWUM92 tS+e+FxIDjzi9ri7T+Lp8vKcjC2ax/5sgNL/PT/7aPZcHVhiUIfDedzBIGMxFiADLQZ2SDu fEkK5pkpCZUAcKW+z8Gog== X-UI-Out-Filterresults: notjunk:1; V01:K0:iMU9TI2IQd4=:GlvD2K1J6dzyEedq2UO6P/ MHcrjIA9JsmeiR7KonoM4SP0+3fgx3e59YRYfHa6kNJ/1P374rS038tBlCYBpCuXrL7wR9QWh oH7sHgSg2GxKLNjjo5UB/Gw1Y97/p5D6SW/eL+i6IzFesgpQi8dUSbUfeDuu9n2y9SRLRo7HO Li2SPBrhs6dUpbOJFFX1FeAhASBgPzVYaSSWOcZh4kSSrpSQDzJt2mI/KEX8znxSULffi9pso r3BIDwk12c+JO4T8ZLTNd9LLODvDLjKWuKAgX+xW/xKwFcrteUJGuBpRcw3s2Nm/Gi96OxqwB Xb2E6RGvcbpPLlu8dzxhHfb0ogaB4FPGPqW4t7OLVK6kUMMjHMC5/RdeijIBn5udYlwXezqUo eQRcWgsAiN8BBHaHpVKvXiHxvpL+zmk12yC29J4gSfqBJOPN5katL6xoV3aurcibMz6IwC41z P8oD+jisXD5vS0dFy5zcUbuzEBftRheRa+bOE7If4U2PHbbOBbd5WFFsbIk0hqbEQoCntdIu4 22BumOBBsc+Q+KdJ/jhmxbvtS8MXUNO1kbDFzSF+04rIdkAmUi2xJomaOMO4YgXqIFlu2K1GR IUK8dVR66HgNOuKheSSK3h9mjY3d4Ma9/wGdDO1W1yTGIkSXmpiMhOtCIYpiaQKFKjQsE5HFI DNvfdMRE4wCu+W6naG8yrtYoxJu/IQJng1BwV2iItL3vZ5dwR4r5SU+eD4WxyB33gAOQ= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Fabio Estevam Commit 06f9eb884be81431d54d7d37390043e3b5b7f14a upstream. Building arm64.allmodconfig leads to the following warning: usb/gadget/function/f_ncm.c:203:0: warning: "NCAPS" redefined #define NCAPS (USB_CDC_NCM_NCAP_ETH_FILTER | USB_CDC_NCM_NCAP_CRC_MODE) ^ In file included from /home/build/work/batch/arch/arm64/include/asm/io.h:32:0, from /home/build/work/batch/include/linux/clocksource.h:19, from /home/build/work/batch/include/clocksource/arm_arch_timer.h:19, from /home/build/work/batch/arch/arm64/include/asm/arch_timer.h:27, from /home/build/work/batch/arch/arm64/include/asm/timex.h:19, from /home/build/work/batch/include/linux/timex.h:65, from /home/build/work/batch/include/linux/sched.h:19, from /home/build/work/batch/arch/arm64/include/asm/compat.h:25, from /home/build/work/batch/arch/arm64/include/asm/stat.h:23, from /home/build/work/batch/include/linux/stat.h:5, from /home/build/work/batch/include/linux/module.h:10, from /home/build/work/batch/drivers/usb/gadget/function/f_ncm.c:19: arch/arm64/include/asm/cpufeature.h:27:0: note: this is the location of the previous definition #define NCAPS 2 So add a ARM64 prefix to avoid such problem. Reported-by: Olof's autobuilder Signed-off-by: Fabio Estevam Signed-off-by: Will Deacon Signed-off-by: Arnd Bergmann --- Slightly adapted for context changes --- arch/arm64/include/asm/cpufeature.h | 10 +++++----- arch/arm64/kernel/setup.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index c008bae718eb..5fe4befda1a5 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -25,11 +25,11 @@ #define ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE 1 #define ARM64_WORKAROUND_845719 2 -#define NCAPS 3 +#define ARM64_NCAPS 3 #ifndef __ASSEMBLY__ -extern DECLARE_BITMAP(cpu_hwcaps, NCAPS); +extern DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS); static inline bool cpu_have_feature(unsigned int num) { @@ -38,16 +38,16 @@ static inline bool cpu_have_feature(unsigned int num) static inline bool cpus_have_cap(unsigned int num) { - if (num >= NCAPS) + if (num >= ARM64_NCAPS) return false; return test_bit(num, cpu_hwcaps); } static inline void cpus_set_cap(unsigned int num) { - if (num >= NCAPS) + if (num >= ARM64_NCAPS) pr_warn("Attempt to set an illegal CPU capability (%d >= %d)\n", - num, NCAPS); + num, ARM64_NCAPS); else __set_bit(num, cpu_hwcaps); } diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index b5853eec2a2d..54e3dd225b44 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -80,7 +80,7 @@ unsigned int compat_elf_hwcap __read_mostly = COMPAT_ELF_HWCAP_DEFAULT; unsigned int compat_elf_hwcap2 __read_mostly; #endif -DECLARE_BITMAP(cpu_hwcaps, NCAPS); +DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS); static const char *cpu_name; phys_addr_t __fdt_pointer __initdata; From patchwork Thu May 4 20:51:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98570 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806349qgd; Thu, 4 May 2017 13:52:22 -0700 (PDT) X-Received: by 10.84.128.47 with SMTP id 44mr59345802pla.35.1493931142743; Thu, 04 May 2017 13:52:22 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.22; Thu, 04 May 2017 13:52:22 -0700 (PDT) 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 S1751330AbdEDUwV (ORCPT + 6 others); Thu, 4 May 2017 16:52:21 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:50537 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbdEDUwU (ORCPT ); Thu, 4 May 2017 16:52:20 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0LrEdQ-1e4qcg08eS-0138kH; Thu, 04 May 2017 22:52:18 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 03/13] [3.18-stable] staging: vt6655: fix overly large stack usage Date: Thu, 4 May 2017 22:51:59 +0200 Message-Id: <20170504205209.498721-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:qllNs/pvr0veb9W/S9PwvDHdWuPPQqtztWkl7NKYtDxJ9PSRRpu fuqNlHEUO+bV7dQ/gyNDffGfUCVlRH5Re7SX165a089G795cxBU6o4LZe2Pu96JDm0O7+LJ klqvUr8ZC3gN0x4eaEPdPEPrkcB/Kvz9Ai3MySfkYTshTm7yH5qxZexCiaHPeShDZqaKP9p caguysF36WvXfB4zLFq/g== X-UI-Out-Filterresults: notjunk:1; V01:K0:JBg/uK7cO1o=:lFJvQG3ZmxPEfUJ/hGUwaK Jj97NEiix7SGjUcbQrL0AWKMfBwK/dGgjyILn3NmDF8zBdKta51s1keZOm8RQbAuhc8c4fyzO Z3ENkwcpqrcHBMQh9EfE/jRgE2GlFH92VqqBwcwgEbsEu53xLNFDc9L0sU28Xkz+snzkMPuz5 zhMjNjRGDyqors0uIBhnb1osd1AxcPDK3EyFzA+RKLFaHoSRqvJ0nc41UPz9VcTVo2OrK1Kpd ww9UFTZz8DB5wW1s9iKbi3jPHrf+rYyIylqLffBcwTA9ZnB8WCAf1FmFP4Sy9nyHrENqzXc2k ahvCkesq8ign+Sn1hOZ9nNOwbxrSrZUmneMaIj6jO6F2DLY5rp/LEm3ix+huSDZAnmvV0uYfj UtlEbNui2cOCEKQJEs84CJOIeQV7m+Wo1VB75Gyg4c8j7s9KHV+Cdtq5u+1y8aWn/f/Lt1yp8 lshIIqWmSqvIJi8TWm9v7c0MXRlGsa9400QBm6c7ELiypLrjpT6RuDlC+BiCEABNu1zKelYZb wshZiTs1mdn6bVdFT6Dz+8BdLNGB+LkiYNy4g2mkWoWZwyLVI6yO8r1Yo2ZJatjPAwqPqv9VH pMoONN+zQtSac6+V721Z5yd9fuhph2afwi6EOwD5isJDjdLnkJVwfXX8c2DdssKK0cwwxhZ4s aylGHi2MsKaNbz/zwdrERAyLhDGvPJ160jeeCfR0M2jGW3vcyD3hWmTNMri7Aqq1EXTU= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org We get a warning for the large stack usage in some configurations: drivers/staging/vt6655/device_main.c: In function 'device_ioctl': drivers/staging/vt6655/device_main.c:2974:1: warning: the frame size of 1304 bytes is larger than 1024 bytes [-Wframe-larger-than=] This is addressed in linux-3.19 with commit 67013f2c0e58 ("staging: vt6655: mac80211 conversion add main mac80211 functions"), which obsoletes the device_ioctl() function, but as that does not apply to stable kernels, this picks an easier way out by using dynamic allocation. The driver was merged in 2.6.31, and the fix applies to all versions before 3.19. Fixes: 5449c685a4b3 ("Staging: Add pristine upstream vt6655 driver sources") Signed-off-by: Arnd Bergmann --- drivers/staging/vt6655/device_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index ea240512cbbb..0670fcb02b4a 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -2818,11 +2818,13 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) pr_debug(" SIOCSIWSENS\n"); rc = -EOPNOTSUPP; break; - case SIOCGIWAPLIST: { - char buffer[IW_MAX_AP * (sizeof(struct sockaddr) + sizeof(struct iw_quality))]; + char *buffer = kzalloc(IW_MAX_AP * (sizeof(struct sockaddr) + + sizeof(struct iw_quality)), GFP_KERNEL); - if (wrq->u.data.pointer) { + if (!buffer) { + rc = -ENOMEM; + } else if (wrq->u.data.pointer) { rc = iwctl_giwaplist(dev, NULL, &(wrq->u.data), buffer); if (rc == 0) { if (copy_to_user(wrq->u.data.pointer, @@ -2832,6 +2834,7 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) rc = -EFAULT; } } + kfree(buffer); } break; @@ -2878,7 +2881,6 @@ static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) pr_debug(" SIOCGIWGENIE\n"); rc = iwctl_giwgenie(dev, NULL, &(wrq->u.data), wrq->u.data.pointer); break; - case SIOCSIWENCODEEXT: { char extra[sizeof(struct iw_encode_ext)+MAX_KEY_LEN+1]; From patchwork Thu May 4 20:52:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98571 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806352qgd; Thu, 4 May 2017 13:52:23 -0700 (PDT) X-Received: by 10.99.160.68 with SMTP id u4mr28930878pgn.39.1493931143439; Thu, 04 May 2017 13:52:23 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.23; Thu, 04 May 2017 13:52:23 -0700 (PDT) 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 S1751023AbdEDUwW (ORCPT + 6 others); Thu, 4 May 2017 16:52:22 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:65042 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751136AbdEDUwV (ORCPT ); Thu, 4 May 2017 16:52:21 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lst3q-1e3CjA0y42-012aVv; Thu, 04 May 2017 22:52:18 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 04/13] [3.18-stable] staging: imx-drm: fix indentation warning Date: Thu, 4 May 2017 22:52:00 +0200 Message-Id: <20170504205209.498721-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:2bAwZe9ga1cTRCykHqvJKfzscH2S2J5EqSBFwgZHGKlgFa7WzA4 BitNyghUxqowWXKuqWnx4w4pYxiVJ+xmnHTVNJfJH7h9BJbHBbPiYxBtTpEbsC/h09rKS84 pOpt58Yg9gkFm4kFOfo2qqnGSNELq1QY7zlh0h568Z5wwwGMLRAfl5jlkUKP75CVU1ZO1hi nEiEYe8KyEGuc7bcce0Lg== X-UI-Out-Filterresults: notjunk:1; V01:K0:gLBdCwRSQ74=:2c8N8yzeDFPm22muFpbUw/ SMT9rko/rHopWis0oR75z4IVhY6SYCjXEbYbO1cG+UG6myX17zDHLzq26onVY1Nc5EmWvG4g/ kFPCWpNeltAEpMrPlamQHhmxRJoKY8xbaTQwOeo4Ix5Z+ejbOcKpt/+434YVhmcL6Sk1aBAl3 izurjqHq0HXLemVx2MU6auyAf+b5s+VNsgm664zjXG42oKTSF6Ye3F/1BmMzcpOa7/WQtsmyH jv4QwlaRxZmD8FxP91VzgtLNkUxF36fYj07/ueKD2urM2Mevvdn8uXBX51wGlNzEcDQbVFAUz ORdSBs623uZ4ytakthCHWCcPXYLo5/yeiE2dICDw/HVG4I1OwZpJBWggWx3IRFzxL4MRUnSRT lSk81aEMXHleGuH11yUA0EmBsgeEGkykl9w5urgp7dMVAYsS0/pKxR9bfwEkbtAeEplfzkzRV upNc8LgtEYWsD5Zix17bB3ehBjAZi8bmGVOQuw04pKmUW7bsKrsyCdzjmSYNdNfv1iQAiM4R8 bM5OzYdTnLufhTMUZfAaJ9FKb5MGytkO5wSOQrNHBGoO/RiPtZdDTGm2EhTy4J2d+6eN9Dltk cH88cYm8PrFlQqhgE8I4YlbI5H7ofh2u1wmYpu5tBfWJ//6nzIrNWGU7y5qxXxRTtE+uyXQAQ 66xZO/WVQNqZOfaFt29zC1Ax1Q+IoR7thsHkIpHxENIvpMiaXVcZwkVSB80aY5XfeRBE= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org gcc-6 produces a harmless warning: drivers/staging/imx-drm/imx-hdmi.c: In function 'hdmi_config_AVI': drivers/staging/imx-drm/imx-hdmi.c:967:2: error: this 'else' clause does not guard... [-Werror=misleading-indentation] Commit d083c312cba2 ("drm: bridge/dw_hdmi: simplify hdmi_config_AVI() a little") in linux-4.3 fixes this with a larger rewrite that is not applicable here. After that rewrite, the variable that gets assigned here no longer exists. The assignment is rather pointless here, as we just set a variable to zero that is later added into another variable using a bitwise or operator, and that has no effect, so I'm just changing the indentation here to shut up the warning. The driver was originally merged in linux-3.13, and the fix applies to all versions between that and 4.2. Fixes: 9aaf880ed4ee ("imx-drm: Add mx6 hdmi transmitter support") Signed-off-by: Arnd Bergmann --- drivers/staging/imx-drm/imx-hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index aaec6b2cdf56..f1475ac718e9 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -967,7 +967,7 @@ static void hdmi_config_AVI(struct imx_hdmi *hdmi) else pix_fmt = HDMI_FC_AVICONF0_PIX_FMT_RGB; - under_scan = HDMI_FC_AVICONF0_SCAN_INFO_NODATA; + under_scan = HDMI_FC_AVICONF0_SCAN_INFO_NODATA; /* * Active format identification data is present in the AVI InfoFrame. From patchwork Thu May 4 20:52:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98572 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806360qgd; Thu, 4 May 2017 13:52:24 -0700 (PDT) X-Received: by 10.84.131.34 with SMTP id 31mr53318059pld.120.1493931144159; Thu, 04 May 2017 13:52:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1493931144; cv=none; d=google.com; s=arc-20160816; b=l74ngCavDGJ2rezmRO8THYUxXPWq9Twmwvik5iQOAKf7A7csnpn5mR5jhrUfH7s14Q HmhhKqP6YRjsrQGvuVeXztN3QcqbZPcHmzfmRaNXwabz8dvMDqawhWABL86tli/Q4m3j HMu3xDlywC5kxj7aUqEtwJRnmatGjGhZJ7bSO3sHIxaocJxV5MTrQCYr7MeEXrtIyH4X JcHbSG35EWwDwn49vK8ngXi8T4i5KujD7BWhGsTMNoD0ui16vWpme8avwh3RbSw/nOoK 1ZdIXL1KO+irSgY29/Wvi0To7ye9RTLjD4l2ctDu291ZJSMiaCM2fx2i46nyQ3/TivAO TG4A== 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=lK6W2N9bQLpq0NXDWClr2ztiJ8zD0qZJqgsdSrjzIpY=; b=kczSxk9fvG0IEm0beWvxB2wb7hocj8xpD2aQ4JXlJHxPCwS+tMAUedhAmTh1IoWQ7P 1cMPlSNsesP7lylei/dpHvIOlD/EMJfxkN2xN3wgCPe/csnHBKiBwqDJFHEvRTneUp/Y 5tVtUWOqFOt6sKmBA0797qFXMO5y/L8LEYfxlHm89OAsIHip1XZAWhsvygpRZnu2mIGT ew6rddCJiSGBvcfGYE+sqR0EPaWSowxPXQ39KJl1U8PPdrEZdTGDgzqdwlu9meJTz3a6 AkWo9DgqMwrk0VkrHMUIeyD1gAF6bINPN6VSxO8eGZHbjUTmVwTYoeuU/xI2ibIER263 HLjA== 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 x7si3136031pls.89.2017.05.04.13.52.23; Thu, 04 May 2017 13:52:24 -0700 (PDT) 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 S1751326AbdEDUwX (ORCPT + 6 others); Thu, 4 May 2017 16:52:23 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:53041 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbdEDUwV (ORCPT ); Thu, 4 May 2017 16:52:21 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lq1ku-1djp9m1maW-00dlB3; Thu, 04 May 2017 22:52:18 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 05/13] [3.18-stable] staging: bcm: add 32-bit host dependency Date: Thu, 4 May 2017 22:52:01 +0200 Message-Id: <20170504205209.498721-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:R2zx4k4rvAa2mnm485RFD58gzmtUFG5eWMyN/Oh6jRNBW+JHpbE 3KoE8WyGm7MYWCRth77ee7sTur4cfWrAz+KMInD56jUFFXwOEeB34uQPIke+R3bBJgEoSEj 86YxO+gJx2V8HWLMC4yRkfBeiQBz6jDkjZ4oO/jnW9CYUSHez/Vg+BjUjgCpsNZeBIevzJ+ EnPY7Dzt8efZeaS1NIASw== X-UI-Out-Filterresults: notjunk:1; V01:K0:fA9Me6Ojg9s=:0rIW09EwFeCYIAZEOFt78z 83HwTuqqlyBTJtfsUtVcRejUG6QTWAbaxD3RkTRzZXuyDYUsDDsZoq0+XWtbA+pgCYWdAZ2Vf mMWK4lYbASBJdndol7jn0g5jpBaU4aYrlUKcbO6syLhYHZ85XqEQuGwBau2BWTLxkv2EzwSjH f80C9cAHP7tvVWVFqgXh4SPVACjHSMlN2RAiK36bWTQiz5veX/oFhRPGu59CjzOwYb1dNW/wj hEhikLhJFItDnBtbeKo69YAIfHMaQdJUrvum5Y6WV7iPbrTwsouobz89Hss+437vxgPf+OmBA 7uCL9CcK2MizjzndiMmjnTZRSJyD5tW73m7q18BYnjlYarEG2VMrr6gFhrYGPnIwFmXzdSLW1 WgePBADRt3wp0X2thBk44yNys1h/CrIAExmWwhh3qEWBMdIP5mwq+biATPOo3R/k2RTeNPK39 YIS0vP22mKSK0pbqS6rdWc6+/aULUY11c5iruw95IuBb+lKL91TQH0+NVvJ3HP9/lAKUcxFxh 82C3q0qgR5QOliIzrKWKY8kar8AQQ97rF8dexPs82SAD8NH28VfNA3FigFHu8V5+0HcyYSpQn UXf0VB2HsBBLb7iLD5XHWfmuN6Z/FSXVvEUiYeVCtlu6HHE4SlucwLo+KXHhPtgaa2tjtME39 ZLn/u+Uzj+NqNbijKYcjLCtlK8rWhbGV2Vrl8CwwEXfncru1q0FCyCH5D75p/KZyKVA8= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The driver uses a 32-bit variable to store a pointer, causing a couple of warnings: ../drivers/staging/bcm/CmHost.c: In function 'StoreCmControlResponseMessage': ../drivers/staging/bcm/CmHost.c:1503:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (struct bcm_connect_mgr_params *) ntohl( ^ ../drivers/staging/bcm/CmHost.c:1546:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (struct bcm_connect_mgr_params *) ntohl( ^ ../drivers/staging/bcm/CmHost.c:1564:3: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (struct bcm_connect_mgr_params *) ntohl( I fixed other warnings in an earlier commit 9f1c75ac2dba ("staging/bcm: fix most build warnings"), but couldn't figure out what was the intended behavior on 64-bit machines here. The driver was removed in linux-3.19, commit d09e9b160fc1 ("staging: bcm: remove driver") which explains that it never worked on 64-bit machines. This adds a Kconfig dependency instead to prevent it from being built in the known broken configuration. This workaround applies to v2.6.37 or higher. Fixes: f8942e07a3db ("staging: Beeceem USB Wimax driver") Signed-off-by: Arnd Bergmann --- drivers/staging/bcm/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/drivers/staging/bcm/Kconfig b/drivers/staging/bcm/Kconfig index 8acf4b24a7c9..94e04701e008 100644 --- a/drivers/staging/bcm/Kconfig +++ b/drivers/staging/bcm/Kconfig @@ -1,6 +1,7 @@ config BCM_WIMAX tristate "Beceem BCS200/BCS220-3 and BCSM250 wimax support" depends on USB && NET + depends on !64BIT help This is an experimental driver for the Beceem WIMAX chipset used by Sprint 4G. From patchwork Thu May 4 20:52:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98573 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806366qgd; Thu, 4 May 2017 13:52:25 -0700 (PDT) X-Received: by 10.98.73.214 with SMTP id r83mr13226248pfi.253.1493931145469; Thu, 04 May 2017 13:52:25 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.25; Thu, 04 May 2017 13:52:25 -0700 (PDT) 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 S1751228AbdEDUwX (ORCPT + 6 others); Thu, 4 May 2017 16:52:23 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:57379 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238AbdEDUwV (ORCPT ); Thu, 4 May 2017 16:52:21 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0LvtTJ-1e8xMV2YdJ-017piG; Thu, 04 May 2017 22:52:18 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 06/13] [3.18-stable] IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE Date: Thu, 4 May 2017 22:52:02 +0200 Message-Id: <20170504205209.498721-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:rj8JzcAwC3/5MosaZ6EsoGcbT4zsn0elK4T9QNOvTZEiGC787t8 2zkGSY3Q47s9MjnDOu8lGWWAXsIoWWnGk/DqWpbv7qxz1lNwIjrsayUigeO++lEPZ13cXTY 5/0NhXpFxlkLGCWzRo5XH6BwciLi8o9i5vSFxEPL4IyJek+SPBeiYqcHpO7xbDa2+8yZcC7 VBTEmG08BMn2CGs0QAHZQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:EZmk1OL+u0Y=:5B3SLEgSBCfcDGGZSoVf9t uK7N6lTmSfNTSX3gfBgpV0SWUgp76zrmfvoxo7Z83sRE2RftTQvjqHUI9jjDKoqXSqeS3SuYO CPw5haUD/OOX7JfYBALTP2yxg5ALbAw/AqVmhgRH0z+dIHozxDOdCLRW11dN/DlOZi1Bk5n5i ZZPGoP16m1e3W+pp0BF2n/zL1l3R8avViPqhX7eW2rZxE9c2vYDedAhTvseoNLelATsQHS7ri JCTo4fer4kaH0IutpO8xKtMPxQsv6sopsqAjjP1iCGDuBoeSq2jz2BDYhnYGkFug21lM+MrXR 7vvxJVy6vLkv9uw5DzZiI3uKuQvDxkjPj8f4a0mHeIQIp5B24xU7I4uRdz6ZCJaIEoPGtQSHR DcheJ6DjgihCCO/rI/6mDD6yhLAlhdSffGzjkuamurE5qt0AwRISIt4l2L3/nhlEb8vNNrrpp iFzk7JVBqgdt+0XUonUdBIhDfpNc4moH6unGM7Jhr4QJOYI28NOZ7qs6AEryCRXgo798OinXC K12J+6P28DC+ZA4nIWRYgq8ZKDrQF7eAiijTLEqbPGZiNhSN4qxOXYmH6vvJQdUF8xRM7kKdj co+sTx1Tspd3A99nEL1mOp4R1JupV8+Lmf9NsXWY1FavK+x9fmxcgTNaBbUlY+l5Tqtc307LK Q/Qtv0G/TcxZbw0urlWgHdukPsaxP0Sk2BvA3KL7KdiFgJ5LxZnLPogrKW9cw9QUZy0A= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org We get this build warning on arm64 drivers/infiniband/hw/qib/qib_qp.c:44:0: error: "BITS_PER_PAGE" redefined [-Werror] #define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) This is fixed upstream in commit 898fa52b4ac3 ("IB/qib: Remove qpn, qp tables and related variables from qib"), which does a lot of other things as well. Instead, I just backport the rename of the local BITS_PER_PAGE definition to RVT_BITS_PER_PAGE. The driver first showed up in linux-2.6.35, and the fixup should still apply to that. The upstream fix went into v4.6, so we could apply this workaround to both 3.18 and 4.4. Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/qib/qib_qp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.9.0 diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c index c5b6e60ccad4..c231313bc3be 100644 --- a/drivers/infiniband/hw/qib/qib_qp.c +++ b/drivers/infiniband/hw/qib/qib_qp.c @@ -41,13 +41,13 @@ #include "qib.h" -#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) -#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) +#define RVT_BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) +#define RVT_BITS_PER_PAGE_MASK (RVT_BITS_PER_PAGE-1) static inline unsigned mk_qpn(struct qib_qpn_table *qpt, struct qpn_map *map, unsigned off) { - return (map - qpt->map) * BITS_PER_PAGE + off; + return (map - qpt->map) * RVT_BITS_PER_PAGE + off; } static inline unsigned find_next_offset(struct qib_qpn_table *qpt, @@ -59,7 +59,7 @@ static inline unsigned find_next_offset(struct qib_qpn_table *qpt, if (((off & qpt->mask) >> 1) >= n) off = (off | qpt->mask) + 2; } else - off = find_next_zero_bit(map->page, BITS_PER_PAGE, off); + off = find_next_zero_bit(map->page, RVT_BITS_PER_PAGE, off); return off; } @@ -147,8 +147,8 @@ static int alloc_qpn(struct qib_devdata *dd, struct qib_qpn_table *qpt, qpn = 2; if (qpt->mask && ((qpn & qpt->mask) >> 1) >= dd->n_krcv_queues) qpn = (qpn | qpt->mask) + 2; - offset = qpn & BITS_PER_PAGE_MASK; - map = &qpt->map[qpn / BITS_PER_PAGE]; + offset = qpn & RVT_BITS_PER_PAGE_MASK; + map = &qpt->map[qpn / RVT_BITS_PER_PAGE]; max_scan = qpt->nmaps - !offset; for (i = 0;;) { if (unlikely(!map->page)) { @@ -173,7 +173,7 @@ static int alloc_qpn(struct qib_devdata *dd, struct qib_qpn_table *qpt, * We just need to be sure we don't loop * forever. */ - } while (offset < BITS_PER_PAGE && qpn < QPN_MAX); + } while (offset < RVT_BITS_PER_PAGE && qpn < QPN_MAX); /* * In order to keep the number of pages allocated to a * minimum, we scan the all existing pages before increasing @@ -204,9 +204,9 @@ static void free_qpn(struct qib_qpn_table *qpt, u32 qpn) { struct qpn_map *map; - map = qpt->map + qpn / BITS_PER_PAGE; + map = qpt->map + qpn / RVT_BITS_PER_PAGE; if (map->page) - clear_bit(qpn & BITS_PER_PAGE_MASK, map->page); + clear_bit(qpn & RVT_BITS_PER_PAGE_MASK, map->page); } static inline unsigned qpn_hash(struct qib_ibdev *dev, u32 qpn) From patchwork Thu May 4 20:52:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98574 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806367qgd; Thu, 4 May 2017 13:52:25 -0700 (PDT) X-Received: by 10.99.161.26 with SMTP id b26mr48589025pgf.115.1493931145795; Thu, 04 May 2017 13:52:25 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.25; Thu, 04 May 2017 13:52:25 -0700 (PDT) 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 S1751238AbdEDUwY (ORCPT + 6 others); Thu, 4 May 2017 16:52:24 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:57280 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbdEDUwV (ORCPT ); Thu, 4 May 2017 16:52:21 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0MUxAq-1daAdq3LLg-00YDqX; Thu, 04 May 2017 22:52:18 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 07/13] [3.18-stable] IB/ehca: fix maybe-uninitialized warnings Date: Thu, 4 May 2017 22:52:03 +0200 Message-Id: <20170504205209.498721-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:0Eqs13dWrJCpuz5M/C3tZe1qmPbOhEnaJhpXURQ5UhikKm5R/Zn CyLhVebzvkSBnOFCu2O7NPugCW2q9YyZ1KRedqKrP3+6CmeKnryOyPDmW7XN30wW3CUIQaw FZYL0DTslabc45DENbk5M4uhsdBveC75My6pWFj9QwN8EgMEYSt0ro6vBNEGmlBihL43KSi SK9nQwOPBfd7Xvpmv6OAA== X-UI-Out-Filterresults: notjunk:1; V01:K0:kAIWXkdLHL4=:908e3YYh9fhSSkGU+BP/bh vyVpOUTb4LCCmkbvyR4ToO0q8c+P9DHUQDS8pqesyU1RSRutgSfv9OgP5o4lvOBgkz1LxEkQw po1HtxXd5z+z7QWMrUPJl/wVGHP9J0aOAoA3dZM2IyDHJTSwCzhMHeq6C+HQKa1nvX8KAoR1X h2k6HiQkt42obgjvEPW7CSkiCrvEY2GU4Jk+fJ5C1+T5u2BO+8AwIyfjL95dmTIU4K1XoLjXS 1gISM1v8oOEHinsp6US4CvXxZHQ4HhwJ4u03WGAOiHbxJDygW31OZV7S/6f0bzEqkRh+8OFYB h0Yu/KG7lrIFFyXEIgBRO5k4bYUQpqS0gC3rqOuKu7CXAFvc7+TA71PqjiyoZB5iRfl5N8Wo3 8tdAkuZdaT96qvgyMxj+1VRdh+q7pnCOq3x1Cvd8fRhKTUtolhY95DhwiTZWFU+u4MURy7pD2 cO6gBLo7Uf1j1k2MY3jF4NPOK3XCMF31E9aShYlPEsPiPBa2iqip4Q4RSfHEOucCNqiBZnoDR 2DzWv/ib6hSMm4GGx8KnSw53mf/W3AspHsfFZW0Qvcc76xbxkQIl4TfF94UOlf08G+Xa5AXkR ILfI/RlC5ops1hG7CF3AFl/ZmfNYrVeOHhSfMXoMHinMZOj3JVk005qd1nM61vmh8s4Ah2kr6 j70ch0lufCTTFAKDFf4GaiPSTwficv3ULb1Pea9p0xlZQDHu04tudSbpzoVWYEr0Uyw8= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The driver causes two warnings about possibly uninitialized variables: drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_set_pagebuf': drivers/infiniband/hw/ehca/ehca_mrmw.c:1908:4: warning: 'prev_pgaddr' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/infiniband/hw/ehca/ehca_mrmw.c:1924:14: note: 'prev_pgaddr' was declared here drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_reg_mr': drivers/infiniband/hw/ehca/ehca_mrmw.c:2430:5: warning: 'hret' may be used uninitialized in this function [-Wmaybe-uninitialized] The first one is definitely a false positive, the second one may or may not be one. In both cases, adding an intialization is the safe and easy workaround. The driver was removed in mainline in commit e581d111dad3 ("staging/rdma: remove deprecated ehca driver"), in linux-4.6. In 4.4, the file is located in drivers/staging/rdma/ehca/ehca_mrmw.c, and the fix still applies. Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/ehca/ehca_mrmw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index 3488e8c9fcb4..62b61e9b60ce 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c @@ -1921,7 +1921,7 @@ static int ehca_set_pagebuf_user2(struct ehca_mr_pginfo *pginfo, u64 *kpage) { int ret = 0; - u64 pgaddr, prev_pgaddr; + u64 pgaddr, prev_pgaddr = 0; u32 j = 0; int kpages_per_hwpage = pginfo->hwpage_size / PAGE_SIZE; int nr_kpages = kpages_per_hwpage; @@ -2417,6 +2417,7 @@ static int ehca_reg_bmap_mr_rpages(struct ehca_shca *shca, ehca_err(&shca->ib_device, "kpage alloc failed"); return -ENOMEM; } + hret = H_SUCCESS; for (top = 0; top < EHCA_MAP_ENTRIES; top++) { if (!ehca_bmap_valid(ehca_bmap->top[top])) continue; From patchwork Thu May 4 20:52:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98575 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806368qgd; Thu, 4 May 2017 13:52:26 -0700 (PDT) X-Received: by 10.99.67.1 with SMTP id q1mr279407pga.156.1493931146071; Thu, 04 May 2017 13:52:26 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.25; Thu, 04 May 2017 13:52:26 -0700 (PDT) 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 S1750832AbdEDUwZ (ORCPT + 6 others); Thu, 4 May 2017 16:52:25 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:62568 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbdEDUwV (ORCPT ); Thu, 4 May 2017 16:52:21 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0M3rPO-1dwYsa47eM-00rYxv; Thu, 04 May 2017 22:52:19 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 08/13] [3.18-stable] tty/isicom: fix big-endian compile warning Date: Thu, 4 May 2017 22:52:04 +0200 Message-Id: <20170504205209.498721-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:tTXATgbHg+LT3pmeUGY29XYz+RmU/R948sZv6EW93dZ2YjoOpjq nga2GQDUchkPPnU6zgmrb2Q/nnDX86qPAgrlWT+SabUhBK3JckhkGBriWxpfDEeXVo3nBcI fRtfbyTeCnkkG1Sg09fLPY1Wyf6gH+pNrt73F1xXnNHkFYLE8MImmrXH95GbgVCOAC+V7Gd 9nXhHodsHwn2H2j6kiYaw== X-UI-Out-Filterresults: notjunk:1; V01:K0:sQL/Wp1+MTg=:7eL6AEZ4CBFL/ZNboM8OG8 EGoerSXT6M+9KV8XpuhzFqNBP+IM32du3BX5q4xoh2NCtZCr7AyOULMQUO0ysau5f/fPSRHOt Z/BaO8gd93mSw+3fMwwExlZVIZgFPJTKAfB9e+fy6Z71JW1b+sW1+OpFtC37IllBII4Vs2ecg mkwKB/96X+1f5GBUPj/SUefORy+Pvz05bCcJyJw76CUmpP9IJ9GvdOHbUHXVMag0s8nhtN2iL KsScq4Tj0Q6YoNweFKzwfx4dQbz9bibu5onLtkqeAywTbS2kHqssOasFw2fvS0BnvXjIYVd4J vpOOawO9eAY1CvZgGO7m6K5CGgu/5CFJJyvdSYM5Nl6dLB/TdMEmLBxOQx8O5Y2EDLpalsffU tXcX/QjPFCP573Wo/CPQ9uXmxyOQVtEJlA3leV/mlrUoFhSBvf+fkF3+K6c7eLkjhJZvYKpS7 DxRLG7FWwgcvJBItBQZDiIHIBsvHlsupfjen32H7rIZBxWVVB8utggxNUXGVrgmEPNX4JdXHc YIUFwdNiK3SDA/X7ZFKQvxtGFUlXjRxghCw1412BySakgyJOJjpSgIvDasAHBNwdLnan28rls muwU9pk4+dDJxul3rWTkwi4i/+Ll97sYHj2mWzLnr38DWWHsQP3ux33aWLCP+T24nTgcK1Rrn hZDjXblJOogL1WwU7fZlh988rgoNV0/erLGr88WpkeikVuMhf1D6OzXvnHygZ6KHxp4w= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit f3e2d56dce47dbd0bb3f69f84741b439542fef37 upstream. Building an arm allmodconfig kernel triggers a lengthy but harmless warning in the isicom driver: drvers/tty/isicom.c: In function 'isicom_send_break': uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow] (((__u16)(x) & (__u16)0x00ffU) << 8) | \ ^ uapi/linux/swab.h:107:2: note: in expansion of macro '___constant_swab16' ___constant_swab16(x) : \ ^ uapi/linux/byteorder/big_endian.h:34:43: note: in expansion of macro '__swab16' #define __cpu_to_le16(x) ((__force __le16)__swab16((x))) ^ linux/byteorder/generic.h:89:21: note: in expansion of macro '__cpu_to_le16' #define cpu_to_le16 __cpu_to_le16 ^ include/asm/io.h:270:6: note: in expansion of macro 'cpu_to_le16' cpu_to_le16(v),__io(p)); }) ^ drivers/tty/isicom.c:1058:2: note: in expansion of macro 'outw' outw((length & 0xff00), base); ^ Apparently, the problem is related to the fact that the value 0xff00, when used as a 16-bit number, is negative and passed into bitwise operands of the generic byte swapping code. Marking the input argument as unsigned in both technically correct and avoids the warning. Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman Signed-off-by: Arnd Bergmann --- drivers/tty/isicom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c index 858291ca889c..c03ecaa0af7f 100644 --- a/drivers/tty/isicom.c +++ b/drivers/tty/isicom.c @@ -1055,7 +1055,7 @@ static int isicom_send_break(struct tty_struct *tty, int length) outw(0x8000 | ((port->channel) << (card->shift_count)) | 0x3, base); outw((length & 0xff) << 8 | 0x00, base); - outw((length & 0xff00), base); + outw((length & 0xff00u), base); InterruptTheCard(base); unlock_card(card); From patchwork Thu May 4 20:52:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98579 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806392qgd; Thu, 4 May 2017 13:52:30 -0700 (PDT) X-Received: by 10.99.152.67 with SMTP id l3mr10996816pgo.97.1493931150087; Thu, 04 May 2017 13:52:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.29; Thu, 04 May 2017 13:52:30 -0700 (PDT) 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 S1751281AbdEDUw3 (ORCPT + 6 others); Thu, 4 May 2017 16:52:29 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:53937 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428AbdEDUw2 (ORCPT ); Thu, 4 May 2017 16:52:28 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lzkot-1e9VKB00nL-0155cY; Thu, 04 May 2017 22:52:20 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann , "David S . Miller" Subject: [PATCH 09/13] [3.18-stable] infiniband: mlx5: avoid a compile-time warning Date: Thu, 4 May 2017 22:52:05 +0200 Message-Id: <20170504205209.498721-10-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:A/1ziaqaWU+Whctp3XiR1aGnlsDwtAv++gO+U+29z8/x5E7uDjs 23d52tirZnmrxUBSgd7AT1DZn0ExIzaLv465s1jq2ZgNv3hBpy2xiN57sIFrUnYbqtxoJl/ ZkJeanPfFEgFhtAJM73g9KdBZVr1UOR2wu1Qxv+ps+ohY74mns0pgpl5C29aGj/VDTJePVN BUXJjoTUYgCbbnUba9nzA== X-UI-Out-Filterresults: notjunk:1; V01:K0:tN9X5aNIcJA=:UjEDXWEQ4td+vQumE0TnYQ Y7ULWazsJD1Ml7/rkLYBGTiksews9kyYNatJ9SrBojaLIH8sHDqjpg9l9wiWcUlRBAXvg11T3 0IeTcKW6CBQB/xCEfYUijMeRREiwLeJt5B10U74wrE74BEYiXT6LX5bWQPcqd+Rs03JW74bBY 2XCS5esqt6dYpVtGcgoLl9/4rV15fZw2wKymEQ+4HZt0on196qsH36rkKsUwygDqhlvpT/1/0 oLOW0lZoOKWJLzZYeBbhzwJENLwdJzV3FhI4XXjkmErysnWZXXuDL+4HxorrT07v6rGAcqI8U oV6ldPYGmlub1VQQyrRvtNW8WM1Eq6Kn9/MdJjy4ShabgRypJoDrSQfeh1A1Q7VDdzg/TT78k bmOhGmSc3jORfSnaqnXGfZbQ1QhB4HdMSvwzQMUbmSbuPdnarWe4cD7V5s+xlpvYQbeMZXmKF AzEUFarT8zZhRrLwOHvejxj73oxwMNno3pKfJhBkt0sWgDG2Ze+4ShRmih4ee3WTxN/LAFoxA UHeJEMO6eALoxj6HscRGyIzMQQMXt9UY8hwxSp2DQRchLi8px215rEbdhXwZQJbrEGyAFrZpP 0vi6RKDuQTg4lNFTn9UyLPuJB6/utDm+sgw1WC/5JcD3/hPBEpDBPZWuvUlE25dKtJfQ/HEh0 mWWkZ5IojXueOHCNlRZk0CgNRwkALPQIHaJ+DrnbY9zWG+5Wamrwe9ZfZbG3xi/0H+7I= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 7835bfb5261501590a508b3de3379e2231cb4853 upstream. The return type of find_first_bit() is architecture specific, on ARM it is 'unsigned int', while the asm-generic code used on x86 and a lot of other architectures returns 'unsigned long'. When building the mlx5 driver on ARM, we get a warning about this: infiniband/hw/mlx5/mem.c: In function 'mlx5_ib_cont_pages': infiniband/hw/mlx5/mem.c:84:143: warning: comparison of distinct pointer types lacks a cast m = min(m, find_first_bit(&tmp, sizeof(tmp))); This patch changes the driver to use min_t to make it behave the same way on all architectures. Signed-off-by: Arnd Bergmann Acked-by: Eli Cohen Signed-off-by: David S. Miller Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/mlx5/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/infiniband/hw/mlx5/mem.c b/drivers/infiniband/hw/mlx5/mem.c index dae07eae9507..0a9b2ae93874 100644 --- a/drivers/infiniband/hw/mlx5/mem.c +++ b/drivers/infiniband/hw/mlx5/mem.c @@ -69,7 +69,7 @@ void mlx5_ib_cont_pages(struct ib_umem *umem, u64 addr, int *count, int *shift, for (k = 0; k < len; k++) { if (!(i & mask)) { tmp = (unsigned long)pfn; - m = min(m, find_first_bit(&tmp, sizeof(tmp))); + m = min_t(unsigned long, m, find_first_bit(&tmp, sizeof(tmp))); skip = 1 << m; mask = skip - 1; base = pfn; From patchwork Thu May 4 20:52:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98581 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806430qgd; Thu, 4 May 2017 13:52:35 -0700 (PDT) X-Received: by 10.99.111.79 with SMTP id k76mr48824318pgc.48.1493931155600; Thu, 04 May 2017 13:52:35 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.35; Thu, 04 May 2017 13:52:35 -0700 (PDT) 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 S1751468AbdEDUwe (ORCPT + 6 others); Thu, 4 May 2017 16:52:34 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:55527 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbdEDUwe (ORCPT ); Thu, 4 May 2017 16:52:34 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0LmC02-1detTK15hC-00ZtYZ; Thu, 04 May 2017 22:52:20 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, James Bottomley , Arnd Bergmann Subject: [PATCH 10/13] [3.18-stable] ips: remove pointless #warning Date: Thu, 4 May 2017 22:52:06 +0200 Message-Id: <20170504205209.498721-11-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:l0E2EeS406rp5J5p7BetGay2tXHCLxYmL5qm5SH5Jv/p9bAo5hv ooBQMJiaILGEl+uc2PNfGIDfpPReqrR6RXn1qBcNVV+Xf23UAGcJKNai4Uulcuujm9V5/GG UMjTdByXzyXa9LgHv1IZhzK/snSpVCy7j/lJPhiIK4Zzk5VQ2OMTkh2aLujfQ61GdIYftAp 8d9PZS7ft2O9Cnnd66RqQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:m7QJya2xsI8=:wS/14uNNRP7ASvQQLnEjy0 dmM3wInEVmr9ZvKMLNf79FtZRhB7qbIMjAtlQ2PqnK1gDtfeQREZBX4nFmqdeCD3a4HXl+dw0 5JEs7P8/GYCMH+mwGy3NdsdY6qaOtXmD/KJc9vtTW1XWAU+jsLoCAg7/wZ9IaTUZGS7OHUbSD ym2XssuO9qd9eeQu2rCf16fqvKjJ/bX9xn4gbDKftKaS0rhLJ0Ci9XIiUazVOIOjOS1qwFUDw hLEsk9SpVJovc9nMiLXjRwxcuzusG9S8gtJsHhO4X5zlwgK5KYoWxc76fIUHmlHzuUQjA/FOA iDfB/4NA66ghTIJAM3G1+cLctUd50lJMe0KiDSyxSKexRYc8VhTjTClvVy2ILZMU065D+SrcM 7Zx82xk7vyPzLw0MioBk5xd3nFgXGUkdZXiAL6L6BNQraKVbPJtGFMPmr40embHnXjR4913lC 8RCvnpM7RkvgxePIgasIyDy9lRZbz/obCknc/iCVUQ4rtnFW2ty2CDBuLcfhheoDCbze3oziT kdRGXjdI2DmwXKWgGXnJyggiylLpMOJ888ORl4XtfpA6PQj/2u6yYR8HRCTEF7bAdUONdQort 34/wK5ozWidZnqaMm4HNLzc6j8/gZMSHl+w8MCSY9Is25arM1rRDm2MXmX18+Y5Dc2EW3PCeA GZW5Y9vyvN4kB4kSQtCicMtjgX7LmwpgfeefYt5s/s9ljLLf+DRz0jCWZF1WzNlHoQQM= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: James Bottomley Commit e03c2da6574223081b786960e39c1e5ecf5d492d upstream. non-x86 builds want the #warning in the IPS code about compiling on the wrong architecture removed because it keeps triggering on their platforms build farms. Transform from a compile time warning into a runtime one with taint to preserve the original intent of the authors. Acked-by: Arnd Bergmann Signed-off-by: James Bottomley Signed-off-by: Arnd Bergmann --- drivers/scsi/ips.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index e5afc3884d74..b4ee611d41d6 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -206,10 +206,6 @@ module_param(ips, charp, 0); #define IPS_VERSION_HIGH IPS_VER_MAJOR_STRING "." IPS_VER_MINOR_STRING #define IPS_VERSION_LOW "." IPS_VER_BUILD_STRING " " -#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) -#warning "This driver has only been tested on the x86/ia64/x86_64 platforms" -#endif - #define IPS_DMA_DIR(scb) ((!scb->scsi_cmd || ips_is_passthru(scb->scsi_cmd) || \ DMA_NONE == scb->scsi_cmd->sc_data_direction) ? \ PCI_DMA_BIDIRECTIONAL : \ @@ -6789,6 +6785,11 @@ ips_remove_device(struct pci_dev *pci_dev) static int __init ips_module_init(void) { +#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) + printk(KERN_ERR "ips: This driver has only been tested on the x86/ia64/x86_64 platforms\n"); + add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_STILL_OK); +#endif + if (pci_register_driver(&ips_pci_driver) < 0) return -ENODEV; ips_driver_template.module = THIS_MODULE; From patchwork Thu May 4 20:52:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98580 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806397qgd; Thu, 4 May 2017 13:52:30 -0700 (PDT) X-Received: by 10.84.231.206 with SMTP id g14mr59629463pln.152.1493931150616; Thu, 04 May 2017 13:52:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.30; Thu, 04 May 2017 13:52:30 -0700 (PDT) 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 S1751428AbdEDUw3 (ORCPT + 6 others); Thu, 4 May 2017 16:52:29 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:53820 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbdEDUw2 (ORCPT ); Thu, 4 May 2017 16:52:28 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0M8u2m-1dE7Vg22kG-00C8aL; Thu, 04 May 2017 22:52:20 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann , "David S . Miller" Subject: [PATCH 11/13] [3.18-stable] mISDN: avoid arch specific __builtin_return_address call Date: Thu, 4 May 2017 22:52:07 +0200 Message-Id: <20170504205209.498721-12-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:u3kNEj5j1uLSZMxYpU3cmRdM2cEe57UOPs+LCiqOMALDLEe3ATM CaqqqpkESzfgDxScPwhD4wu2ZwlWRtL3mmBAq6uepae4tVJs7TcJHCnO3K4HpoGMYzHNkMi ur7U/j3dF9dKID5tCjfR2RKEGZ3FclNRgPtWbPveACpzsKf4b+CEI2+6lnCTioKrWXIAljn zQUkF0d2rzkiSfMSFX76w== X-UI-Out-Filterresults: notjunk:1; V01:K0:FlMaDeA2bGw=:6LEnAsPIiMIXvQpNkcK9ry j9BP63ypTClT7LEjwYOtO/fbyeCtVQLLWKdc2fq7RnYW137GoOrjoWUxUYW+YygEwtw/afARt nb6ZK31OuTWHNfkJZ5/NjUGNmeARZ8H991h+N4JYUr4A1ZFty8CWQkVWCv1/FwT0numbfcXI/ bIIHKBAj7z1vUZALYKLowchjKbEfaFUstCIW5HDJlVzs3/zDOzRh9NUEC3kRhoMhvEtfWADK9 f9THU1poR5m0BOIpvSB8x/xV93UAtcEdmRO93Iu/qSmKGk7e73RDgJfWX6UWnrYJMV8aFHy6F GZTjBz/h7girksvVk6tVjED2aVhO4inp6VNDt13QdVE+z5Hst3dJ32YbR4DtoQbG39YpZvQOr vUSe+iDR4uZ7wEvX39fwdhzp3jbNsrZNNkVBCWQahLtzuu25xZpcea9l5n0BlPuKAk9h9q9gW AC+2K+1po7V2EsxWumD5Yqxus8+MtuPfHIgbfaCPoXHfzrJtxMcTKsMsTqlr51dCw2iQAIofA LDLsalC13tM+ZMKQTJQDcXNuq1Z2buKMIezb0DHH8fgm8ov2ZzNdKBPppX1boSgzv9JeOtDRH WDzjC1Mk/ZpBNNHetY8srWKgKzCAhAFq0EdCo5ufh9KwVyuzY9ayBJkhL+lb2NKpg/Glc0pnT CQB4BpqkJBo98/baOcMG+nNKCKLFMLT0SIZt//Dt6aHP3QcYzm/aj81U6DRtayUIG6Z4= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 3e7a8716e20b759eec0ad88145255bb33174f0c8 upstream. Not all architectures are able to call __builtin_return_address(). On ARM, the mISDN code produces this warning: hardware/mISDN/w6692.c: In function 'w6692_dctrl': hardware/mISDN/w6692.c:1181:75: warning: unsupported argument to '__builtin_return_address' pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__, ^ hardware/mISDN/mISDNipac.c: In function 'open_dchannel': hardware/mISDN/mISDNipac.c:759:75: warning: unsupported argument to '__builtin_return_address' pr_debug("%s: %s dev(%d) open from %p\n", isac->name, __func__, ^ In a lot of cases, this is relatively easy to work around by passing the value of __builtin_return_address(0) from the callers into the functions that want it. One exception is the indirect 'open' function call in struct isac_hw. While it would be possible to fix this as well, this patch only addresses the other callers properly and lets this one return the direct parent function, which should be good enough. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Arnd Bergmann --- drivers/isdn/hardware/mISDN/mISDNipac.c | 12 +++++++++--- drivers/isdn/hardware/mISDN/w6692.c | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index ccd7d851be26..a77eea594b69 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c @@ -754,10 +754,10 @@ dbusy_timer_handler(struct isac_hw *isac) } static int -open_dchannel(struct isac_hw *isac, struct channel_req *rq) +open_dchannel_caller(struct isac_hw *isac, struct channel_req *rq, void *caller) { pr_debug("%s: %s dev(%d) open from %p\n", isac->name, __func__, - isac->dch.dev.id, __builtin_return_address(1)); + isac->dch.dev.id, caller); if (rq->protocol != ISDN_P_TE_S0) return -EINVAL; if (rq->adr.channel == 1) @@ -771,6 +771,12 @@ open_dchannel(struct isac_hw *isac, struct channel_req *rq) return 0; } +static int +open_dchannel(struct isac_hw *isac, struct channel_req *rq) +{ + return open_dchannel_caller(isac, rq, __builtin_return_address(0)); +} + static const char *ISACVer[] = {"2086/2186 V1.1", "2085 B1", "2085 B2", "2085 V2.3"}; @@ -1548,7 +1554,7 @@ ipac_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg) case OPEN_CHANNEL: rq = arg; if (rq->protocol == ISDN_P_TE_S0) - err = open_dchannel(isac, rq); + err = open_dchannel_caller(isac, rq, __builtin_return_address(0)); else err = open_bchannel(ipac, rq); if (err) diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index de69f6828c76..741675525b53 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c @@ -1176,10 +1176,10 @@ w6692_l1callback(struct dchannel *dch, u32 cmd) } static int -open_dchannel(struct w6692_hw *card, struct channel_req *rq) +open_dchannel(struct w6692_hw *card, struct channel_req *rq, void *caller) { pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__, - card->dch.dev.id, __builtin_return_address(1)); + card->dch.dev.id, caller); if (rq->protocol != ISDN_P_TE_S0) return -EINVAL; if (rq->adr.channel == 1) @@ -1207,7 +1207,7 @@ w6692_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg) case OPEN_CHANNEL: rq = arg; if (rq->protocol == ISDN_P_TE_S0) - err = open_dchannel(card, rq); + err = open_dchannel(card, rq, __builtin_return_address(0)); else err = open_bchannel(card, rq); if (err) From patchwork Thu May 4 20:52:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98578 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806385qgd; Thu, 4 May 2017 13:52:29 -0700 (PDT) X-Received: by 10.99.254.69 with SMTP id x5mr48026004pgj.2.1493931149492; Thu, 04 May 2017 13:52:29 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.29; Thu, 04 May 2017 13:52:29 -0700 (PDT) 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 S1751456AbdEDUw2 (ORCPT + 6 others); Thu, 4 May 2017 16:52:28 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:61261 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbdEDUw2 (ORCPT ); Thu, 4 May 2017 16:52:28 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0MaRL6-1dLrHo2xMO-00JrqL; Thu, 04 May 2017 22:52:20 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Arnd Bergmann , Catalin Marinas Subject: [PATCH 12/13] [3.18-stable] arm64: build vdso without libgcov Date: Thu, 4 May 2017 22:52:08 +0200 Message-Id: <20170504205209.498721-13-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:qRgkIl5xxQHJ0CVd7rEU2YI4oFJerUFNhYon0v1CNLTU1cCiluc XFLGlT51RieClqHUWkLoZP1wLjQ/lwJlY9O+uLCTdigmiwAf7GoICPkZr9SEAlR639lZOtw osslix1sOaReQIp4jZGzj/bFQpDAFmvm6wCt+IUyAbJX3b2w75AUZ4HzhiJV77oVY5OVmpg sudmutn449aqe+I+1eiMg== X-UI-Out-Filterresults: notjunk:1; V01:K0:90vb3GNrt0k=:9BGG9VaXGvJfmYRC5btUj1 5lBaHE5tnf075V5709NXgPDMltxKYWK/B5BlG6Fgt12rlII0pouwLtbfQHRTt2LFGTio1MiLn uzq8jWW7r9IR2bUptR2HATE1SGcDaiCMc4bip+eyM+ht2bKU6MMC8GjuxfDHSkoNJs06FEOe6 DvgCLLqVBt2MhTE73m7x4eCoz4U6WGXpwXDUS5O174k09PS8P5OuB3joVPex7h0bihveD49JD mQld6SZvaGapxi+/rgivAcS7aFLH6oLKfotfb+8pD4R5d4OGCy5vpCtH1jZT/CR9wFe6bBAoO 6E6pCBQYMTmRkz0W4ht1u/aBqicHjlGdUwfQALV0CCJ1OVo2MIt+nR4TEM90m44QXv02We1XP EqHp86w9kZsjUrtgwZpNpZRQy/jhz336U5tWmJfHa6pSQdvabq+lFs+yQRldE/tzsZLXzhjz+ 7uPVbCK17n/cD/L5TjOKr0Ny71TephUvUWvBkesUfJN4MJyfgmR96BVIIqf7iNUGJjfxUvZi3 y2xPfoR1iJ9I7gQ2pSz12nbtlrK813cNM/iNvTWuG+sIqQS65wZaixCqyg63uSgcZqw4YvDe7 8FM9hUf0ncXoKQs6pjiTEkxbBjvFr++ZwXDu7mF2xChT86cuHcccT6QgTtDpTrrCWqOoCeONS tBrV0nJf8aC7Og6JuNLttjzLYGZ2/9VZP5L40SzG/EBTadMy2lloVfgTKk04QA4xZbQk= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 543097843ca7c9ac3758d0b5879ea2a6f44089de upstream. On a cross-toolchain without glibc support, libgcov may not be available, and attempting to build an arm64 kernel with GCOV enabled then results in a build error: /home/arnd/cross-gcc/lib/gcc/aarch64-linux/5.2.1/../../../../aarch64-linux/bin/ld: cannot find -lgcov We don't really want to link libgcov into the vdso anyway, so this patch just disables GCOV in the vdso directory, just as we do for most other architectures. Signed-off-by: Arnd Bergmann Signed-off-by: Catalin Marinas Signed-off-by: Arnd Bergmann --- arch/arm64/kernel/vdso/Makefile | 3 +++ 1 file changed, 3 insertions(+) -- 2.9.0 diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile index f6fe17d88da5..b467fd0a384b 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile @@ -15,6 +15,9 @@ ccflags-y := -shared -fno-common -fno-builtin ccflags-y += -nostdlib -Wl,-soname=linux-vdso.so.1 \ $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) +# Disable gcov profiling for VDSO code +GCOV_PROFILE := n + # Workaround for bare-metal (ELF) toolchains that neglect to pass -shared # down to collect2, resulting in silent corruption of the vDSO image. ccflags-y += -Wl,-shared From patchwork Thu May 4 20:52:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98576 Delivered-To: patch@linaro.org Received: by 10.140.89.200 with SMTP id v66csp806376qgd; Thu, 4 May 2017 13:52:27 -0700 (PDT) X-Received: by 10.98.214.193 with SMTP id a62mr10198067pfl.40.1493931147623; Thu, 04 May 2017 13:52:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3136031pls.89.2017.05.04.13.52.27; Thu, 04 May 2017 13:52:27 -0700 (PDT) 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 S1751393AbdEDUw0 (ORCPT + 6 others); Thu, 4 May 2017 16:52:26 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:54823 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdEDUwZ (ORCPT ); Thu, 4 May 2017 16:52:25 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mhr3z-1dRbuw26Db-00MvBK; Thu, 04 May 2017 22:52:21 +0200 From: Arnd Bergmann To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Stephen Rothwell , Andrew Morton , Linus Torvalds , Arnd Bergmann Subject: [PATCH 13/13] [3.18-stable] mm/cma: silence warnings due to max() usage Date: Thu, 4 May 2017 22:52:09 +0200 Message-Id: <20170504205209.498721-14-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170504205209.498721-1-arnd@arndb.de> References: <20170504205209.498721-1-arnd@arndb.de> X-Provags-ID: V03:K0:kcd97owqD3TFxWJk1/nFiBPprdNT84ehX2ZYN2f2TBtuYcqNr7M 3w1eQo0+3OJEjBWgFI3v7i9z+1IybAsj1qz+7WY/ynbRdWlfBJTaWDm2vJtYDU+aZcbBnH4 Gob0917F5qJ0dCSFODqOQq7v2IUeErK0UHMHJGhmKAzrSt+9bAAbB4p8awfaM9roJqsJEce xxvEolbu35zYDqc0Vm4Zw== X-UI-Out-Filterresults: notjunk:1; V01:K0:2oDjRsES+4Y=:Pa2RZ47f+ewxheCuwDdgHu X+OqPwXt/VFZlUnJG2IxsYJuU+cX6zlp47hUhiB+zCFk/dSFvTZNX3KRYvHIBepAVQcz6YcJa UHA5q+Z6+ZbL6FChCKo+7y94qAiEYt4FQrZj76g1A4i2UdYNFi7Yg8FR4nhp0wKWN4gF+S4Q3 R9J0/u7TnoMUY8CPBGaNPxFPCBx/4qS64Nk3edB/8dqWD3KHAFMwf58sTu9b+Gd1Sxih1N/AU Djcx9qC8jYLBuI2xPcnfdIKEY5DStCJIYwR+B0wb+cu1QZ/1fOGKp52O2W8I69fim+gL8obtW 7LaGEqC4p177ObwWXF84a6P5KZ1zvOu/xK3K4OtsiP8n80LV2P99aV+vB6H5DGbfAOlRMmAnp eVZllrqc4ZD8GWOq52eO/RhFoHL7L/zyC5S/WpspEQuisl9MBpg2rpVrTrTVkC6wXEedDZeNu QNE92TrO7zASKqFokYhuj9mrQ7EDli5n/723di3NNl+703EA7JAtncewLq75+K90528viJRcB U5Y4lvuBbga/xX7dD8wzz3ClXrpkdiv9WDDxr1zmUE7ZnPcE4Qwz745ShlbdAR9u6mMC1lQdC 3riBsKDJZgDe/smYoVc961c7pjIksnJRa3+lDKisfICWx2NHsv1jUIrF9AY8oXdjB5fLkTm0f H23I2JoHnv/qTHGZsskH7ccMV2yzPDbBBrMITaZHFLuVEBzQimuKgxkv0+Ymm22OD4m0= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stephen Rothwell Commit badbda53e505089062e194c614e6f23450bc98b2 upstream. pageblock_order can be (at least) an unsigned int or an unsigned long depending on the kernel config and architecture, so use max_t(unsigned long, ...) when comparing it. fixes these warnings: In file included from include/asm-generic/bug.h:13:0, from arch/powerpc/include/asm/bug.h:127, from include/linux/bug.h:4, from include/linux/mmdebug.h:4, from include/linux/mm.h:8, from include/linux/memblock.h:18, from mm/cma.c:28: mm/cma.c: In function 'cma_init_reserved_mem': include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast (void) (&_max1 == &_max2); ^ mm/cma.c:186:27: note: in expansion of macro 'max' alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); ^ mm/cma.c: In function 'cma_declare_contiguous': include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast (void) (&_max1 == &_max2); ^ include/linux/kernel.h:747:9: note: in definition of macro 'max' typeof(y) _max2 = (y); ^ mm/cma.c:270:29: note: in expansion of macro 'max' (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order)); ^ include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast (void) (&_max1 == &_max2); ^ include/linux/kernel.h:747:21: note: in definition of macro 'max' typeof(y) _max2 = (y); ^ mm/cma.c:270:29: note: in expansion of macro 'max' (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order)); ^ [akpm@linux-foundation.org: coding-style fixes] Link: http://lkml.kernel.org/r/20160526150748.5be38a4f@canb.auug.org.au Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Arnd Bergmann --- mm/cma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/mm/cma.c b/mm/cma.c index 8e9ec13d31db..0f4549cf796f 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -168,7 +168,8 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size, return -EINVAL; /* ensure minimal alignment requied by mm core */ - alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); + alignment = PAGE_SIZE << + max_t(unsigned long, MAX_ORDER - 1, pageblock_order); /* alignment should be aligned with order_per_bit */ if (!IS_ALIGNED(alignment >> PAGE_SHIFT, 1 << order_per_bit)) @@ -250,8 +251,8 @@ int __init cma_declare_contiguous(phys_addr_t base, * migratetype page by page allocator's buddy algorithm. In the case, * you couldn't get a contiguous memory, which is not what we want. */ - alignment = max(alignment, - (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order)); + alignment = max(alignment, (phys_addr_t)PAGE_SIZE << + max_t(unsigned long, MAX_ORDER - 1, pageblock_order)); base = ALIGN(base, alignment); size = ALIGN(size, alignment); limit &= ~(alignment - 1);