lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6531d18eb13c4_7258329435@dwillia2-xfh.jf.intel.com.notmuch>
Date:   Thu, 19 Oct 2023 18:02:06 -0700
From:   Dan Williams <dan.j.williams@...el.com>
To:     "Wilczynski, Michal" <michal.wilczynski@...el.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        <nvdimm@...ts.linux.dev>, <linux-acpi@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC:     Dan Williams <dan.j.williams@...el.com>,
        Vishal Verma <vishal.l.verma@...el.com>,
        Dave Jiang <dave.jiang@...el.com>,
        Ira Weiny <ira.weiny@...el.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>
Subject: Re: [PATCH v1 1/1] ACPI: NFIT: Switch to use
 acpi_evaluate_dsm_typed()

Wilczynski, Michal wrote:
> 
> 
> On 10/2/2023 3:54 PM, Andy Shevchenko wrote:
> > The acpi_evaluate_dsm_typed() provides a way to check the type of the
> > object evaluated by _DSM call. Use it instead of open coded variant.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > ---
> >  drivers/acpi/nfit/core.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> > index f96bf32cd368..280da408c02c 100644
> > --- a/drivers/acpi/nfit/core.c
> > +++ b/drivers/acpi/nfit/core.c
> > @@ -1737,9 +1737,8 @@ __weak void nfit_intel_shutdown_status(struct nfit_mem *nfit_mem)
> >  	if ((nfit_mem->dsm_mask & (1 << func)) == 0)
> >  		return;
> >  
> > -	out_obj = acpi_evaluate_dsm(handle, guid, revid, func, &in_obj);
> > -	if (!out_obj || out_obj->type != ACPI_TYPE_BUFFER
> > -			|| out_obj->buffer.length < sizeof(smart)) {
> > +	out_obj = acpi_evaluate_dsm_typed(handle, guid, revid, func, &in_obj, ACPI_TYPE_BUFFER);
> 
> This line is 90 characters long, wouldn't it be better to split it ?

100 characters is allowed these days.

> > +	if (!out_obj || out_obj->buffer.length < sizeof(smart)) {
> >  		dev_dbg(dev->parent, "%s: failed to retrieve initial health\n",
> >  				dev_name(dev));
> 
> While at it maybe fix alignment ? :-)

Life is too short to fiddle with indentation. For old code leave it
alone, for new code just use clang-format.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ