diff mbox

HID: intel-ish-hid: constify device_type structure

Message ID 1486797037-31415-1-git-send-email-bhumirks@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bhumika Goyal Feb. 11, 2017, 7:10 a.m. UTC
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 the declaration of device_type structure.

File size before: drivers/hid/intel-ish-hid/ishtp/bus.o
   text	   data	    bss	    dec	    hex	filename
   4260	    336	     16	   4612	   1204 hid/intel-ish-hid/ishtp/bus.o

File size after: drivers/hid/intel-ish-hid/ishtp/bus.o
   text	   data	    bss	    dec	    hex	filename
   4324	    272	     16	   4612	   1204 hid/intel-ish-hid/ishtp/bus.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

srinivas pandruvada Feb. 11, 2017, 9:39 a.m. UTC | #1
On Sat, 2017-02-11 at 12:40 +0530, 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 the declaration of device_type structure.
> 
> File size before: drivers/hid/intel-ish-hid/ishtp/bus.o
>    text	   data	    bss	    dec	    hex	
> filename
>    4260	    336	     16	   4612	   1204
> hid/intel-ish-hid/ishtp/bus.o
> 
> File size after: drivers/hid/intel-ish-hid/ishtp/bus.o
>    text	   data	    bss	    dec	    hex	
> filename
>    4324	    272	     16	   4612	   1204
> hid/intel-ish-hid/ishtp/bus.o
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c
> b/drivers/hid/intel-ish-hid/ishtp/bus.c
> index f4cbc74..5f382fe 100644
> --- a/drivers/hid/intel-ish-hid/ishtp/bus.c
> +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
> @@ -358,7 +358,7 @@ static void ishtp_cl_dev_release(struct device
> *dev)
>  	kfree(to_ishtp_cl_device(dev));
>  }
>  
> -static struct device_type ishtp_cl_device_type = {
> +static const struct device_type ishtp_cl_device_type = {
>  	.release	= ishtp_cl_dev_release,
>  };
>  
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Kosina Feb. 14, 2017, 2:33 p.m. UTC | #2
On Sat, 11 Feb 2017, 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 the declaration of device_type structure.
> 
> File size before: drivers/hid/intel-ish-hid/ishtp/bus.o
>    text	   data	    bss	    dec	    hex	filename
>    4260	    336	     16	   4612	   1204 hid/intel-ish-hid/ishtp/bus.o
> 
> File size after: drivers/hid/intel-ish-hid/ishtp/bus.o
>    text	   data	    bss	    dec	    hex	filename
>    4324	    272	     16	   4612	   1204 hid/intel-ish-hid/ishtp/bus.o
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>  drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
> index f4cbc74..5f382fe 100644
> --- a/drivers/hid/intel-ish-hid/ishtp/bus.c
> +++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
> @@ -358,7 +358,7 @@ static void ishtp_cl_dev_release(struct device *dev)
>  	kfree(to_ishtp_cl_device(dev));
>  }
>  
> -static struct device_type ishtp_cl_device_type = {
> +static const struct device_type ishtp_cl_device_type = {
>  	.release	= ishtp_cl_dev_release,
>  };

Applied to hid.git#for-4.11/intel-ish, thanks.
diff mbox

Patch

diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index f4cbc74..5f382fe 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -358,7 +358,7 @@  static void ishtp_cl_dev_release(struct device *dev)
 	kfree(to_ishtp_cl_device(dev));
 }
 
-static struct device_type ishtp_cl_device_type = {
+static const struct device_type ishtp_cl_device_type = {
 	.release	= ishtp_cl_dev_release,
 };