From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Finn Thain <fthain@linux-m68k.org>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Sascha Hauer" <kernel@pengutronix.de>,
linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH 1/5] nubus: Simplify check in remove callback
Date: Tue, 27 Jul 2021 12:07:30 +0200 [thread overview]
Message-ID: <CAMuHMdX=K4S3Yd_ybd5C3e40XefMf5kHs1tWs1+VKTgiWEWEDg@mail.gmail.com> (raw)
In-Reply-To: <d74ccd1-116d-9450-5ee4-8d5074998872@linux-m68k.org>
Hi Finn,
On Tue, Jul 27, 2021 at 11:50 AM Finn Thain <fthain@linux-m68k.org> wrote:
> On Tue, 27 Jul 2021, Uwe Kleine-König wrote:
> > Apart from that, the compiler might already assume dev->driver being
> > non-NULL after to_nubus_driver(dev->driver) was called.
>
> I don't understand how a compiler can make that assumption. But then, I
> don't know why compilers do a lot of the things they do...
It is one of those recent optimizations people have been complaining
about. Once you have dereferenced a pointer, compilers may remove
all further NULL-checks, assuming they can't happen, as the code
would have crashed anyway before due to the dereference.
Good luck running on bare metal with RAM at zero ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2021-07-27 10:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 8:08 [PATCH 0/5] Some cleanups after making bus_type::remove return void Uwe Kleine-König
2021-07-27 8:08 ` [PATCH 1/5] nubus: Simplify check in remove callback Uwe Kleine-König
2021-07-27 9:50 ` Finn Thain
2021-07-27 10:07 ` Geert Uytterhoeven [this message]
2021-07-27 10:19 ` Finn Thain
2021-07-27 11:42 ` Uwe Kleine-König
2021-07-31 10:32 ` Finn Thain
2021-07-31 12:05 ` Uwe Kleine-König
2021-07-27 8:08 ` [PATCH 2/5] nubus: Make struct nubus_driver::remove return void Uwe Kleine-König
2021-07-27 9:47 ` Finn Thain
2021-07-27 8:08 ` [PATCH 3/5] sh: superhyway: Simplify check in remove callback Uwe Kleine-König
2021-07-27 8:08 ` [PATCH 4/5] zorro: Simplify " Uwe Kleine-König
2021-07-27 8:08 ` [PATCH 5/5] zorro: Drop useless (and hardly used) .driver member in struct zorro_dev Uwe Kleine-König
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='CAMuHMdX=K4S3Yd_ybd5C3e40XefMf5kHs1tWs1+VKTgiWEWEDg@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=fthain@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=u.kleine-koenig@pengutronix.de \
/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).