EDAC: Make device_type const
authorBhumika Goyal <bhumirks@gmail.com>
Sat, 19 Aug 2017 08:22:12 +0000 (13:52 +0530)
committerBorislav Petkov <bp@suse.de>
Sun, 20 Aug 2017 11:12:32 +0000 (13:12 +0200)
Make these const as they are only stored in the type field of a device
structure, which is const.

Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/1503130946-2854-2-git-send-email-bhumirks@gmail.com
Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/edac/edac_mc_sysfs.c
drivers/edac/i7core_edac.c

index dbc64469b7da0b977d9ae497062b9925816fec31..e4fcfa84fbd3503246d144bcbcbb36747ed9171c 100644 (file)
@@ -304,7 +304,7 @@ static void csrow_attr_release(struct device *dev)
        kfree(csrow);
 }
 
-static struct device_type csrow_attr_type = {
+static const struct device_type csrow_attr_type = {
        .groups         = csrow_attr_groups,
        .release        = csrow_attr_release,
 };
@@ -644,7 +644,7 @@ static void dimm_attr_release(struct device *dev)
        kfree(dimm);
 }
 
-static struct device_type dimm_attr_type = {
+static const struct device_type dimm_attr_type = {
        .groups         = dimm_attr_groups,
        .release        = dimm_attr_release,
 };
@@ -920,7 +920,7 @@ static void mci_attr_release(struct device *dev)
        kfree(mci);
 }
 
-static struct device_type mci_attr_type = {
+static const struct device_type mci_attr_type = {
        .groups         = mci_attr_groups,
        .release        = mci_attr_release,
 };
@@ -1074,7 +1074,7 @@ static void mc_attr_release(struct device *dev)
        kfree(dev);
 }
 
-static struct device_type mc_attr_type = {
+static const struct device_type mc_attr_type = {
        .release        = mc_attr_release,
 };
 /*
index d36cc84980845cbe81703b59545350aa3e0aecf0..c16c3b931b3d0ef9cd68b01e6d81de4987d5c794 100644 (file)
@@ -1094,7 +1094,7 @@ static void addrmatch_release(struct device *device)
        kfree(device);
 }
 
-static struct device_type addrmatch_type = {
+static const struct device_type addrmatch_type = {
        .groups         = addrmatch_groups,
        .release        = addrmatch_release,
 };
@@ -1125,7 +1125,7 @@ static void all_channel_counts_release(struct device *device)
        kfree(device);
 }
 
-static struct device_type all_channel_counts_type = {
+static const struct device_type all_channel_counts_type = {
        .groups         = all_channel_counts_groups,
        .release        = all_channel_counts_release,
 };