mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Greg KH <gregkh@linuxfoundation.org>
Cc: Dan Williams <dan.j.williams@intel.com>,
	<rafael.j.wysocki@intel.com>, <linux-cxl@vger.kernel.org>,
	<linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Ben Cheatham <Benjamin.Cheatham@amd.com>
Subject: Re: [PATCH 3/3] ACPI: APEI: EINJ: Do not fail einj_init() on faux_device_create() failure
Date: Tue, 10 Jun 2025 10:22:20 -0700	[thread overview]
Message-ID: <684869cc8777b_249110016@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <20250609170509.00003625@huawei.com>

Jonathan Cameron wrote:
[..]
> Hmm. I did some digging. Seems that was debated 10 years ago without
> a huge amount of clarity on the answer beyond all sane people telling
> compiler folk not to use this in optimizations :)
> 
> Comes down to whether any dereference of NULL is UB whether or not
> the compiler can just do a simple offset calculation.
> 
> Anyhow, whilst fine, it's still a little ugly to my eyes :(

I recall we had this conversation with Dan Carpenter on a smatch patch
and resolved that while it looks "interesting" it does no harm.

For this patch I am not motivated to spin it because even if the the
compiler took advantage of the NULL check to drop UB work, that would
only mean dropping the assignment.

Otherwise, this conversion lines up with the intent of both
einj_initialized and faux_device_destroy() whereby faux_device_destroy()
is already prepared for the case where faux_device_create() fails.

  reply	other threads:[~2025-06-10 17:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-07  3:32 [PATCH 0/3] CXL: ACPI: faux: Fix cxl_core.ko module load regression Dan Williams
2025-06-07  3:32 ` [PATCH 1/3] driver core: faux: Suppress bind attributes Dan Williams
2025-06-09 10:19   ` Jonathan Cameron
2025-06-07  3:32 ` [PATCH 2/3] driver core: faux: Quiet probe failures Dan Williams
2025-06-09 10:19   ` Jonathan Cameron
2025-06-07  3:32 ` [PATCH 3/3] ACPI: APEI: EINJ: Do not fail einj_init() on faux_device_create() failure Dan Williams
2025-06-09 10:17   ` Jonathan Cameron
2025-06-09 10:42     ` Greg KH
2025-06-09 16:05       ` Jonathan Cameron
2025-06-10 17:22         ` Dan Williams [this message]
2025-06-09 13:28   ` Cheatham, Benjamin
2025-06-09 13:39 ` [PATCH 0/3] CXL: ACPI: faux: Fix cxl_core.ko module load regression Sudeep Holla
2025-06-09 15:04 ` Dave Jiang
2025-06-09 18:58   ` Rafael J. Wysocki
2025-06-10 10:12     ` Greg KH
2025-06-10 17:24       ` Rafael J. Wysocki

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=684869cc8777b_249110016@dwillia2-xfh.jf.intel.com.notmuch \
    --to=dan.j.williams@intel.com \
    --cc=Benjamin.Cheatham@amd.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.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

all inboxes | Powered by JetHome®