From patchwork Thu Oct 15 13:08:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 55008 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 247EB2301F for ; Thu, 15 Oct 2015 13:11:37 +0000 (UTC) Received: by lffv3 with SMTP id v3sf2159296lff.1 for ; Thu, 15 Oct 2015 06:11:36 -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=fTyeMoBjggClRlBxzFRtnHFm3ngMQVK3ew/To88HWt8=; b=lIkXh1PVg9te6GWmLWIp+LyEAHdlN22Ho/hdQR0iywKRuJr77uQ9eoSiUBrR/rhKko QuNnw8E5solqwva82/QYrRkTJVD20D2fdba0HhlStHVXmfRh3vsFKTtd6BrTRwVBYl2H rvd1+H8VcWwG076sU8khk1M/7v73QysGoTN71RBnm0+BpVOF2QeO+hKnr0FY9+UtsqLV UdB4vtNS2gX+vC6XqTAohivtQK8khUPMBIV7Y1Na6IKUac8Flp7UGvjPINHRSxetuC/2 VpcNUCkh5/hwkJNbbm3q9k+jV2eGBs75CQh7mO6dy3gslHS/ZIX4qolYW815plbnt2dT bjoA== X-Gm-Message-State: ALoCoQlMwzvKEXVsCFxce67e8RwcrikNwt94qjdjUIRszWlpVeYQezkmuN/0EL3So5Em/Cg8UVnh X-Received: by 10.194.240.230 with SMTP id wd6mr2142607wjc.0.1444914696057; Thu, 15 Oct 2015 06:11:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.160.75 with SMTP id j72ls141645lfe.106.gmail; Thu, 15 Oct 2015 06:11:35 -0700 (PDT) X-Received: by 10.112.166.102 with SMTP id zf6mr4552026lbb.124.1444914695904; Thu, 15 Oct 2015 06:11:35 -0700 (PDT) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id g67si9106912lfi.77.2015.10.15.06.11.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 06:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lffy185 with SMTP id y185so27296795lff.2 for ; Thu, 15 Oct 2015 06:11:34 -0700 (PDT) X-Received: by 10.25.28.81 with SMTP id c78mr2934211lfc.29.1444914694282; Thu, 15 Oct 2015 06:11:34 -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 w3csp625383lbq; Thu, 15 Oct 2015 06:11:33 -0700 (PDT) X-Received: by 10.66.144.135 with SMTP id sm7mr10189196pab.106.1444914693309; Thu, 15 Oct 2015 06:11:33 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id lm3si21623191pab.17.2015.10.15.06.11.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 06:11:33 -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 1ZmiIa-00074l-P0; Thu, 15 Oct 2015 13:10:24 +0000 Received: from mail-lb0-f180.google.com ([209.85.217.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZmiHu-0005MT-HP for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2015 13:09:43 +0000 Received: by lbbwb3 with SMTP id wb3so6353291lbb.1 for ; Thu, 15 Oct 2015 06:09:20 -0700 (PDT) X-Received: by 10.112.163.193 with SMTP id yk1mr4418400lbb.1.1444914560599; Thu, 15 Oct 2015 06:09:20 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id rf8sm2036081lbb.20.2015.10.15.06.09.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Oct 2015 06:09:20 -0700 (PDT) From: Linus Walleij To: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org Subject: [PATCH 03/10] mtd: afs: break out v1 footer magic to a define Date: Thu, 15 Oct 2015 15:08:46 +0200 Message-Id: <1444914533-27782-4-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_060942_827106_8F67B9AE X-CRM114-Status: GOOD ( 14.35 ) 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.180 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.217.180 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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.215.52 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 Break out the magic number to a #defined constant. Cc: Ryan Harkin Cc: Liviu Dudau Signed-off-by: Linus Walleij --- drivers/mtd/afs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c index 9af00528586f..d09280ae12bd 100644 --- a/drivers/mtd/afs.c +++ b/drivers/mtd/afs.c @@ -34,6 +34,8 @@ #include #include +#define AFSV1_FOOTER_MAGIC 0xA0FFFF9F + struct footer_v1 { u32 image_info_base; /* Address of first word of ImageFooter */ u32 image_start; /* Start of area reserved by this footer */ @@ -90,7 +92,7 @@ afs_read_footer_v1(struct mtd_info *mtd, u_int *img_start, u_int *iis_start, /* * Does it contain the magic number? */ - if (fs.signature != 0xa0ffff9f) + if (fs.signature != AFSV1_FOOTER_MAGIC) ret = 0; /*