diff mbox series

[v3,05/11] power: supply: core: allow to constify property lists

Message ID 1ebdfa76e2912c579c3c45fe86dbbedac6824167.1585944770.git.mirq-linux@rere.qmqm.pl (mailing list archive)
State Not Applicable, archived
Headers show
Series extensions and fixes | expand

Commit Message

Michał Mirosław April 3, 2020, 8:20 p.m. UTC
Since tables pointed to by power_supply_desc->properties and
->usb_types are not expected to change after registration, mark
the pointers accordingly

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 include/linux/power_supply.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Sebastian Reichel May 1, 2020, 12:36 p.m. UTC | #1
Hi,

On Fri, Apr 03, 2020 at 10:20:32PM +0200, Michał Mirosław wrote:
> Since tables pointed to by power_supply_desc->properties and
> ->usb_types are not expected to change after registration, mark
> the pointers accordingly
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

Thanks, queued.

-- Sebastian

>  include/linux/power_supply.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index dcd5a71e6c67..6a34df65d4d1 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -223,9 +223,9 @@ struct power_supply_config {
>  struct power_supply_desc {
>  	const char *name;
>  	enum power_supply_type type;
> -	enum power_supply_usb_type *usb_types;
> +	const enum power_supply_usb_type *usb_types;
>  	size_t num_usb_types;
> -	enum power_supply_property *properties;
> +	const enum power_supply_property *properties;
>  	size_t num_properties;
>  
>  	/*
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index dcd5a71e6c67..6a34df65d4d1 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -223,9 +223,9 @@  struct power_supply_config {
 struct power_supply_desc {
 	const char *name;
 	enum power_supply_type type;
-	enum power_supply_usb_type *usb_types;
+	const enum power_supply_usb_type *usb_types;
 	size_t num_usb_types;
-	enum power_supply_property *properties;
+	const enum power_supply_property *properties;
 	size_t num_properties;
 
 	/*