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: 7405981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 336779F1D5 for ; Thu, 15 Oct 2015 13:12:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5BB5C2083F for ; Thu, 15 Oct 2015 13:12:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 882252073E for ; Thu, 15 Oct 2015 13:12:00 +0000 (UTC) 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RpEFJ6Snv9w7C3MDWN6UibkpChV80kgWaEJmqlLdwhA=; b=Q8hB8VVUWE7JE+/TiJPDqoPuJjitqumOISqEaQBURYmzoNEOe21+gPws7IaNdRsP4f JqGriFEJYpti2pEWswWJUDY4g7fIj3ugf8pvqulsPRH1f+2jVUfnTovpS9Gk+N37gYQt Ry3MJn8GvkrK2SNhoxUUdKXaG9T2bYtrD/huCFCb4dlOi8UstWhhLwdJqa5Ol/OU8zkz YPkXmDONDIG1yfyi4yRTX6yiFltIh8rXYGPUv8tKMXvtPT018ox9SrHf0lW/ChiU8dQF ZoP6/UeqWRwFpy1M059nyBv/lDoOdkeZq57zLbtk48ajhWURkGh9ojQcmPYY08hO5D+S 5QRA== X-Gm-Message-State: ALoCoQnt4yQVuwzdoHhdEQUD0RHU+FZ+AdkXo3Z/x/rk1j+m8A4YybT1LRXm/bLQq6Los0bfFgdx 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-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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; /*