public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Arnd Bergmann <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
	mingo@kernel.org, tglx@linutronix.de, arnd@arndb.de,
	brgerst@gmail.com, torvalds@linux-foundation.org,
	kvalo@codeaurora.org, hpa@zytor.com, dvlasenk@redhat.com,
	luto@kernel.org, bp@alien8.de, jpoimboe@redhat.com
Subject: [tip:x86/urgent] x86/io: Mark target address as output in 'insb()' asm
Date: Wed, 12 Jul 2017 06:10:19 -0700	[thread overview]
Message-ID: <tip-ea1b2ee6eacc4413b1dfba566480c90d0da4ec81@git.kernel.org> (raw)
In-Reply-To: <20170710144425.2238584-1-arnd@arndb.de>

Commit-ID:  ea1b2ee6eacc4413b1dfba566480c90d0da4ec81
Gitweb:     http://git.kernel.org/tip/ea1b2ee6eacc4413b1dfba566480c90d0da4ec81
Author:     Arnd Bergmann <arnd@arndb.de>
AuthorDate: Mon, 10 Jul 2017 16:44:24 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 12 Jul 2017 10:42:32 +0200

x86/io: Mark target address as output in 'insb()' asm

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().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-wireless@vger.kernel.org
Link: http://lkml.kernel.org/r/20170710144425.2238584-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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 7afb0e2..d107251 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)

  parent reply	other threads:[~2017-07-12 13:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 14:44 [RFC 1/2] x86: mark target address as output in 'insb' asm Arnd Bergmann
2017-07-10 14:44 ` [RFC 2/2] wl3501_cs: reduce stack size for KASAN Arnd Bergmann
2017-07-25 12:52   ` Kalle Valo
2017-07-25 14:50     ` Arnd Bergmann
2017-07-12 13:10 ` tip-bot for Arnd Bergmann [this message]
2017-07-12 16:57   ` [tip:x86/urgent] x86/io: Mark target address as output in 'insb()' asm Linus Torvalds
2017-07-12 19:24     ` Ingo Molnar
2017-07-12 21:47     ` Arnd Bergmann
2017-07-12 22:43       ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-ea1b2ee6eacc4413b1dfba566480c90d0da4ec81@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox