[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9cbb34b0-d6be-fbba-9992-9b6939018e5d@linux.com>
Date: Mon, 19 Aug 2019 19:16:53 +0300
From: Denis Efremov <efremov@...ux.com>
To: sathyanarayanan kuppuswamy
<sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>,
Lukas Wunner <lukas@...ner.de>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/4] PCI: pciehp: Add pciehp_set_indicators() to
jointly set LED indicators
Hi,
On 8/19/19 7:06 PM, Denis Efremov wrote:
> + switch (pwr) {
> + case PCI_EXP_SLTCTL_PWR_IND_ON:
> + case PCI_EXP_SLTCTL_PWR_IND_BLINK:
> + case PCI_EXP_SLTCTL_PWR_IND_OFF:
> + cmd |= pwr;
> + mask |= PCI_EXP_SLTCTL_PIC;
> + }
> +
On 8/12/19 11:25 AM, sathyanarayanan kuppuswamy wrote:
> Do we need to switch case here ? if (pwr > 0) {} should work right ?
I saved the switch here from v2. I think switch makes the inputs check more
precise and filters-out all non-valid values. Maybe this check is too strict?
We could use mask here ON|OFF|BLINK for the check, but I don't know how hardware
will handle a case, for example, pwr == ON|BLINK.
Thanks,
Denis
Powered by blists - more mailing lists