From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>,
Linux ACPI <linux-acpi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH v1 1/1] ACPI: NFIT: Import GUID before use
Date: Fri, 16 Apr 2021 20:33:55 +0300 [thread overview]
Message-ID: <YHnKg4MHkZ4QIBHR@smile.fi.intel.com> (raw)
In-Reply-To: <CAPcyv4jzg23CoQeqAyAR=PUjB4HG-FSnD8G0J7S=p22ANmzDMQ@mail.gmail.com>
On Fri, Apr 16, 2021 at 09:15:34AM -0700, Dan Williams wrote:
> On Fri, Apr 16, 2021 at 1:58 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Fri, Apr 16, 2021 at 8:28 AM Dan Williams <dan.j.williams@intel.com> wrote:
> > > On Thu, Apr 15, 2021 at 6:59 AM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > >
> > > > Strictly speaking the comparison between guid_t and raw buffer
> > > > is not correct. Import GUID to variable of guid_t type and then
> > > > compare.
> > >
> > > Hmm, what about something like the following instead, because it adds
> > > safety. Any concerns about evaluating x twice in a macro should be
> > > alleviated by the fact that ARRAY_SIZE() will fail the build if (x) is
> > > not an array.
> >
> > ARRAY_SIZE doesn't check type.
>
> See __must_be_array.
>
> > I don't like hiding ugly casts like this.
>
> See PTR_ERR, ERR_PTR, ERR_CAST.
It's special, i.e. error pointer case. We don't handle such here.
> There's nothing broken about the way the code currently stands, so I'd
> rather try to find something to move the implementation forward than
> sideways.
Submit a patch then. I rest my case b/c I consider that ugly castings worse
than additional API call, although it's not ideal.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-04-16 17:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 13:59 [PATCH v1 1/1] ACPI: NFIT: Import GUID before use Andy Shevchenko
2021-04-16 5:17 ` Dan Williams
2021-04-16 8:58 ` Andy Shevchenko
2021-04-16 16:15 ` Dan Williams
2021-04-16 17:33 ` Andy Shevchenko [this message]
2021-04-16 18:04 ` Dan Williams
-- strict thread matches above, loose matches on Subject: below --
2021-12-13 20:46 Andy Shevchenko
2021-12-17 18:08 ` Rafael J. Wysocki
2021-12-17 18:37 ` Dan Williams
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=YHnKg4MHkZ4QIBHR@smile.fi.intel.com \
--to=andy.shevchenko@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=ira.weiny@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=rjw@rjwysocki.net \
--cc=vishal.l.verma@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).