From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Randy Dunlap <rdunlap@infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>,
Linux-sh list <linux-sh@vger.kernel.org>,
Takashi YOSHII <takasi-y@ops.dti.ne.jp>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH 3/3 v2] sh: fix READ/WRITE redefinition warnings
Date: Fri, 2 Jul 2021 11:25:19 +0200 [thread overview]
Message-ID: <85485961-4c6e-a1bc-d66a-19869b5a03f1@physik.fu-berlin.de> (raw)
In-Reply-To: <CAMuHMdUjT3GnZTUurHmjctxaa==VYU9-rNuQun=f=RyWi2M5Tw@mail.gmail.com>
Hi Geert!
On 7/1/21 10:41 AM, Geert Uytterhoeven wrote:
>>> OK. Thanks for all of the testing.
>>
>> I'll report back with the other patch applied that Geert mentioned from linux-next before this one.
>
> FTR, I booted all three successfully on qemu/rts7751r2d and on physical landisk.
Good to know, thanks.
>> FWIW, there are some warnings when building the SH-7785LCR configuration:
>>
>> In file included from ./arch/sh/include/asm/hw_irq.h:6,
>> from ./include/linux/irq.h:591,
>> from ./include/asm-generic/hardirq.h:17,
>> from ./arch/sh/include/asm/hardirq.h:9,
>> from ./include/linux/hardirq.h:11,
>> from ./include/linux/interrupt.h:11,
>> from ./include/linux/serial_core.h:13,
>> from ./include/linux/serial_sci.h:6,
>> from arch/sh/kernel/cpu/sh4a/setup-sh7785.c:10:
>> ./include/linux/sh_intc.h:100:63: warning: division 'sizeof (void *) / sizeof (void)' does not compute the number of array elements [-Wsizeof-pointer-div]
>> 100 | #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a)
>> | ^
>> ./include/linux/sh_intc.h:107:9: note: in expansion of macro '_INTC_ARRAY'
>> 107 | _INTC_ARRAY(sense_regs), _INTC_ARRAY(ack_regs), \
>> | ^~~~~~~~~~~
>> ./include/linux/sh_intc.h:124:15: note: in expansion of macro 'INTC_HW_DESC'
>> 124 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \
>> | ^~~~~~~~~~~~
>> arch/sh/kernel/cpu/sh4a/setup-sh7785.c:478:8: note: in expansion of macro 'DECLARE_INTC_DESC'
>> 478 | static DECLARE_INTC_DESC(intc_desc, "sh7785", vectors, groups,
>> | ^~~~~~~~~~~~~~~~~
>
> A while ago, I had a look into fixing them, but it was non-trivial.
> The issue is that the macros are sometimes used with NULL pointer arrays.
> The __same_type() check in
>
> #define _INTC_ARRAY(a) a, __same_type(a, NULL) ? 0 : sizeof(a)/sizeof(*a)
>
> is supposed to catch that, but modern compilers seem to evaluate the
> non-taken branch, too, leading to the warning.
>
> Anyone with a suggestion? (CCing the multi-compiler guru)
Ah, thanks for the explanation.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@debian.org
`. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
next prev parent reply other threads:[~2021-07-02 9:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-27 22:05 [PATCH 0/3 v2] sh: fixes for various build and kconfig warnings Randy Dunlap
2021-06-27 22:05 ` [PATCH 1/3 v2] sh: fix kconfig unmet dependency warning for FRAME_POINTER Randy Dunlap
2021-06-28 8:44 ` Geert Uytterhoeven
2021-06-30 9:32 ` John Paul Adrian Glaubitz
2021-06-27 22:05 ` [PATCH 2/3 v2] sh: define __BIG_ENDIAN for math-emu Randy Dunlap
2021-06-30 9:35 ` John Paul Adrian Glaubitz
2021-06-27 22:05 ` [PATCH 3/3 v2] sh: fix READ/WRITE redefinition warnings Randy Dunlap
2021-06-28 8:46 ` Geert Uytterhoeven
2021-06-30 9:36 ` John Paul Adrian Glaubitz
2021-06-30 9:42 ` Geert Uytterhoeven
2021-06-30 19:33 ` Randy Dunlap
2021-06-30 19:36 ` John Paul Adrian Glaubitz
2021-07-01 8:41 ` Geert Uytterhoeven
2021-07-01 11:57 ` Arnd Bergmann
2021-07-02 9:25 ` John Paul Adrian Glaubitz [this message]
2021-06-27 22:26 ` [PATCH 0/3 v2] sh: fixes for various build and kconfig warnings John Paul Adrian Glaubitz
2021-06-27 22:30 ` Randy Dunlap
2021-06-27 22:36 ` John Paul Adrian Glaubitz
2021-06-29 21:49 ` John Paul Adrian Glaubitz
2021-09-08 20:19 ` Randy Dunlap
2021-09-09 8:25 ` John Paul Adrian Glaubitz
2021-09-09 9:08 ` Daniel Palmer
2021-09-12 1:57 ` Rich Felker
2021-09-12 10:36 ` John Paul Adrian Glaubitz
2021-09-12 17:25 ` Rob Landley
2021-09-22 2:45 ` Rich Felker
2021-09-23 14:37 ` John Paul Adrian Glaubitz
2021-10-08 18:29 ` John Paul Adrian Glaubitz
2021-09-13 11:53 ` Daniel Palmer
2021-09-09 17:44 ` Rob Landley
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=85485961-4c6e-a1bc-d66a-19869b5a03f1@physik.fu-berlin.de \
--to=glaubitz@physik.fu-berlin.de \
--cc=arnd@arndb.de \
--cc=dalias@libc.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=takasi-y@ops.dti.ne.jp \
--cc=ysato@users.sourceforge.jp \
/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;
as well as URLs for NNTP newsgroup(s).