tpmdd-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm: tpm_crb: constify acpi_device_id.
@ 2017-07-06 17:48 Arvind Yadav
  2017-07-09  7:05 ` Jarkko Sakkinen
       [not found] ` <8a670ac215126b76d72861319a0d45e17759ad66.1499363107.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-07-06 17:48 UTC (permalink / raw)
  To: peterhuewe, tpmdd, jarkko.sakkinen, jgunthorpe; +Cc: tpmdd-devel, linux-kernel

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
   4198	    608	      0	   4806	   12c6	drivers/char/tpm/tpm_crb.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   4262	    520	      0	   4782	   12ae	drivers/char/tpm/tpm_crb.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index b917b9d..bf7189e 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -665,7 +665,7 @@ static const struct dev_pm_ops crb_pm = {
 	SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL)
 };
 
-static struct acpi_device_id crb_device_ids[] = {
+static const struct acpi_device_id crb_device_ids[] = {
 	{"MSFT0101", 0},
 	{"", 0},
 };
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tpm: tpm_crb: constify acpi_device_id.
  2017-07-06 17:48 [PATCH] tpm: tpm_crb: constify acpi_device_id Arvind Yadav
@ 2017-07-09  7:05 ` Jarkko Sakkinen
       [not found] ` <8a670ac215126b76d72861319a0d45e17759ad66.1499363107.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Jarkko Sakkinen @ 2017-07-09  7:05 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: peterhuewe, tpmdd, jgunthorpe, tpmdd-devel, linux-kernel

On Thu, Jul 06, 2017 at 11:18:39PM +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
>    4198	    608	      0	   4806	   12c6	drivers/char/tpm/tpm_crb.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>    4262	    520	      0	   4782	   12ae	drivers/char/tpm/tpm_crb.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Thanks!

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko

> ---
>  drivers/char/tpm/tpm_crb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> index b917b9d..bf7189e 100644
> --- a/drivers/char/tpm/tpm_crb.c
> +++ b/drivers/char/tpm/tpm_crb.c
> @@ -665,7 +665,7 @@ static const struct dev_pm_ops crb_pm = {
>  	SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL)
>  };
>  
> -static struct acpi_device_id crb_device_ids[] = {
> +static const struct acpi_device_id crb_device_ids[] = {
>  	{"MSFT0101", 0},
>  	{"", 0},
>  };
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tpm: tpm_crb: constify acpi_device_id.
       [not found] ` <8a670ac215126b76d72861319a0d45e17759ad66.1499363107.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-07-16 11:24   ` Jarkko Sakkinen
  0 siblings, 0 replies; 3+ messages in thread
From: Jarkko Sakkinen @ 2017-07-16 11:24 UTC (permalink / raw)
  To: Arvind Yadav, peterhuewe-Mmb7MZpHnFY,
	tpmdd-yWjUBOtONefk1uMJSBkQmQ,
	jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/
  Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Thu, 2017-07-06 at 23:18 +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
>    4198	    608	      0	   4806	   12c6	drivers/char/tpm/tpm_crb.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>    4262	    520	      0	   4782	   12ae	drivers/char/tpm/tpm_crb.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/char/tpm/tpm_crb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> index b917b9d..bf7189e 100644
> --- a/drivers/char/tpm/tpm_crb.c
> +++ b/drivers/char/tpm/tpm_crb.c
> @@ -665,7 +665,7 @@ static const struct dev_pm_ops crb_pm = {
>  	SET_RUNTIME_PM_OPS(crb_pm_runtime_suspend, crb_pm_runtime_resume, NULL)
>  };
>  
> -static struct acpi_device_id crb_device_ids[] = {
> +static const struct acpi_device_id crb_device_ids[] = {
>  	{"MSFT0101", 0},
>  	{"", 0},
>  };

Applied.

/Jarkko

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-16 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-06 17:48 [PATCH] tpm: tpm_crb: constify acpi_device_id Arvind Yadav
2017-07-09  7:05 ` Jarkko Sakkinen
     [not found] ` <8a670ac215126b76d72861319a0d45e17759ad66.1499363107.git.arvind.yadav.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-16 11:24   ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).