2017-07-06 16:21:10

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH] staging: atomisp: gc0310: constify acpi_device_id.

acpi_device_id are not supposed to change at runtime. All functions
working with acpi_device_id provided by <acpi/acpi_bus.h> work with
const acpi_device_id. So mark the non-const structs as const.

File size before:
text data bss dec hex filename
10297 1888 0 12185 2f99 drivers/staging/media/atomisp/i2c/gc0310.o

File size After adding 'const':
text data bss dec hex filename
10361 1824 0 12185 2f99 drivers/staging/media/atomisp/i2c/gc0310.o

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/staging/media/atomisp/i2c/gc0310.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/i2c/gc0310.c b/drivers/staging/media/atomisp/i2c/gc0310.c
index 1ec616a..c8162bb 100644
--- a/drivers/staging/media/atomisp/i2c/gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/gc0310.c
@@ -1453,7 +1453,7 @@ static int gc0310_probe(struct i2c_client *client,
return ret;
}

-static struct acpi_device_id gc0310_acpi_match[] = {
+static const struct acpi_device_id gc0310_acpi_match[] = {
{"XXGC0310"},
{},
};
--
2.7.4


2017-07-07 10:47:50

by Alan

[permalink] [raw]
Subject: Re: [PATCH] staging: atomisp: gc0310: constify acpi_device_id.

On Thu, 2017-07-06 at 21:50 +0530, Arvind Yadav wrote:
> acpi_device_id are not supposed to change at runtime. All functions
> working with acpi_device_id provided by <acpi/acpi_bus.h> work with
> const acpi_device_id. So mark the non-const structs as const.
>
> File size before:
>    text    data     bss     dec     hex
> filename
>   10297    1888       0   12185    2f99
> drivers/staging/media/atomisp/i2c/gc0310.o
>
> File size After adding 'const':
>    text    data     bss     dec     hex
> filename
>   10361    1824       0   12185    2f99
> drivers/staging/media/atomisp/i2c/gc0310.o
>
> Signed-off-by: Arvind Yadav <[email protected]>
> ---
>  drivers/staging/media/atomisp/i2c/gc0310.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/atomisp/i2c/gc0310.c
> b/drivers/staging/media/atomisp/i2c/gc0310.c
> index 1ec616a..c8162bb 100644
> --- a/drivers/staging/media/atomisp/i2c/gc0310.c
> +++ b/drivers/staging/media/atomisp/i2c/gc0310.c
> @@ -1453,7 +1453,7 @@ static int gc0310_probe(struct i2c_client
> *client,
>   return ret;
>  }
>  
> -static struct acpi_device_id gc0310_acpi_match[] = {
> +static const struct acpi_device_id gc0310_acpi_match[] = {
>   {"XXGC0310"},
>   {},
>  };

(All four)

Acked-by: Alan Cox <[email protected]>

2017-07-08 22:34:20

by Sakari Ailus

[permalink] [raw]
Subject: Re: [PATCH] staging: atomisp: gc0310: constify acpi_device_id.

On Fri, Jul 07, 2017 at 11:47:43AM +0100, Alan Cox wrote:
> On Thu, 2017-07-06 at 21:50 +0530, Arvind Yadav wrote:
> > acpi_device_id are not supposed to change at runtime. All functions
> > working with acpi_device_id provided by <acpi/acpi_bus.h> work with
> > const acpi_device_id. So mark the non-const structs as const.
> >
> > File size before:
> > ???text ???data ????bss ????dec ????hex
> > filename
> > ? 10297 ???1888 ??????0 ??12185 ???2f99
> > drivers/staging/media/atomisp/i2c/gc0310.o
> >
> > File size After adding 'const':
> > ???text ???data ????bss ????dec ????hex
> > filename
> > ? 10361 ???1824 ??????0 ??12185 ???2f99
> > drivers/staging/media/atomisp/i2c/gc0310.o
> >
> > Signed-off-by: Arvind Yadav <[email protected]>
> > ---
> > ?drivers/staging/media/atomisp/i2c/gc0310.c | 2 +-
> > ?1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/media/atomisp/i2c/gc0310.c
> > b/drivers/staging/media/atomisp/i2c/gc0310.c
> > index 1ec616a..c8162bb 100644
> > --- a/drivers/staging/media/atomisp/i2c/gc0310.c
> > +++ b/drivers/staging/media/atomisp/i2c/gc0310.c
> > @@ -1453,7 +1453,7 @@ static int gc0310_probe(struct i2c_client
> > *client,
> > ? return ret;
> > ?}
> > ?
> > -static struct acpi_device_id gc0310_acpi_match[] = {
> > +static const struct acpi_device_id gc0310_acpi_match[] = {
> > ? {"XXGC0310"},
> > ? {},
> > ?};
>
> (All four)
>
> Acked-by: Alan Cox <[email protected]>

There's four more... I've applied all to my atomisp branch.

Arvind: please send the patches as a single set next time.

--
Regards,

Sakari Ailus
e-mail: [email protected] XMPP: [email protected]