Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

EDAC: Make device_type const

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>

authored by

Bhumika Goyal and committed by
Borislav Petkov
b2b3e736 bc8f10ba

+6 -6
+4 -4
drivers/edac/edac_mc_sysfs.c
··· 304 304 kfree(csrow); 305 305 } 306 306 307 - static struct device_type csrow_attr_type = { 307 + static const struct device_type csrow_attr_type = { 308 308 .groups = csrow_attr_groups, 309 309 .release = csrow_attr_release, 310 310 }; ··· 644 644 kfree(dimm); 645 645 } 646 646 647 - static struct device_type dimm_attr_type = { 647 + static const struct device_type dimm_attr_type = { 648 648 .groups = dimm_attr_groups, 649 649 .release = dimm_attr_release, 650 650 }; ··· 920 920 kfree(mci); 921 921 } 922 922 923 - static struct device_type mci_attr_type = { 923 + static const struct device_type mci_attr_type = { 924 924 .groups = mci_attr_groups, 925 925 .release = mci_attr_release, 926 926 }; ··· 1074 1074 kfree(dev); 1075 1075 } 1076 1076 1077 - static struct device_type mc_attr_type = { 1077 + static const struct device_type mc_attr_type = { 1078 1078 .release = mc_attr_release, 1079 1079 }; 1080 1080 /*
+2 -2
drivers/edac/i7core_edac.c
··· 1094 1094 kfree(device); 1095 1095 } 1096 1096 1097 - static struct device_type addrmatch_type = { 1097 + static const struct device_type addrmatch_type = { 1098 1098 .groups = addrmatch_groups, 1099 1099 .release = addrmatch_release, 1100 1100 }; ··· 1125 1125 kfree(device); 1126 1126 } 1127 1127 1128 - static struct device_type all_channel_counts_type = { 1128 + static const struct device_type all_channel_counts_type = { 1129 1129 .groups = all_channel_counts_groups, 1130 1130 .release = all_channel_counts_release, 1131 1131 };