Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1564187 > unrolled thread

[PATCH] iio: industrialio-trigger: constify device_type structures

Started byBhumika Goyal <bhumirks@gmail.com>
First post2017-01-21 18:10 +0100
Last post2017-01-22 14:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] iio: industrialio-trigger: constify device_type structures Bhumika Goyal <bhumirks@gmail.com> - 2017-01-21 18:10 +0100
    Re: [PATCH] iio: industrialio-trigger: constify device_type  structures Jonathan Cameron <jic23@kernel.org> - 2017-01-22 14:20 +0100

#1564187 — [PATCH] iio: industrialio-trigger: constify device_type structures

FromBhumika Goyal <bhumirks@gmail.com>
Date2017-01-21 18:10 +0100
Subject[PATCH] iio: industrialio-trigger: constify device_type structures
Message-ID<t27kS-6B1-25@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1564397 — Re: [PATCH] iio: industrialio-trigger: constify device_type structures

FromJonathan Cameron <jic23@kernel.org>
Date2017-01-22 14:20 +0100
SubjectRe: [PATCH] iio: industrialio-trigger: constify device_type structures
Message-ID<t2qdQ-1eg-9@gated-at.bofh.it>
In reply to#1564187
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,
>  };
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web