linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: industrialio-trigger: constify device_type structures
@ 2017-01-21 16:59 Bhumika Goyal
  2017-01-22 13:17 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Bhumika Goyal @ 2017-01-21 16:59 UTC (permalink / raw)
  To: julia.lawall, jic23, knaack.h, lars, pmeerw, linux-iio, linux-kernel
  Cc: Bhumika Goyal

Declare device_type structure as const as it is only stored in the
type field of a device structure. This field is of type const, so add
const to declaration of device_type structure.

File size before:
   text	   data	    bss	    dec	    hex	filename
   5389	    208	     48	   5645	   160d	iio/industrialio-trigger.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   5453	    176	     48	   5677	   162d	iio/industrialio-trigger.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/iio/industrialio-trigger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 978729f..3257f0e 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -487,7 +487,7 @@ static void iio_trig_release(struct device *device)
 	kfree(trig);
 }
 
-static struct device_type iio_trig_type = {
+static const struct device_type iio_trig_type = {
 	.release = iio_trig_release,
 	.groups = iio_trig_dev_groups,
 };
-- 
2.7.4

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

* Re: [PATCH] iio: industrialio-trigger: constify device_type structures
  2017-01-21 16:59 [PATCH] iio: industrialio-trigger: constify device_type structures Bhumika Goyal
@ 2017-01-22 13:17 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-01-22 13:17 UTC (permalink / raw)
  To: Bhumika Goyal, julia.lawall, knaack.h, lars, pmeerw, linux-iio,
	linux-kernel

On 21/01/17 16:59, Bhumika Goyal wrote:
> Declare device_type structure as const as it is only stored in the
> type field of a device structure. This field is of type const, so add
> const to declaration of device_type structure.
> 
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>    5389	    208	     48	   5645	   160d	iio/industrialio-trigger.o
> 
> File size after:
>    text	   data	    bss	    dec	    hex	filename
>    5453	    176	     48	   5677	   162d	iio/industrialio-trigger.o
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Makes sense.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/industrialio-trigger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
> index 978729f..3257f0e 100644
> --- a/drivers/iio/industrialio-trigger.c
> +++ b/drivers/iio/industrialio-trigger.c
> @@ -487,7 +487,7 @@ static void iio_trig_release(struct device *device)
>  	kfree(trig);
>  }
>  
> -static struct device_type iio_trig_type = {
> +static const struct device_type iio_trig_type = {
>  	.release = iio_trig_release,
>  	.groups = iio_trig_dev_groups,
>  };
> 

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

end of thread, other threads:[~2017-01-22 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-21 16:59 [PATCH] iio: industrialio-trigger: constify device_type structures Bhumika Goyal
2017-01-22 13:17 ` Jonathan Cameron

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).