public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org
Cc: linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] m68k: atari: Make Atari ROM port I/O write macros return void
Date: Sat, 21 May 2022 09:44:02 +1200	[thread overview]
Message-ID: <c2e45d59-4e0a-bf8a-e4db-ce3336fc9b05@gmail.com> (raw)
In-Reply-To: <286a1eef-e857-a31f-839b-00a4c835dfa9@roeck-us.net>

Hi Guenter,

I wish I knew of a way to fix this mess for good... suggestions would be 
welcome.

Looks like you spotted the last remaining macros without a void cast 
here, thanks.

FWIW:
Reviewed-by: Michael Schmitz <schmitzmic@gmail.com>


Am 21.05.2022 um 02:52 schrieb Guenter Roeck:
> On 5/20/22 07:32, Geert Uytterhoeven wrote:
>> The macros implementing Atari ROM port I/O writes do not cast away their
>> output, unlike similar implementations for other I/O buses.
>> When they are combined using conditional expressions in the
>> definitions of
>> outb() and friends, this triggers sparse warnings like:
>>
>>      drivers/net/appletalk/cops.c:382:17: error: incompatible types in
>> conditional expression (different base types):
>>      drivers/net/appletalk/cops.c:382:17:    unsigned char
>>      drivers/net/appletalk/cops.c:382:17:    void
>>
>> Fix this by adding casts to "void".
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Reported-by: Guenter Roeck <linux@roeck-us.net>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
>
>> ---
>> Survived m68k/allmodconfig.
>> To be queued in the m68k tree for v5.19.
>>
>> Removing the casts instead causes issues with functions propagating void
>> return values (return expression in void function), which BTW sparse
>> complains about, too.
>
> We live and learn. I didn't even know that this was valid syntax.
> I thought it might be easier to just fix that code, but coccinelle
> reports that there are hundreds of places in the kernel where this
> is done. Outch.
>
> Guenter

      parent reply	other threads:[~2022-05-20 21:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 14:32 [PATCH] m68k: atari: Make Atari ROM port I/O write macros return void Geert Uytterhoeven
2022-05-20 14:52 ` Guenter Roeck
2022-05-20 15:07   ` Geert Uytterhoeven
2022-05-20 15:52     ` Guenter Roeck
2022-05-20 21:44   ` Michael Schmitz [this message]

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=c2e45d59-4e0a-bf8a-e4db-ce3336fc9b05@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux@roeck-us.net \
    --cc=lkp@intel.com \
    /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