]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Input: constify device_type structures
authorBhumika Goyal <bhumirks@gmail.com>
Tue, 24 Jan 2017 18:33:55 +0000 (10:33 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 24 Jan 2017 20:38:49 +0000 (12:38 -0800)
Declare device_type structures as const as they are only stored in the
type field of a device structure. This field is of type const, so add
const to declaration of device_type structures.

File size before:
   text    data     bss     dec     hex filename
  17184    1344      80   18608    48b0 drivers/input/input.o

File size after:
   text    data     bss     dec     hex filename
  17248    1280      80   18608    48b0 drivers/input/input.o

File size before:
   text    data     bss     dec     hex filename
   2355     384       8    2747     abb drivers/input/rmi4/rmi_bus.o

File size after:
   text    data     bss     dec     hex filename
   2483     264       8    2755     ac3 drivers/input/rmi4/rmi_bus.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/input.c
drivers/input/rmi4/rmi_bus.c

index d95c34ee5dc1430f5664e8b50d449f01c802ae4a..6a75bb08b9ffb72e3fab4df2ee7fef91f56c9bc4 100644 (file)
@@ -1749,7 +1749,7 @@ static const struct dev_pm_ops input_dev_pm_ops = {
 };
 #endif /* CONFIG_PM */
 
-static struct device_type input_dev_type = {
+static const struct device_type input_dev_type = {
        .groups         = input_dev_attr_groups,
        .release        = input_dev_release,
        .uevent         = input_dev_uevent,
index 1c40d94ca506cceb776798cb8db1444e36824ffc..213e3189f74ca8a2fdc30bf842ba27a277475bba 100644 (file)
@@ -55,7 +55,7 @@ static void rmi_release_device(struct device *dev)
        kfree(rmi_dev);
 }
 
-static struct device_type rmi_device_type = {
+static const struct device_type rmi_device_type = {
        .name           = "rmi4_sensor",
        .release        = rmi_release_device,
 };
@@ -134,7 +134,7 @@ static void rmi_release_function(struct device *dev)
        kfree(fn);
 }
 
-static struct device_type rmi_function_type = {
+static const struct device_type rmi_function_type = {
        .name           = "rmi4_function",
        .release        = rmi_release_function,
 };