Re: [PATCH v3 1/5] ACPI / blacklist: add acpi_match_platform_list()
From: Kani, Toshimitsu
Date: Mon Aug 21 2017 - 13:24:32 EST
On Mon, 2017-08-21 at 19:04 +0200, Borislav Petkov wrote:
> On Mon, Aug 21, 2017 at 04:41:38PM +0000, Kani, Toshimitsu wrote:
> > Putting to a single line leads to "line over 80 characters" warning
> > from checkpatch.pl.ÂÂWould you still advice to do that?
>
> Yes, the 80 cols rule is not a hard one. Rather, it should be
> overridden by human good judgement, like making the code more
> readable.
I see. I will make these changes. (It's really personal preference,
but long lines of if-conditions are not so easy to read to my eyes,
though.)
> > strncmp() is fine without these, but it'd be prudent in case
> > someone decides to print these strings with printk().ÂÂWill do.
>
> Someone does already use them in printk():
>
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂpr_err(PREFIX "Vendor \"%6.6s\" System \"%8.8s\"
> Revision 0x%x has a known ACPI BIOS problem.\n",
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂacpi_blacklist[i].oem_id,
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂacpi_blacklist[i].oem_table_id,
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂacpi_blacklist[i].oem_revision);
Oh, you are right about that!
> > 'data' here is private to the caller.ÂÂSo, I do not think we need
> > to define the bits.ÂÂShall I change the name to 'driver_data' to
> > make it more explicit?
>
> You changed it to 'data'. It was a u32-used-as-boolean
> is_critical_error before.
>
> So you can just as well make it into flags and people can extend
> those flags if needed. A flag bit should be enough in most cases
> anyway. If they really need driver_data, then they can add a void *
> member.
Hmm.. In patch 2, intel_pstate_platform_pwr_mgmt_exists() uses this
field for PSS and PCC, which are enum values. I think we should allow
drivers to set any values here. I agree that it may need to be void *
if we also allow drivers to set a pointer here.
Thanks,
-Toshi