From: khalasa@piap.pl (Krzysztof Hałasa)
To: Arnd Bergmann <arnd@arndb.de>
Cc: Imre Kaloz <kaloz@openwrt.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/12] ARM: ixp4xx: fix ioport_unmap definition
Date: Fri, 21 Jul 2017 14:21:53 +0200 [thread overview]
Message-ID: <m3lgnif09q.fsf@t19.piap.pl> (raw)
In-Reply-To: <20170720154616.3250481-2-arnd@arndb.de> (Arnd Bergmann's message of "Thu, 20 Jul 2017 17:45:55 +0200")
Arnd Bergmann <arnd@arndb.de> writes:
> An empty macro definition can cause unexpected behavior, in
> case of the ixp4xx ioport_unmap, we get two warnings:
>
> drivers/net/wireless/marvell/libertas/if_cs.c: In function 'if_cs_release':
> drivers/net/wireless/marvell/libertas/if_cs.c:826:3: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> ioport_unmap(card->iobase);
> drivers/vfio/pci/vfio_pci_rdwr.c: In function 'vfio_pci_vga_rw':
> drivers/vfio/pci/vfio_pci_rdwr.c:230:15: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parentheses]
> is_ioport ? ioport_unmap(iomem) : iounmap(iomem);
>
> This uses an inline function to define the macro in a safer way.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/arm/mach-ixp4xx/include/mach/io.h | 11 +++++++++--
Acked-by: Krzysztof Halasa <khalasa@piap.pl>
In fact, the old code contained another bug (missing parentheses):
> --- a/arch/arm/mach-ixp4xx/include/mach/io.h
>
> -#define ioport_map(port, nr) ((void __iomem*)(port + PIO_OFFSET))
^^^^
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
next prev parent reply other threads:[~2017-07-21 12:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170720154616.3250481-1-arnd@arndb.de>
2017-07-20 15:45 ` Arnd Bergmann
2017-07-21 12:21 ` Krzysztof Hałasa [this message]
2017-07-20 15:49 ` [PATCH 02/12] ARM: ep93xx: use ARM_PATCH_PHYS_VIRT Arnd Bergmann
2017-07-20 16:07 ` Alexander Sverdlin
2017-08-02 12:29 ` Linus Walleij
2017-07-20 15:50 ` [PATCH 03/12] ARM: normalize clk API for older platforms Arnd Bergmann
2017-07-21 8:05 ` Sekhar Nori
2017-07-21 8:17 ` Arnd Bergmann
2017-07-21 9:44 ` Sekhar Nori
2017-07-20 15:51 ` [PATCH 04/12] ARM: sa1100/pxa: fix MTD_XIP build Arnd Bergmann
2017-07-23 15:53 ` Robert Jarzmik
2017-07-25 15:14 ` Arnd Bergmann
2017-07-20 15:51 ` [PATCH 05/12] ARM: mmp: mark usb_dma_mask as __maybe_unused Arnd Bergmann
2017-07-20 15:51 ` [PATCH 06/12] ARM: omap2: mark unused functions " Arnd Bergmann
2017-07-27 10:08 ` Sebastian Reichel
2017-07-20 15:51 ` [PATCH 07/12] ARM: omap1: avoid unused variable warning Arnd Bergmann
2017-07-20 15:51 ` [PATCH 08/12] ARM: sirf: mark sirfsoc_init_late as __maybe_unused Arnd Bergmann
2017-07-20 15:51 ` [PATCH 09/12] ARM: ixp4xx: use normal prototype for {read,write}s{b,w,l} Arnd Bergmann
2017-07-20 15:53 ` [PATCH 10/12] [v2] ARM: s3c24xx: make H1940BT depend on RFKILL Arnd Bergmann
2017-07-20 19:30 ` Krzysztof Kozlowski
2017-07-20 15:53 ` [PATCH 11/12] ARM: omap1/ams-delta: warn about failed regulator enable Arnd Bergmann
2017-07-20 15:53 ` [PATCH 12/12] ARM: rpc: rename RAM_SIZE macro Arnd Bergmann
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=m3lgnif09q.fsf@t19.piap.pl \
--to=khalasa@piap.pl \
--cc=arnd@arndb.de \
--cc=kaloz@openwrt.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.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
Powered by JetHome