[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve6q7fkJdLjZaxGe9jKASv72eExJAGWbT8fFWEUAwgweA@mail.gmail.com>
Date: Fri, 15 Oct 2021 21:04:38 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Eugene Shalygin <eugene.shalygin@...il.com>
Cc: Denis Pauk <pauk.denis@...il.com>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
thomas@...ssschuh.net, Tor Vic <torvic9@...lbox.org>,
Oleksandr Natalenko <oleksandr@...alenko.name>,
kernel test robot <lkp@...el.com>,
Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>,
Jonathan Corbet <corbet@....net>, linux-hwmon@...r.kernel.org,
Linux Documentation List <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 1/2] hwmon: (asus_wmi_ec_sensors) Support B550 Asus WMI.
On Fri, Oct 15, 2021 at 5:49 PM Eugene Shalygin
<eugene.shalygin@...il.com> wrote:
> On Fri, 15 Oct 2021 at 16:37, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
...
> > I didn't get it. If there is a strong endianess expected the parameter
> > should be __le16 or __be16, moreover it seems it missed the const
> > qualifier. Any preparatory stuff should be done in the
> > asus_wmi_ec_make_block_read_query() which prepares the input buffer,
> > doesn't it?
>
> We need to produce and parse a, roughly speaking, hex-BSTR to pass it
> to the WMI function (save for its size parameter of 16 bits instead of
> 32 for the BSTR). bin/hex conversion functions accept/output UTF-8
> strings and thus require an intermediate buffer and additional utf-8
> <-> utf-16 conversion. Do you insist that a loop with a stride of 4 is
> a homegrown library already?
The code deserves a very good comment. And even if you want to keep
functionality, replace homegrown library calls.
...
> > > > What's the point of calling acpi_os_free(obj) when you already know it's NULL?
> > >
> > > The case when obj->type != ACPI_TYPE_BUFFER
> >
> > Read my comment again, please.
>
> I did it twice already and still can't understand. The WMI method can
> return a string, for example, which is an error for our code, but the
> buffer needs to be freed.
You cut the context, but I think I meant
if (!obj)
return -ENOMEM;
if (!obj->...) {
free();
return -EIO;
}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists