From patchwork Mon Jul 10 14:44:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9833153 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 28A2A60350 for ; Mon, 10 Jul 2017 14:46:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B3CD2015F for ; Mon, 10 Jul 2017 14:46:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FB5C27FB3; Mon, 10 Jul 2017 14:46:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D8292015F for ; Mon, 10 Jul 2017 14:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754071AbdGJOpp (ORCPT ); Mon, 10 Jul 2017 10:45:45 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:56326 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394AbdGJOpo (ORCPT ); Mon, 10 Jul 2017 10:45:44 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mh8jt-1dH9lo1MSv-00MI3X; Mon, 10 Jul 2017 16:44:33 +0200 From: Arnd Bergmann To: x86@kernel.org Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Kalle Valo , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Arnd Bergmann Subject: [RFC 1/2] x86: mark target address as output in 'insb' asm Date: Mon, 10 Jul 2017 16:44:24 +0200 Message-Id: <20170710144425.2238584-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:j1PvX5guU+bnureQ+1CD9AwROLeJSpO5PFcLONVdmXkZiAxhpP6 nIQyZz07fLaAJ8bd/+a5Qhv89Jv+8Qrmk2vAVtSDGpDnm41NZynX7Rqahqs1jhwBJa/TULI 5BDpgwNB+qhbtqXh5SEL0bz+f/RLHlO0CpqMKxT6YhwlkwKqpX5R0dlR7haAnLsfs2xjeOV 8KmMj7UWpDwWY+EalS7sw== X-UI-Out-Filterresults: notjunk:1; V01:K0:u4r8qwiVcGI=:MBrxAIEzpg9GdFAsZc/hqh H9JeoCiHcl03JTY6wJfvPO1faztl10AjIZB3Eqdg5G/UVpnKeRs9OfqARLoKoCLSxxTrCYabu 7pRrOAhQ2j0gx6n0BxrgcmJD7XoM1ROFPlyJ0H5xuet2emXnScnewGqecp67CPskLL22IB7vF DX5NVKcEoR8S0q42uUZ7EodM3Yfu7RSSdOlOX4S17uEde5xo9+4a5+A77P8bmCE3/uq/CDleb QC1LGmLMzgLJEVs6xeQRJI7U8qxJ8rvii8W6VHPwu/XzNKPZmNU+nMKRi64OaQBAPMZKr9lax ZcIsQohEhJvpApp02omvPuHJSnO+uSkQcy41TdLs3G3jjNbFG+0zOg4AeZO4mdQ5CdVYcLv7M TbK8ZSAfDqrcKf5FpegL2fzHkDLsHMZRukPlijEm4j5mpcu4QdyiMG0fhHmslZ81MidLI94ig kR6VZvI4rAAJrn58Sp6T2OLIWyUMxXPyuT0RY3kG6vc9JNmHosAcfNFCLxQzSn2B9lo+Zir4W cwg+42ysBl+vbJf4c1+sbXTwcpaXw3+vRRCc7mQFwKpi2SIJyQnnse5JJ+JwRLsPFW+WTqUol 1/5CrJAy40fnIP+Ein9DuGMz9XUar3/Wk+rXf8Uk2AUa/dCERZoeh8sztvBs1YmGODOTHp1pi F/OzJdeJvI1bofje6fzkSZ4LyQ3H5UjNtswl4gZL/1KNyP++RBiEeRRqNftke6KO1qYXyWMdV HyWg0wpXNYQkESAL Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The -Wmaybe-uninitialized warning triggers for one driver using the output of the 'insb' I/O helper on x86: drivers/net/wireless/wl3501_cs.c: In function ‘wl3501_mgmt_scan_confirm’: drivers/net/wireless/wl3501_cs.c:665:9: error: ‘sig.status’ is used uninitialized in this function [-Werror=uninitialized] drivers/net/wireless/wl3501_cs.c:668:12: error: ‘sig.cap_info’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Apparently the assember constraints are slightly off here, as marking the 'addr' argument as a memory output seems appropriate here and gets rid of the warning. For consistency I'm also adding it as input for outsb(). Unfortunately, this fix triggers another problem when CONFIG_KASAN is set, again only in this one driver: drivers/net/wireless/wl3501_cs.c: In function 'wl3501_rx_interrupt': drivers/net/wireless/wl3501_cs.c:1103:1: error: the frame size of 2232 bytes is larger than 1536 bytes [-Werror=frame-larger-than=] I'm not an x86 person and gcc inline assembly mystifies me all the time, so please review this carefully and suggest a better way if this is not how it should be done. Signed-off-by: Arnd Bergmann --- arch/x86/include/asm/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 7afb0e2f07f4..d107251eabd9 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -328,13 +328,13 @@ static inline unsigned type in##bwl##_p(int port) \ static inline void outs##bwl(int port, const void *addr, unsigned long count) \ { \ asm volatile("rep; outs" #bwl \ - : "+S"(addr), "+c"(count) : "d"(port)); \ + : "+S"(addr), "+c"(count) : "d"(port), "m" (addr));\ } \ \ static inline void ins##bwl(int port, void *addr, unsigned long count) \ { \ asm volatile("rep; ins" #bwl \ - : "+D"(addr), "+c"(count) : "d"(port)); \ + : "+D"(addr), "+c"(count), "=m" (addr) : "d"(port));\ } BUILDIO(b, b, char)