Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6219987imm; Mon, 27 Aug 2018 11:47:18 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbn3CHjTUEC1FJnCK/CIkjVqHalzWNM40eqSQU/TZX6L2RGnkR11V/avvcWJF/w1/EyRQib X-Received: by 2002:a17:902:f098:: with SMTP id go24mr14473818plb.183.1535395638011; Mon, 27 Aug 2018 11:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535395637; cv=none; d=google.com; s=arc-20160816; b=aw/GSNkTfK4NOlxPKgBXv/oFb7mOkb8ROAr/jfKkByEgwhY1qfMRy+CngQA6TyjsTn LDteXemoOnhqRD9ic/iUKoduz8Lu8n1jswHsao+1yD0Dp68fmnmZDkApGVk4JKXvG1IY b3Q2pAPQ4PzOo/ANHF7zBrCEjWyV7Zk5hGePHwLDss+Q/DwN1YfptHWjqCsgGgglG16t qWYWLLyoLNToSQizAEKcCqDI3+v9SexnyZok7qoXgOkxvDWQmt3h6hyerk+S4/BeSq1E VKcPwSK//NBpYf+JveGRzhrT4+ZSuGMAhUdhVf/QbfxdN1Tiq5qCv2nFV9aI5kZdoKuO LcTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=GVg3ebNzciH8dlrOARlTAhCOMfKJ9O8QN6nf86IXi/A=; b=gMrNodbcibPDcpdcjPkY+f0iL18DALBVohSg7p/xPc8qiXC8InllRUlWF9mn8Ypzga 1mLtst1TzDPcuX0lKwhVDn2attl3lfSMKdamFwl2ZeotAvfYy3LICOicnJ2IwwmaFkWv 9iM8PHBIiw5KNTw7se7gSdYOPkfZUGsupxPUehjuzPwigkTWT+8YxTVPxE+RSklZx4DE URg67NGp8n8xiZUPTS/66rW5a9f0JqWGjQFfcJqwEznRo31pOCfA/P5L1Ng3L5+6rlb6 dx2kFn6HejDu0RlzK9Y3jQGgUYaB2y9LJTs0bBP9lY+sjFOnWPOetRkDoL8j6qFDtCE0 /a0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4-v6si15875678pfc.328.2018.08.27.11.47.02; Mon, 27 Aug 2018 11:47:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727387AbeH0Wc6 (ORCPT + 99 others); Mon, 27 Aug 2018 18:32:58 -0400 Received: from mail.bootlin.com ([62.4.15.54]:49677 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbeH0Wc6 (ORCPT ); Mon, 27 Aug 2018 18:32:58 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 7185F2079D; Mon, 27 Aug 2018 20:45:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (unknown [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 3D931208C7; Mon, 27 Aug 2018 20:44:39 +0200 (CEST) Date: Mon, 27 Aug 2018 20:44:35 +0200 From: Boris Brezillon To: Geert Uytterhoeven Cc: Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH] mtd: rawnand: docg4: Remove wrong __init annotations Message-ID: <20180827204435.0ecfcacf@bbrezillon> In-Reply-To: <20180823214345.20949-1-geert@linux-m68k.org> References: <20180823214345.20949-1-geert@linux-m68k.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Aug 2018 23:43:45 +0200 Geert Uytterhoeven wrote: > If gcc (e.g. 4.1.2) decides not to inline init_mtd_structs() and > read_id_reg(), this will cause section mismatches, and crashes: > > WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc10): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:init_mtd_structs() > The function docg4_attach_chip() references > the function __init init_mtd_structs(). > This is often because docg4_attach_chip lacks a __init > annotation or the annotation of init_mtd_structs is wrong. > > WARNING: drivers/mtd/nand/raw/docg4.o(.text+0xc3e): Section mismatch in reference from the function docg4_attach_chip() to the function .init.text:read_id_reg() > The function docg4_attach_chip() references > the function __init read_id_reg(). > This is often because docg4_attach_chip lacks a __init > annotation or the annotation of read_id_reg is wrong. > > Fix this by dropping the now incorrect __init annotations from > init_mtd_structs() and read_id_reg(). > > Fixes: 66a38478dcc5b5a3 ("mtd: rawnand: docg4: convert driver to nand_scan()") > Signed-off-by: Geert Uytterhoeven Queued to mtd/master. Thanks, Boris > --- > drivers/mtd/nand/raw/docg4.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/docg4.c b/drivers/mtd/nand/raw/docg4.c > index a3f04315c05c54e6..427fcbc1b71c0551 100644 > --- a/drivers/mtd/nand/raw/docg4.c > +++ b/drivers/mtd/nand/raw/docg4.c > @@ -1218,7 +1218,7 @@ static int docg4_resume(struct platform_device *pdev) > return 0; > } > > -static void __init init_mtd_structs(struct mtd_info *mtd) > +static void init_mtd_structs(struct mtd_info *mtd) > { > /* initialize mtd and nand data structures */ > > @@ -1290,7 +1290,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd) > > } > > -static int __init read_id_reg(struct mtd_info *mtd) > +static int read_id_reg(struct mtd_info *mtd) > { > struct nand_chip *nand = mtd_to_nand(mtd); > struct docg4_priv *doc = nand_get_controller_data(nand);