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

mtd: constify mtd_partition

mtd_partition are not supposed to change at runtime.
Functions 'mtd_device_parse_register' working with const mtd_partition
provided by <linux/mtd/mtd.h>. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Arvind Yadav and committed by
Richard Weinberger
d4906688 2e442aeb

+10 -10
+1 -1
drivers/mtd/devices/lart.c
··· 583 583 } 584 584 }; 585 585 586 - static struct mtd_partition lart_partitions[] = { 586 + static const struct mtd_partition lart_partitions[] = { 587 587 /* blob */ 588 588 { 589 589 .name = "blob",
+1 -1
drivers/mtd/maps/cfi_flagadm.c
··· 61 61 .bankwidth = 2, 62 62 }; 63 63 64 - static struct mtd_partition flagadm_parts[] = { 64 + static const struct mtd_partition flagadm_parts[] = { 65 65 { 66 66 .name = "Bootloader", 67 67 .offset = FLASH_PARTITION0_ADDR,
+1 -1
drivers/mtd/maps/impa7.c
··· 47 47 /* 48 48 * MTD partitioning stuff 49 49 */ 50 - static struct mtd_partition partitions[] = 50 + static const struct mtd_partition partitions[] = 51 51 { 52 52 { 53 53 .name = "FileSystem",
+1 -1
drivers/mtd/maps/netsc520.c
··· 52 52 /* partition_info gives details on the logical partitions that the split the 53 53 * single flash device into. If the size if zero we use up to the end of the 54 54 * device. */ 55 - static struct mtd_partition partition_info[]={ 55 + static const struct mtd_partition partition_info[] = { 56 56 { 57 57 .name = "NetSc520 boot kernel", 58 58 .offset = 0,
+1 -1
drivers/mtd/maps/nettel.c
··· 107 107 .bankwidth = AMD_BUSWIDTH, 108 108 }; 109 109 110 - static struct mtd_partition nettel_amd_partitions[] = { 110 + static const struct mtd_partition nettel_amd_partitions[] = { 111 111 { 112 112 .name = "SnapGear BIOS config", 113 113 .offset = 0x000e0000,
+1 -1
drivers/mtd/maps/sbc_gxx.c
··· 87 87 /* partition_info gives details on the logical partitions that the split the 88 88 * single flash device into. If the size if zero we use up to the end of the 89 89 * device. */ 90 - static struct mtd_partition partition_info[]={ 90 + static const struct mtd_partition partition_info[] = { 91 91 { .name = "SBC-GXx flash boot partition", 92 92 .offset = 0, 93 93 .size = BOOT_PARTITION_SIZE_KiB*1024 },
+1 -1
drivers/mtd/maps/ts5500_flash.c
··· 43 43 .phys = WINDOW_ADDR 44 44 }; 45 45 46 - static struct mtd_partition ts5500_partitions[] = { 46 + static const struct mtd_partition ts5500_partitions[] = { 47 47 { 48 48 .name = "Drive A", 49 49 .offset = 0,
+1 -1
drivers/mtd/maps/uclinux.c
··· 49 49 50 50 /****************************************************************************/ 51 51 52 - static struct mtd_partition uclinux_romfs[] = { 52 + static const struct mtd_partition uclinux_romfs[] = { 53 53 { .name = "ROMfs" } 54 54 }; 55 55
+1 -1
drivers/mtd/nand/ams-delta.c
··· 41 41 * Define partitions for flash devices 42 42 */ 43 43 44 - static struct mtd_partition partition_info[] = { 44 + static const struct mtd_partition partition_info[] = { 45 45 { .name = "Kernel", 46 46 .offset = 0, 47 47 .size = 3 * SZ_1M + SZ_512K },
+1 -1
drivers/mtd/nand/cmx270_nand.c
··· 42 42 /* 43 43 * Define static partitions for flash device 44 44 */ 45 - static struct mtd_partition partition_info[] = { 45 + static const struct mtd_partition partition_info[] = { 46 46 [0] = { 47 47 .name = "cmx270-0", 48 48 .offset = 0,