From patchwork Mon Aug 28 08:24:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 806435 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LZ4QzPTA"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jt8DHcZh"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xglGf4rM5z9s7p for ; Mon, 28 Aug 2017 18:26:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=O2FwDSMOLH1VREYjquO6zz84fwiTCCh1jnmSVcjGGuo=; b=LZ4 QzPTAxSZIvIq6U3k7f6etUgAc6i/9P9+dPM/+v9D9WtHoARnyVkTThJhjzEh6pseDvXPy+w20CfJN 3ahgsWP4oisd2BKhBF5PwrztRVo8M8NccWRSaGFh3kGfqfimd8BSBsR9ixN89iwOND4UA42U9fgxm I9JgF/UjJmeBMJxlG6yelCop4SODheYjOXjRIzwf4GBFZteDsk783R6ZwjygRnnf3tOWZw+WfO/yn OhZghCDTqtI/mMxctPC4WZj/3FUCBlFUXKk61DzahLG7dBXR0Cex6Y799V8MDL44hMVu6UfSjM5Mu g+MfaGf401PobSqOo2Z2WtYXBlZjRUQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dmFN3-00048p-KF; Mon, 28 Aug 2017 08:26:09 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dmFMf-0003uR-50 for linux-mtd@lists.infradead.org; Mon, 28 Aug 2017 08:25:47 +0000 Received: by mail-pg0-x242.google.com with SMTP id r133so5841523pgr.2 for ; Mon, 28 Aug 2017 01:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=k6LTT/VmHqvvbT6jtFSx97riY/D2EjXJfGqLrMFPgoc=; b=jt8DHcZhRDXmrdYRH4bTh8nzS0T98T5fyZy1RB7nIbbtkfeeXZBynGyTpISNb2KnJs 5Ajmu7XVveoxUasbSseUgSUhmvsyIHqSajUo45GJizjts4tYuhZ841KQI0897kom9hSL a/GgypowQW+VoFrrpqwEYVlasuA0815nJ3W98EDkbe3VD68Zp+SRazzXEqc0OaLmEtbx mzIH2TPa1PGlhGkJP/qgsQ89Go6XdtyXMN/PHzTYt6Ge+gAEIOffEVUmxFD3nkLIeRjf zCVbtt83JpaieeOrxL+hdNorLyw3cPF0aDt8ubR287Ku/6KnRr8dMb1Tyos3nyNWHsXo kF5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k6LTT/VmHqvvbT6jtFSx97riY/D2EjXJfGqLrMFPgoc=; b=sRzRVB8iip+aGCrylYMmlxcu6CjigHYTC7sPwmd4fGomdCePob2YlIeXMC0BS4Q0SW NB01G97bAHiKvy+gMWC68XlOgcs+EG/Ch4hQ4PXdFI6thA/50cR82wCI09o2x9RZNhgs H9NkrJLuUFwUocm8ceB1r/b+N+jMWc2BxdUVCVnMt+hh2z7F4wS2DjK5km2SW/XLkyvV A7FuMcE3c9nbtHAPeYbv5LLLBEHiSPotcE7ON+WD40SgXihbwfYzC6IpJH0cuKC7qgHb bNOI/6OYinWi6ijts0s9K6UUbIfy3yvR4RxwP9EKbys8B6BdYgrttuAqDKIqgEcT8TvL XM4Q== X-Gm-Message-State: AHYfb5g4R864MaKKhbUz+BeNw9/AnjPVtVo9dLlq9+ug5xq6nvwwfzCe WwiwwN63YtBl6A== X-Received: by 10.84.229.136 with SMTP id c8mr7265272plk.27.1503908723134; Mon, 28 Aug 2017 01:25:23 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id k197sm12209562pga.78.2017.08.28.01.25.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Aug 2017 01:25:22 -0700 (PDT) From: Arvind Yadav To: dwmw2@infradead.org, computersforpeace@gmail.com, boris.brezillon@free-electrons.com, marek.vasut@gmail.com, richard@nod.at, cyrille.pitchen@wedev4u.fr Subject: [PATCH] mtd: constify mtd_partition Date: Mon, 28 Aug 2017 13:54:57 +0530 Message-Id: <4039663983bf372bd802549ef313ff1e466ed18a.1503908316.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170828_012545_335736_A14E6F8E X-CRM114-Status: GOOD ( 12.82 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (arvind.yadav.cs[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org mtd_partition are not supposed to change at runtime. Functions 'mtd_device_parse_register' working with const mtd_partition provided by . So mark the non-const structs as const. Signed-off-by: Arvind Yadav --- drivers/mtd/devices/lart.c | 2 +- drivers/mtd/maps/cfi_flagadm.c | 2 +- drivers/mtd/maps/impa7.c | 2 +- drivers/mtd/maps/netsc520.c | 2 +- drivers/mtd/maps/nettel.c | 2 +- drivers/mtd/maps/sbc_gxx.c | 2 +- drivers/mtd/maps/ts5500_flash.c | 2 +- drivers/mtd/maps/uclinux.c | 2 +- drivers/mtd/nand/ams-delta.c | 2 +- drivers/mtd/nand/cmx270_nand.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c index 268aae4..555b944 100644 --- a/drivers/mtd/devices/lart.c +++ b/drivers/mtd/devices/lart.c @@ -583,7 +583,7 @@ static int flash_write (struct mtd_info *mtd,loff_t to,size_t len,size_t *retlen } }; -static struct mtd_partition lart_partitions[] = { +static const struct mtd_partition lart_partitions[] = { /* blob */ { .name = "blob", diff --git a/drivers/mtd/maps/cfi_flagadm.c b/drivers/mtd/maps/cfi_flagadm.c index d504b3d..70f4886 100644 --- a/drivers/mtd/maps/cfi_flagadm.c +++ b/drivers/mtd/maps/cfi_flagadm.c @@ -61,7 +61,7 @@ .bankwidth = 2, }; -static struct mtd_partition flagadm_parts[] = { +static const struct mtd_partition flagadm_parts[] = { { .name = "Bootloader", .offset = FLASH_PARTITION0_ADDR, diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c index 15bbda0..a0b8fa7 100644 --- a/drivers/mtd/maps/impa7.c +++ b/drivers/mtd/maps/impa7.c @@ -47,7 +47,7 @@ /* * MTD partitioning stuff */ -static struct mtd_partition partitions[] = +static const struct mtd_partition partitions[] = { { .name = "FileSystem", diff --git a/drivers/mtd/maps/netsc520.c b/drivers/mtd/maps/netsc520.c index 81dc259..b0517b1 100644 --- a/drivers/mtd/maps/netsc520.c +++ b/drivers/mtd/maps/netsc520.c @@ -52,7 +52,7 @@ /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]={ +static const struct mtd_partition partition_info[] = { { .name = "NetSc520 boot kernel", .offset = 0, diff --git a/drivers/mtd/maps/nettel.c b/drivers/mtd/maps/nettel.c index a577ef8..729579f 100644 --- a/drivers/mtd/maps/nettel.c +++ b/drivers/mtd/maps/nettel.c @@ -107,7 +107,7 @@ .bankwidth = AMD_BUSWIDTH, }; -static struct mtd_partition nettel_amd_partitions[] = { +static const struct mtd_partition nettel_amd_partitions[] = { { .name = "SnapGear BIOS config", .offset = 0x000e0000, diff --git a/drivers/mtd/maps/sbc_gxx.c b/drivers/mtd/maps/sbc_gxx.c index 556a2df..8df181f 100644 --- a/drivers/mtd/maps/sbc_gxx.c +++ b/drivers/mtd/maps/sbc_gxx.c @@ -87,7 +87,7 @@ Intel StrataFlash (28F320/28F640) in x8 mode. /* partition_info gives details on the logical partitions that the split the * single flash device into. If the size if zero we use up to the end of the * device. */ -static struct mtd_partition partition_info[]={ +static const struct mtd_partition partition_info[] = { { .name = "SBC-GXx flash boot partition", .offset = 0, .size = BOOT_PARTITION_SIZE_KiB*1024 }, diff --git a/drivers/mtd/maps/ts5500_flash.c b/drivers/mtd/maps/ts5500_flash.c index 9969fed..8f177e0 100644 --- a/drivers/mtd/maps/ts5500_flash.c +++ b/drivers/mtd/maps/ts5500_flash.c @@ -43,7 +43,7 @@ .phys = WINDOW_ADDR }; -static struct mtd_partition ts5500_partitions[] = { +static const struct mtd_partition ts5500_partitions[] = { { .name = "Drive A", .offset = 0, diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c index 00a8190..aef030c 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c @@ -49,7 +49,7 @@ struct map_info uclinux_ram_map = { /****************************************************************************/ -static struct mtd_partition uclinux_romfs[] = { +static const struct mtd_partition uclinux_romfs[] = { { .name = "ROMfs" } }; diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c index 5d6c26f..6cba2e4 100644 --- a/drivers/mtd/nand/ams-delta.c +++ b/drivers/mtd/nand/ams-delta.c @@ -41,7 +41,7 @@ * Define partitions for flash devices */ -static struct mtd_partition partition_info[] = { +static const struct mtd_partition partition_info[] = { { .name = "Kernel", .offset = 0, .size = 3 * SZ_1M + SZ_512K }, diff --git a/drivers/mtd/nand/cmx270_nand.c b/drivers/mtd/nand/cmx270_nand.c index 949b940..12a92b3 100644 --- a/drivers/mtd/nand/cmx270_nand.c +++ b/drivers/mtd/nand/cmx270_nand.c @@ -42,7 +42,7 @@ /* * Define static partitions for flash device */ -static struct mtd_partition partition_info[] = { +static const struct mtd_partition partition_info[] = { [0] = { .name = "cmx270-0", .offset = 0,