Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2124750imm; Thu, 23 Aug 2018 14:45:16 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx2jJy78s65bRZvpaOfI4/Drb86cVOPz/GZJp/a4j9tABPxrswUtrvK6uCrhXsr8aKQmbhQ X-Received: by 2002:a17:902:7084:: with SMTP id z4-v6mr20800008plk.147.1535060716299; Thu, 23 Aug 2018 14:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535060716; cv=none; d=google.com; s=arc-20160816; b=Vww6Uookyv8xNU4ReSGpPI07Vg0r0TzSbZequ8Lc7HxxpeCnyrF0OfQemVH59DkqUP AK7QLPQS8euEHYaMhyTl+6jziWBxRLpu6skWgqZsaPjcxTVwuNOyM1XX/+MAHRuPOIHY HnRvU6gQ4M4mM8EIsQwbjJ9lypA9Y8EdPwqeqY/4tmH91PcylWUP1R8JJgxnkpdZIaok 6BGgyM8g+CHU2orJk4ilnQdgdRcIWqRwrmbn2unqiUOGsu2KbAefXbcf9nPXZgy+GPbp z9+0mxjniyWjFusM5rhY/TAfVC2ZROL+K8AufTS54rr0rgm/FiomAgk1IEZLhMPqt2gF w1Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ztvdOs87QnGD3C6/QZRBUWT5WrwIEtLGFRBu1JlVhU0=; b=eVKHGJq4pcD0tWAuq8h9n8HdaZFY3JgbpnBlCaO6qL7AmeOd1EzMJSOBR7Eo4Ng0CD 8/sLgV2BkfGGyf+PCiPwHGhELb06GpfaHEPgTqHGKP+ZTcFQB3yDE/aCE67k5NoTRGkZ Jv1emmuXJnFtemsAsB8s0LF9yke1AS1xSq/AMx0d7qkKmTqDhzE+qJlPcldOLTcXRJUv dhR830w/So+qbs/TrTekrGIaITzbzhrTj+YXye8zYnHXxZuSr0dUCnPAlht5lxRQcA9Y KZhrawFAtcjBKbgrp7rlE46yr4EYB5fo1YvuwvBRCnJ5YKmrzcRwvm64lOIIdmzrjxKJ xvHQ== 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 z7-v6si4956041plk.215.2018.08.23.14.44.59; Thu, 23 Aug 2018 14:45:16 -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 S1728166AbeHXBPc (ORCPT + 99 others); Thu, 23 Aug 2018 21:15:32 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:41380 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727485AbeHXBPb (ORCPT ); Thu, 23 Aug 2018 21:15:31 -0400 Received: from ramsan.of.borg ([84.194.111.163]) by xavier.telenet-ops.be with bizsmtp id Sljn1y0023XaVaC01ljnHV; Thu, 23 Aug 2018 23:43:52 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1fsxOM-0005lo-U3; Thu, 23 Aug 2018 23:43:46 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1fsxOM-0005Sy-RW; Thu, 23 Aug 2018 23:43:46 +0200 From: Geert Uytterhoeven To: Boris Brezillon , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut Cc: Arnd Bergmann , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] mtd: rawnand: docg4: Remove wrong __init annotations Date: Thu, 23 Aug 2018 23:43:45 +0200 Message-Id: <20180823214345.20949-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); -- 2.17.1