lkml.org 
[lkml]   [2021]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 3/3] hwmon: (nct6775) add MAXIMUS VII HERO.
On Wed, Nov 24, 2021 at 6:21 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Mon, Nov 22, 2021 at 11:29 PM Denis Pauk <pauk.denis@gmail.com> wrote:

...

> > + if (access == access_asuswmi &&
> > + nct6775_asuswmi_read(0, NCT6775_PORT_CHIPID, &tmp)) {
> > + access = access_direct;
> > + pr_err("Can't read ChipID by Asus WMI.\n");
> > + }
> > +
> > + if (access == access_asuswmi) {
> > + if (tmp)
> > + pr_info("Using Asus WMI to access %#x chip.\n", tmp);
> > + else
> > + access = access_direct;
>
> Why not:

> if (access == access_asuswmi) {
> access = access_direct;

Oh, just noticed above... Looks not good due to possible confusion
which means this part needs to be thought through and refactored,
perhaps by intermediate variable that defines the access and then you
assign access= to it if it satisfies the conditions.

> if (nct6775_asuswmi_read(0, NCT6775_PORT_CHIPID, &tmp))
> pr_err("Can't read ChipID by Asus WMI.\n");
> if (tmp) {
> pr_info("Using Asus WMI to access %#x chip.\n", tmp);
> access = access_...; // do you have this?
> }
> ...
> }
>
> ?


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2021-11-24 17:26    [W:0.061 / U:1.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site