Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constify AcpiGetHandle pathname argument #773

Merged
merged 1 commit into from
Feb 7, 2023
Merged

Conversation

s-ailus
Copy link

@s-ailus s-ailus commented May 6, 2022

Hello,

This pull request contains a single patch, constifying the pathname argument to AcpiGetHandle. The objective is to allow passing a const pathname to the function, in order to avoid having to make a copy of it. This isn't needed by acpica per se, but by another caller in Linux.

It's the first time I'm using Github to do this, let's see how this works...

  • Sakari

AcpiGetHandle doesn't write to the pathname argument, therefore make it
const.

This allows later on passing pathname to AcpiGetHandle which is const,
without creating a copy of it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
@acpibob
Copy link
Contributor

acpibob commented Aug 18, 2022

I'm worried that there are lots of these sprinkled throughout ACPICA - and this fix could open the door to lots of changes.

@s-ailus
Copy link
Author

s-ailus commented Aug 18, 2022 via email

@s-ailus
Copy link
Author

s-ailus commented Sep 5, 2022 via email

@rafaeljw
Copy link
Contributor

I'm worried that there are lots of these sprinkled throughout ACPICA - and this fix could open the door to lots of changes.

Do you think that people will try to annotate pathname pointers all over with const? Or something else?

@acpibob
Copy link
Contributor

acpibob commented Oct 13, 2022 via email

@rafaeljw
Copy link
Contributor

I don't see a problem with AcpiGetHandle() in particular TBH and the other cases can be considered individually IMO.

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Dec 20, 2022
acpi_get_handle() uses the pathname argument to find a handle related to
that pathname but it does not need to modify it. Make it const, in order
to be able to pass const pathname to it.

Cc: "Moore, Robert" <robert.moore@intel.com>
Link: acpica/acpica#773
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
@acpibob acpibob merged commit 77c5502 into acpica:master Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants