From patchwork Thu Oct 15 13:08:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 55005 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 943442301F for ; Thu, 15 Oct 2015 13:10:59 +0000 (UTC) Received: by lfbe131 with SMTP id e131sf2133312lfb.3 for ; Thu, 15 Oct 2015 06:10:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=DylpouqguPv6Azne3l2mjtvBFP6SC0w87tJUn+6F/ns=; b=KcR6hMxOJyxEzwu4Mdx+PT2dIak0s32SfMUbwt9F4th1vEBfR25LV6y7acnSUq4IhX r7uCOZNsyl5ard60q3xyxvTJcgMW0ciTFkdpBZfTrFwvwTX5pXSM8Y6DJApnss1OiJEB RGzMePrDkK/MQDoomTrRSqvkyeSbFaffMu3C4D6snln1aNNDALK4I/wkxrq9lE9hrhgW jUs3Ky8fjzZZ1ObeBpVE/Nj87hp4anhcoGQZ+N/VjsxpBsgxXstlQJ9j+GL/pexrixMH HFEJnieAxKJ1oi4fBzsJKx8L/wetsOdyN7SSUxn+cZlEpEmNBmy00rufs4Ynqpognk6n JZ+g== X-Gm-Message-State: ALoCoQnZU9BW5qBX1lcxVfoKl1ogvY+FuS3sDI6TIfDe4g50bKSZDse1dUfRnyrTj51vawlYBAnC X-Received: by 10.112.158.202 with SMTP id ww10mr2213860lbb.13.1444914658524; Thu, 15 Oct 2015 06:10:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.170.72 with SMTP id t69ls153323lfe.56.gmail; Thu, 15 Oct 2015 06:10:58 -0700 (PDT) X-Received: by 10.112.205.69 with SMTP id le5mr4545084lbc.89.1444914658321; Thu, 15 Oct 2015 06:10:58 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id i8si9082187lbj.130.2015.10.15.06.10.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 06:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcao8 with SMTP id ao8so68562027lbc.3 for ; Thu, 15 Oct 2015 06:10:58 -0700 (PDT) X-Received: by 10.112.180.230 with SMTP id dr6mr4450327lbc.72.1444914657990; Thu, 15 Oct 2015 06:10:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp624960lbq; Thu, 15 Oct 2015 06:10:56 -0700 (PDT) X-Received: by 10.66.185.5 with SMTP id ey5mr9977348pac.110.1444914656674; Thu, 15 Oct 2015 06:10:56 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kv12si5999377pab.226.2015.10.15.06.10.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 06:10:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZmiHu-0005R6-31; Thu, 15 Oct 2015 13:09:42 +0000 Received: from mail-lb0-f175.google.com ([209.85.217.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZmiHn-0005MM-9T for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2015 13:09:39 +0000 Received: by lbwr8 with SMTP id r8so68283220lbw.2 for ; Thu, 15 Oct 2015 06:09:13 -0700 (PDT) X-Received: by 10.112.159.168 with SMTP id xd8mr4430794lbb.118.1444914553478; Thu, 15 Oct 2015 06:09:13 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id rf8sm2036081lbb.20.2015.10.15.06.09.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 06:09:12 -0700 (PDT) From: Linus Walleij To: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org Subject: [PATCH 01/10] mtd: afs: rename structs and functions for v1 Date: Thu, 15 Oct 2015 15:08:44 +0200 Message-Id: <1444914533-27782-2-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1444914533-27782-1-git-send-email-linus.walleij@linaro.org> References: <1444914533-27782-1-git-send-email-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151015_060935_535051_832D7721 X-CRM114-Status: GOOD ( 16.70 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.175 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.217.175 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Cc: Linus Walleij , Liviu Dudau , Ryan Harkin , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Since we're gonna add the v2 version of flash information structure and we want to avoid confusion, rename the old functions to *v1. Cut the word "structure" from the struct name, it is pretty obvious that it is a struct already from the keyword. Cc: Ryan Harkin Cc: Liviu Dudau Signed-off-by: Linus Walleij --- drivers/mtd/afs.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c index 96a33e3f7b00..9af00528586f 100644 --- a/drivers/mtd/afs.c +++ b/drivers/mtd/afs.c @@ -34,7 +34,7 @@ #include #include -struct footer_struct { +struct footer_v1 { u32 image_info_base; /* Address of first word of ImageFooter */ u32 image_start; /* Start of area reserved by this footer */ u32 signature; /* 'Magic' number proves it's a footer */ @@ -42,7 +42,7 @@ struct footer_struct { u32 checksum; /* Just this structure */ }; -struct image_info_struct { +struct image_info_v1 { u32 bootFlags; /* Boot flags, compression etc. */ u32 imageNumber; /* Unique number, selects for boot etc. */ u32 loadAddress; /* Address program should be loaded to */ @@ -67,10 +67,10 @@ static u32 word_sum(void *words, int num) } static int -afs_read_footer(struct mtd_info *mtd, u_int *img_start, u_int *iis_start, - u_int off, u_int mask) +afs_read_footer_v1(struct mtd_info *mtd, u_int *img_start, u_int *iis_start, + u_int off, u_int mask) { - struct footer_struct fs; + struct footer_v1 fs; u_int ptr = off + mtd->erasesize - sizeof(fs); size_t sz; int ret; @@ -126,7 +126,7 @@ afs_read_footer(struct mtd_info *mtd, u_int *img_start, u_int *iis_start, } static int -afs_read_iis(struct mtd_info *mtd, struct image_info_struct *iis, u_int ptr) +afs_read_iis_v1(struct mtd_info *mtd, struct image_info_v1 *iis, u_int ptr) { size_t sz; int ret, i; @@ -182,16 +182,16 @@ static int parse_afs_partitions(struct mtd_info *mtd, * the strings. */ for (idx = off = sz = 0; off < mtd->size; off += mtd->erasesize) { - struct image_info_struct iis; + struct image_info_v1 iis; u_int iis_ptr, img_ptr; - ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); + ret = afs_read_footer_v1(mtd, &img_ptr, &iis_ptr, off, mask); if (ret < 0) break; if (ret == 0) continue; - ret = afs_read_iis(mtd, &iis, iis_ptr); + ret = afs_read_iis_v1(mtd, &iis, iis_ptr); if (ret < 0) break; if (ret == 0) @@ -215,18 +215,18 @@ static int parse_afs_partitions(struct mtd_info *mtd, * Identify the partitions */ for (idx = off = 0; off < mtd->size; off += mtd->erasesize) { - struct image_info_struct iis; + struct image_info_v1 iis; u_int iis_ptr, img_ptr; /* Read the footer. */ - ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); + ret = afs_read_footer_v1(mtd, &img_ptr, &iis_ptr, off, mask); if (ret < 0) break; if (ret == 0) continue; /* Read the image info block */ - ret = afs_read_iis(mtd, &iis, iis_ptr); + ret = afs_read_iis_v1(mtd, &iis, iis_ptr); if (ret < 0) break; if (ret == 0)