HID: intel-ish-hid: constify device_type structure
Subsystems (2)
PATCH 1/1 HID: intel-ish-hid: constify device_type structure
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
--- drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/intel-ish-hid/ishtp/bus.c +1 -1
@@ -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, };
Signature · 1 line
1.9.1
Quoted 10 lines · Bhumika Goyal
Declare
device_typestructure 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 ofdevice_typestructure.File size before:
drivers/hid/intel-ish-hid/ishtp/bus.o
text data bss dec hex
filename
4260 336 16 4612 1204hid/intel-ish-hid/ishtp/bus.o
Quoted 7 lines
File size after:
drivers/hid/intel-ish-hid/ishtp/bus.o
text data bss dec hex
filename
4324 272 16 4612 1204hid/intel-ish-hid/ishtp/bus.oSigned-off-by Bhumika Goyal <[email protected]>
Quoted 19 lines
---
drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/hid/intel-ish-hid/ishtp/bus.c +0
-0@@ -358,7 +358,7 @@ static void ishtp_cl_dev_release(struct device *dev) kfree(to_ishtp_cl_device(dev)); }drivers/hid/intel-ish-hid/ishtp/bus.c +1
-1-static struct device_type ishtp_cl_device_type = { +static const struct device_type ishtp_cl_device_type = {.release =
ishtp_cl_dev_release,
};
Quoted 22 lines · Bhumika Goyal
Declare
device_typestructure 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 ofdevice_typestructure.File size before:
drivers/hid/intel-ish-hid/ishtp/bus.o
text data bss dec hex filename
4260 336 16 4612 1204hid/intel-ish-hid/ishtp/bus.oFile size after:
drivers/hid/intel-ish-hid/ishtp/bus.o
text data bss dec hex filename
4324 272 16 4612 1204hid/intel-ish-hid/ishtp/bus.oSigned-off-by Bhumika Goyal <[email protected]>--- drivers/hid/intel-ish-hid/ishtp/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hid/intel-ish-hid/ishtp/bus.c +0
-0
drivers/hid/intel-ish-hid/ishtp/bus.c static void ishtp_cl_dev_release(struct device *dev) · line 363
Quoted 7 lines
drivers/hid/intel-ish-hid/ishtp/bus.c +1
-1@@ -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.
Signature · 2 lines
Jiri Kosina SUSE Labs