LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Denis Pauk <pauk.denis@gmail.com>
Cc: Eugene Shalygin <eugene.shalygin@gmail.com>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	thomas@weissschuh.net, Olli Asikainen <olli.asikainen@gmail.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] hwmon: (nct6775) add MAXIMUS VII HERO.
Date: Wed, 24 Nov 2021 18:24:51 +0200	[thread overview]
Message-ID: <CAHp75Vdr+9zoWG74d0ZfGEjj_b1xkX7gw1ka_4NkGtjmvKB73A@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VeKosontsmFJSp-fbV9mPiSWJeLUCpx90=RHy1HFfBDnA@mail.gmail.com>

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

      reply	other threads:[~2021-11-24 16:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 21:28 [PATCH 0/3] hwmon: (nct6775) Support lock by ACPI mutex Denis Pauk
2021-11-22 21:28 ` [PATCH 1/3] hwmon: (nct6775) Use nct6775_*() lock function pointers in nct6775_data Denis Pauk
2021-11-24 16:03   ` Andy Shevchenko
2021-11-25 21:07     ` Denis Pauk
2021-11-25 21:50       ` Andy Shevchenko
2021-11-22 21:28 ` [PATCH 2/3] hwmon: (nct6775) Implement custom lock by ACPI mutex Denis Pauk
2021-11-24 16:10   ` Andy Shevchenko
2021-11-25 13:14     ` Eugene Shalygin
2021-11-25 13:16       ` Eugene Shalygin
2021-11-25 13:51       ` Guenter Roeck
2021-11-25 13:54         ` Eugene Shalygin
2021-11-25 13:51       ` Andy Shevchenko
2021-11-25 14:00         ` Eugene Shalygin
2021-11-25 19:54           ` Guenter Roeck
2021-11-25 20:05             ` Eugene Shalygin
2021-11-25 20:09               ` Andy Shevchenko
2021-11-25 20:25                 ` Denis Pauk
2021-11-25 20:33                   ` Eugene Shalygin
2021-11-25 21:52                     ` Andy Shevchenko
2021-11-25 20:28                 ` Eugene Shalygin
2021-11-22 21:28 ` [PATCH 3/3] hwmon: (nct6775) add MAXIMUS VII HERO Denis Pauk
2021-11-24 16:21   ` Andy Shevchenko
2021-11-24 16:24     ` Andy Shevchenko [this message]

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=CAHp75Vdr+9zoWG74d0ZfGEjj_b1xkX7gw1ka_4NkGtjmvKB73A@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=eugene.shalygin@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=olli.asikainen@gmail.com \
    --cc=pauk.denis@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=thomas@weissschuh.net \
    /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 NNTP newsgroup(s).