public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Ira Weiny <ira.weiny@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>,
	Yazen Ghannam <yazen.ghannam@amd.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Dave Jiang <dave.jiang@intel.com>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ard Biesheuvel <ardb@kernel.org>, <linux-efi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-cxl@vger.kernel.org>
Subject: Re: [PATCH RFC v2 3/3] cxl/memdev: Register for and process CPER events
Date: Wed, 1 Nov 2023 17:35:59 +0000	[thread overview]
Message-ID: <20231101173559.0000112c@Huawei.com> (raw)
In-Reply-To: <654135c4f3e0_2e75b2949e@iweiny-mobl.notmuch>

On Tue, 31 Oct 2023 10:13:40 -0700
Ira Weiny <ira.weiny@intel.com> wrote:

> Dan Williams wrote:
> > Ira Weiny wrote:  
> > > If the firmware has configured CXL event support to be firmware first
> > > the OS can process those events through CPER records.  Matching memory
> > > devices to the CPER records can be done via the serial number which is
> > > part of the CPER record header.
> > > 
> > > Detect firmware first, register a notifier callback for each memdev, and
> > > trace events when they match a device registered.
> > > 
> > > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> > >   
> > [..]
> > 
> > The changes requested in patch2 cover all of the comments I currently
> > have on this patch, just one more cleanup below:
> >   
> > > +#define CXL_EVENT_HDR_FLAGS_REC_SEVERITY GENMASK(1, 0)
> > > +int cxl_cper_event_call(struct notifier_block *nb, unsigned long action, void *data)
> > > +{
> > > +	struct cxl_cper_notifier_data *nd = data;
> > > +	struct cxl_event_record_raw record = (struct cxl_event_record_raw) {
> > > +		.hdr.id = UUID_INIT(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
> > > +	};  
> > 
> > Just do:
> > 
> > 	struct cxl_event_record_raw record = { 0 };

FWIW (I'm in a pedantic mood), unless you care about that specific 0
= {};
equally valid.
c99

"If there are fewer initializers in a brace-enclosed list than there
are elements or members of an aggregate ...  the remainder of the
aggregate shall be initiali\ed implicitly the same as objects
that have static storage duration."

i.e. to 0.

Nothing says that fewer != 0 ;)


> > 
> > ...and the compiler will take care of the rest as initializing any field
> > automatically initializes everything else to zero.  
> 
> Not quite sure what I was thinking.
> 
> This works better but I think I can avoid needing this initialization all
> together by reworking the structures.  For now I have made the change and
> I'll see how it falls out.
> 
> Thanks,
> Ira
> 


  reply	other threads:[~2023-11-01 17:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 18:21 [PATCH RFC v2 0/3] efi/cxl-cper: Report CPER CXL component events through trace events Ira Weiny
2023-10-26 18:21 ` [PATCH RFC v2 1/3] cxl/trace: Remove uuid from event trace known events Ira Weiny
2023-10-26 20:55   ` Dan Williams
2023-10-30 16:58   ` Davidlohr Bueso
2023-10-26 18:21 ` [PATCH RFC v2 2/3] firmware/efi: Process CXL Component Events Ira Weiny
2023-10-26 21:02   ` Dan Williams
2023-10-31 16:46     ` Ira Weiny
2023-10-26 18:21 ` [PATCH RFC v2 3/3] cxl/memdev: Register for and process CPER events Ira Weiny
2023-10-26 22:56   ` Dan Williams
2023-10-31 17:13     ` Ira Weiny
2023-11-01 17:35       ` Jonathan Cameron [this message]
2023-10-30 21:03   ` Smita Koralahalli
2023-10-30 22:02     ` Dan Williams
2023-11-01  3:35     ` Ira Weiny
2023-11-01 21:59       ` Ira Weiny

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=20231101173559.0000112c@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Smita.KoralahalliChannabasappa@amd.com \
    --cc=alison.schofield@intel.com \
    --cc=ardb@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    --cc=yazen.ghannam@amd.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