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);