Re: [PATCH v3 1/2] [sony-laptop] SNC calls should handle BUFFER types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 6, 2020 at 3:16 PM <malattia@xxxxxxxx> wrote:
>
> From: Mattia Dongili <malattia@xxxxxxxx>
>
> After commit 6d232b29cfce ("ACPICA: Dispatcher: always generate buffer
> objects for ASL create_field() operator") ACPICA creates buffers even
> when new fields are small enough to fit into an integer.
> Many SNC calls counted on the old behaviour.
> Since sony-laptop already handles the INTEGER/BUFFER case in
> sony_nc_buffer_call, switch sony_nc_int_call to use its more generic
> function instead.

Thank you for an update.

...

The patches require prefix, "platform/x86: sony-laptop: ".
I fixed it for now.

...

> +               // do nothing

Use C99 comment style, please.

...

> +static int sony_nc_int_call(acpi_handle handle, char *name, int *value, int
> +               *result)
> +{

> +       if (result)
> +               *result = 0;

I didn't get this part. Does it mean we always have to reset result?
Sounds like a design issue (usual pattern is to ignore output in case
of error by caller and to avoid touching output by callee)

> +       return sony_nc_buffer_call(handle, name, (u64 *)value, result,
> +                       sizeof(*result));

Oh, this way for troubles. You supply pointer to int and force it to
be u64. Not good. See how above function has been implemented in this
sense.

> +}

--
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux