Re: [PATCH v10 05/14] platform/x86: alienware-wmi: Refactor hdmi, amplifier, deepslp methods

From: Andy Shevchenko
Date: Tue Feb 11 2025 - 13:55:38 EST


On Tue, Feb 11, 2025 at 12:51:59PM -0500, Kurt Borja wrote:
> On Tue Feb 11, 2025 at 11:37 AM -05, Andy Shevchenko wrote:
> > On Fri, Feb 07, 2025 at 10:46:01AM -0500, Kurt Borja wrote:

...

> >> + pr_err("alienware-wmi: unknown HDMI cable status: %d\n", ret);
> >
> > Rather introduce pr_fmt() and drop all these prefixes.
>
> This was not introduced by me so it probably requires a different patch.

Sure, it's just a side note comment.

...

> >> + if (!ret) {
> >
> > Traditional patter is to check for errors:
>
> I wanted to change as little as possible the original function, as in my
> opinion this would require a different patch.

Why? This change touches the lines, it's still needs careful checking despite
changes in it. But I can understand your line of thinking here. So, then
consider separate patch.

> >
> > if (ret) {
> > ...do error handling...
> > }
> >
> >> if (out_data == 1)
> >> return sysfs_emit(buf, "[input] gpu unknown\n");
> >
> >> else if (out_data == 2)
> >
> > Redundant 'else'.
> >
> >> return sysfs_emit(buf, "input [gpu] unknown\n");
> >> }
> >> - pr_err("alienware-wmi: unknown HDMI source status: %u\n", status);
> >> +
> >> + pr_err("alienware-wmi: unknown HDMI source status: %u\n", ret);
> >> return sysfs_emit(buf, "input gpu [unknown]\n");

--
With Best Regards,
Andy Shevchenko