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

mfd: wm8xxx-core: Constify static struct resource

Constify a number of static struct resource. The only usage of the
structs are to assign their address to the resources field in the
mfd_cell struct. This allows the compiler to put them in read-only
memory. Done with the help of Coccinelle.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Rikard Falkeborn and committed by
Lee Jones
f977284a 0aefed0e

+28 -28
+26 -26
drivers/mfd/wm831x-core.c
··· 616 616 } 617 617 EXPORT_SYMBOL_GPL(wm831x_set_bits); 618 618 619 - static struct resource wm831x_dcdc1_resources[] = { 619 + static const struct resource wm831x_dcdc1_resources[] = { 620 620 { 621 621 .start = WM831X_DC1_CONTROL_1, 622 622 .end = WM831X_DC1_DVS_CONTROL, ··· 637 637 }; 638 638 639 639 640 - static struct resource wm831x_dcdc2_resources[] = { 640 + static const struct resource wm831x_dcdc2_resources[] = { 641 641 { 642 642 .start = WM831X_DC2_CONTROL_1, 643 643 .end = WM831X_DC2_DVS_CONTROL, ··· 657 657 }, 658 658 }; 659 659 660 - static struct resource wm831x_dcdc3_resources[] = { 660 + static const struct resource wm831x_dcdc3_resources[] = { 661 661 { 662 662 .start = WM831X_DC3_CONTROL_1, 663 663 .end = WM831X_DC3_SLEEP_CONTROL, ··· 671 671 }, 672 672 }; 673 673 674 - static struct resource wm831x_dcdc4_resources[] = { 674 + static const struct resource wm831x_dcdc4_resources[] = { 675 675 { 676 676 .start = WM831X_DC4_CONTROL, 677 677 .end = WM831X_DC4_SLEEP_CONTROL, ··· 685 685 }, 686 686 }; 687 687 688 - static struct resource wm8320_dcdc4_buck_resources[] = { 688 + static const struct resource wm8320_dcdc4_buck_resources[] = { 689 689 { 690 690 .start = WM831X_DC4_CONTROL, 691 691 .end = WM832X_DC4_SLEEP_CONTROL, ··· 699 699 }, 700 700 }; 701 701 702 - static struct resource wm831x_gpio_resources[] = { 702 + static const struct resource wm831x_gpio_resources[] = { 703 703 { 704 704 .start = WM831X_IRQ_GPIO_1, 705 705 .end = WM831X_IRQ_GPIO_16, ··· 707 707 }, 708 708 }; 709 709 710 - static struct resource wm831x_isink1_resources[] = { 710 + static const struct resource wm831x_isink1_resources[] = { 711 711 { 712 712 .start = WM831X_CURRENT_SINK_1, 713 713 .end = WM831X_CURRENT_SINK_1, ··· 720 720 }, 721 721 }; 722 722 723 - static struct resource wm831x_isink2_resources[] = { 723 + static const struct resource wm831x_isink2_resources[] = { 724 724 { 725 725 .start = WM831X_CURRENT_SINK_2, 726 726 .end = WM831X_CURRENT_SINK_2, ··· 733 733 }, 734 734 }; 735 735 736 - static struct resource wm831x_ldo1_resources[] = { 736 + static const struct resource wm831x_ldo1_resources[] = { 737 737 { 738 738 .start = WM831X_LDO1_CONTROL, 739 739 .end = WM831X_LDO1_SLEEP_CONTROL, ··· 747 747 }, 748 748 }; 749 749 750 - static struct resource wm831x_ldo2_resources[] = { 750 + static const struct resource wm831x_ldo2_resources[] = { 751 751 { 752 752 .start = WM831X_LDO2_CONTROL, 753 753 .end = WM831X_LDO2_SLEEP_CONTROL, ··· 761 761 }, 762 762 }; 763 763 764 - static struct resource wm831x_ldo3_resources[] = { 764 + static const struct resource wm831x_ldo3_resources[] = { 765 765 { 766 766 .start = WM831X_LDO3_CONTROL, 767 767 .end = WM831X_LDO3_SLEEP_CONTROL, ··· 775 775 }, 776 776 }; 777 777 778 - static struct resource wm831x_ldo4_resources[] = { 778 + static const struct resource wm831x_ldo4_resources[] = { 779 779 { 780 780 .start = WM831X_LDO4_CONTROL, 781 781 .end = WM831X_LDO4_SLEEP_CONTROL, ··· 789 789 }, 790 790 }; 791 791 792 - static struct resource wm831x_ldo5_resources[] = { 792 + static const struct resource wm831x_ldo5_resources[] = { 793 793 { 794 794 .start = WM831X_LDO5_CONTROL, 795 795 .end = WM831X_LDO5_SLEEP_CONTROL, ··· 803 803 }, 804 804 }; 805 805 806 - static struct resource wm831x_ldo6_resources[] = { 806 + static const struct resource wm831x_ldo6_resources[] = { 807 807 { 808 808 .start = WM831X_LDO6_CONTROL, 809 809 .end = WM831X_LDO6_SLEEP_CONTROL, ··· 817 817 }, 818 818 }; 819 819 820 - static struct resource wm831x_ldo7_resources[] = { 820 + static const struct resource wm831x_ldo7_resources[] = { 821 821 { 822 822 .start = WM831X_LDO7_CONTROL, 823 823 .end = WM831X_LDO7_SLEEP_CONTROL, ··· 831 831 }, 832 832 }; 833 833 834 - static struct resource wm831x_ldo8_resources[] = { 834 + static const struct resource wm831x_ldo8_resources[] = { 835 835 { 836 836 .start = WM831X_LDO8_CONTROL, 837 837 .end = WM831X_LDO8_SLEEP_CONTROL, ··· 845 845 }, 846 846 }; 847 847 848 - static struct resource wm831x_ldo9_resources[] = { 848 + static const struct resource wm831x_ldo9_resources[] = { 849 849 { 850 850 .start = WM831X_LDO9_CONTROL, 851 851 .end = WM831X_LDO9_SLEEP_CONTROL, ··· 859 859 }, 860 860 }; 861 861 862 - static struct resource wm831x_ldo10_resources[] = { 862 + static const struct resource wm831x_ldo10_resources[] = { 863 863 { 864 864 .start = WM831X_LDO10_CONTROL, 865 865 .end = WM831X_LDO10_SLEEP_CONTROL, ··· 873 873 }, 874 874 }; 875 875 876 - static struct resource wm831x_ldo11_resources[] = { 876 + static const struct resource wm831x_ldo11_resources[] = { 877 877 { 878 878 .start = WM831X_LDO11_ON_CONTROL, 879 879 .end = WM831X_LDO11_SLEEP_CONTROL, ··· 881 881 }, 882 882 }; 883 883 884 - static struct resource wm831x_on_resources[] = { 884 + static const struct resource wm831x_on_resources[] = { 885 885 { 886 886 .start = WM831X_IRQ_ON, 887 887 .end = WM831X_IRQ_ON, ··· 890 890 }; 891 891 892 892 893 - static struct resource wm831x_power_resources[] = { 893 + static const struct resource wm831x_power_resources[] = { 894 894 { 895 895 .name = "SYSLO", 896 896 .start = WM831X_IRQ_PPM_SYSLO, ··· 959 959 }, 960 960 }; 961 961 962 - static struct resource wm831x_rtc_resources[] = { 962 + static const struct resource wm831x_rtc_resources[] = { 963 963 { 964 964 .name = "PER", 965 965 .start = WM831X_IRQ_RTC_PER, ··· 974 974 }, 975 975 }; 976 976 977 - static struct resource wm831x_status1_resources[] = { 977 + static const struct resource wm831x_status1_resources[] = { 978 978 { 979 979 .start = WM831X_STATUS_LED_1, 980 980 .end = WM831X_STATUS_LED_1, ··· 982 982 }, 983 983 }; 984 984 985 - static struct resource wm831x_status2_resources[] = { 985 + static const struct resource wm831x_status2_resources[] = { 986 986 { 987 987 .start = WM831X_STATUS_LED_2, 988 988 .end = WM831X_STATUS_LED_2, ··· 990 990 }, 991 991 }; 992 992 993 - static struct resource wm831x_touch_resources[] = { 993 + static const struct resource wm831x_touch_resources[] = { 994 994 { 995 995 .name = "TCHPD", 996 996 .start = WM831X_IRQ_TCHPD, ··· 1005 1005 }, 1006 1006 }; 1007 1007 1008 - static struct resource wm831x_wdt_resources[] = { 1008 + static const struct resource wm831x_wdt_resources[] = { 1009 1009 { 1010 1010 .start = WM831X_IRQ_WDOG_TO, 1011 1011 .end = WM831X_IRQ_WDOG_TO,
+2 -2
drivers/mfd/wm8994-core.c
··· 40 40 }, 41 41 }; 42 42 43 - static struct resource wm8994_codec_resources[] = { 43 + static const struct resource wm8994_codec_resources[] = { 44 44 { 45 45 .start = WM8994_IRQ_TEMP_SHUT, 46 46 .end = WM8994_IRQ_TEMP_WARN, ··· 48 48 }, 49 49 }; 50 50 51 - static struct resource wm8994_gpio_resources[] = { 51 + static const struct resource wm8994_gpio_resources[] = { 52 52 { 53 53 .start = WM8994_IRQ_GPIO(1), 54 54 .end = WM8994_IRQ_GPIO(11),