From patchwork Sat Feb 2 10:26:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 217648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1E4182C0296 for ; Sat, 2 Feb 2013 21:28:11 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U1aJB-0006Rf-J2; Sat, 02 Feb 2013 10:26:53 +0000 Received: from mo6-p05-ob.rzone.de ([2a01:238:20a:202:5305::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U1aJ7-0006QU-9B for linux-mtd@lists.infradead.org; Sat, 02 Feb 2013 10:26:50 +0000 X-RZG-AUTH: :IW0NeWC7b/q2i6W/qstXb1SBUuFnrGohdvpEkce+Ub40Q/uAFj+9EbzeWz+D2oOO X-RZG-CLASS-ID: mo05 Received: from ubuntu-2012.fritz.box (pD9FFA383.dip.t-dialin.net [217.255.163.131]) by smtp.strato.de (jorabe mo32) (RZmta 31.14 DYNA|AUTH) with ESMTPA id V07961p129gPhG ; Sat, 2 Feb 2013 11:26:36 +0100 (CET) From: Stefan Roese To: linux-mtd@lists.infradead.org Subject: [PATCH] mtd: cfi_cmdset_0002: Fix compilation warnings introduced by PPB patch Date: Sat, 2 Feb 2013 11:26:33 +0100 Message-Id: <1359800793-17914-1-git-send-email-sr@denx.de> X-Mailer: git-send-email 1.8.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130202_052649_492520_B8256D5E X-CRM114-Status: GOOD ( 10.69 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Artem Bityutskiy , Stephen Rothwell X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch fixes the compilation warnings introduced with this patch: "mtd: cfi_cmdset_0002: Support Persistent Protection Bits (PPB) locking": In file included from drivers/mtd/chips/cfi_cmdset_0002.c:36:0: include/linux/of_platform.h:107:13: warning: 'struct of_device_id' declared inside parameter list [enabled by default] include/linux/of_platform.h:107:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] include/linux/of_platform.h:107:13: warning: 'struct device_node' declared inside parameter list [enabled by default] drivers/mtd/chips/cfi_cmdset_0002.c: In function 'cfi_cmdset_0002': drivers/mtd/chips/cfi_cmdset_0002.c:504:22: warning: unused variable 'np' [-Wunused-variable] drivers/mtd/chips/cfi_cmdset_0002.c: At top level: drivers/mtd/chips/cfi_cmdset_0002.c:2279:12: warning: 'cfi_ppb_lock' defined but not used [-Wunused-function] drivers/mtd/chips/cfi_cmdset_0002.c:2285:12: warning: 'cfi_ppb_unlock' defined but not used [-Wunused-function] drivers/mtd/chips/cfi_cmdset_0002.c:2382:12: warning: 'cfi_ppb_is_locked' defined but not used [-Wunused-function] Signed-off-by: Stefan Roese Cc: Artem Bityutskiy Cc: Stephen Rothwell --- drivers/mtd/chips/cfi_cmdset_0002.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 5d5ed93..fff665d 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -501,7 +502,7 @@ static void cfi_fixup_m29ew_delay_after_resume(struct cfi_private *cfi) struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) { struct cfi_private *cfi = map->fldrv_priv; - struct device_node *np = map->device_node; + struct device_node __maybe_unused *np = map->device_node; struct mtd_info *mtd; int i; @@ -2205,8 +2206,9 @@ struct ppb_lock { #define DO_XXLOCK_ONEBLOCK_UNLOCK ((void *)2) #define DO_XXLOCK_ONEBLOCK_GETLOCK ((void *)3) -static int do_ppb_xxlock(struct map_info *map, struct flchip *chip, - unsigned long adr, int len, void *thunk) +static int __maybe_unused do_ppb_xxlock(struct map_info *map, + struct flchip *chip, + unsigned long adr, int len, void *thunk) { struct cfi_private *cfi = map->fldrv_priv; unsigned long timeo; @@ -2276,13 +2278,15 @@ static int do_ppb_xxlock(struct map_info *map, struct flchip *chip, return ret; } -static int cfi_ppb_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) +static int __maybe_unused cfi_ppb_lock(struct mtd_info *mtd, loff_t ofs, + uint64_t len) { return cfi_varsize_frob(mtd, do_ppb_xxlock, ofs, len, DO_XXLOCK_ONEBLOCK_LOCK); } -static int cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) +static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, + uint64_t len) { struct mtd_erase_region_info *regions = mtd->eraseregions; struct map_info *map = mtd->priv; @@ -2379,7 +2383,8 @@ static int cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) return ret; } -static int cfi_ppb_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) +static int __maybe_unused cfi_ppb_is_locked(struct mtd_info *mtd, loff_t ofs, + uint64_t len) { return cfi_varsize_frob(mtd, do_ppb_xxlock, ofs, len, DO_XXLOCK_ONEBLOCK_GETLOCK) ? 1 : 0;