From patchwork Fri Jun 22 23:35:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 166687 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [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 73DAFB6FA4 for ; Sat, 23 Jun 2012 09:37:37 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SiDO7-0004iQ-Rv; Fri, 22 Jun 2012 23:35:39 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SiDO0-0004gf-6k for linux-mtd@lists.infradead.org; Fri, 22 Jun 2012 23:35:32 +0000 Received: by pbbrq13 with SMTP id rq13so4463143pbb.36 for ; Fri, 22 Jun 2012 16:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=23Xk3Afl2A/XMGARhdcYwscdJzGdQ9yNfGIC5e+q+h0=; b=k1xQdVXUVCieubot1FYG1TQkPcUyTixSOIPGd6SQpsL7TQreMz1dY5FlB/qqRZySyc ejtn4QCgOH5B8S6trWJ8tKyvu6OQzwIDPIG4syLO6gMTB4ShqkMnSidWJ2U0lhz4HtvW TLS5N4eOek1nCMTKQPsBDsZ42Hcs6vAZWBusSJUQngenNb8lK/9Jh5JlYa7a08mJEQmA 0XqWo64vOe/5EcK9es2eLsV9r5g/N0IJSHkU/ne90J3xCmxeQlyUV1CFe0PNmC21BE4C 9+L2DE9vEE8553KiA8syOEVC7qHr3vJrIjT0h8csvZdAoA0wj/GEKuPE4IHzvQ/lYSIm lWbA== Received: by 10.68.200.102 with SMTP id jr6mr15824157pbc.0.1340408131294; Fri, 22 Jun 2012 16:35:31 -0700 (PDT) Received: from ld-irv-0074.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPS id vc6sm516963pbc.6.2012.06.22.16.35.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jun 2012 16:35:30 -0700 (PDT) From: Brian Norris To: Subject: [PATCH 1/8] mtd: move mtd_read_oob() definition out of mtd.h Date: Fri, 22 Jun 2012 16:35:38 -0700 Message-Id: <1340408145-24531-2-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1340408145-24531-1-git-send-email-computersforpeace@gmail.com> References: <1340408145-24531-1-git-send-email-computersforpeace@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Mike Dunn , Brian Norris , David Woodhouse , Shmulik Ladkani , Artem Bityutskiy 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 mtd_read_oob() will be expanded a little, so don't leave it in the header as a static inline function. Signed-off-by: Brian Norris Cc: Shmulik Ladkani Cc: Mike Dunn --- drivers/mtd/mtdcore.c | 9 +++++++++ include/linux/mtd/mtd.h | 9 +-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 5757307..fcfce24 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -858,6 +858,15 @@ int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, } EXPORT_SYMBOL_GPL(mtd_panic_write); +int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops) +{ + ops->retlen = ops->oobretlen = 0; + if (!mtd->_read_oob) + return -EOPNOTSUPP; + return mtd->_read_oob(mtd, from, ops); +} +EXPORT_SYMBOL_GPL(mtd_read_oob); + /* * Method to access the protection register area, present in some flash * devices. The user data is one time programmable but the factory data is read diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 63dadc0..81d61e7 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -265,14 +265,7 @@ int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); -static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, - struct mtd_oob_ops *ops) -{ - ops->retlen = ops->oobretlen = 0; - if (!mtd->_read_oob) - return -EOPNOTSUPP; - return mtd->_read_oob(mtd, from, ops); -} +int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops); static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)