Received: by 10.223.185.116 with SMTP id b49csp3991283wrg; Tue, 13 Feb 2018 10:55:13 -0800 (PST) X-Google-Smtp-Source: AH8x226X0X/b8SJMAiSJfEZ3fI/UVYHvgf29MT0IfQMq82u7lcq5ngtai7d38pL0bcxJS18bFXSD X-Received: by 10.99.171.10 with SMTP id p10mr1743517pgf.81.1518548113595; Tue, 13 Feb 2018 10:55:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518548113; cv=none; d=google.com; s=arc-20160816; b=04TawCSvzHXCfR/f3VuEM0S85Ov29Jt8/xjL6uQ1AR8pR5IOL7BgsZFiEE51yijj4U xcV1g6bxLh7LmsMuEhoiRYrgcgIKiy8/a6C/vwoWg9FWa2MX+ZvN2VCFoRDONGy3PcxF Mdf4UVscBgjrpnXf2VJ0uWkghhIPImN+g7BQZJPYsJYteaLM00sQgqU4u1mEPqXIxgWR CP3VSHdWcXUkt9uest6llmObl5fOMf8ee7oRuq8sqAaOh7SNC3c23xsNVQi8xhJCqjrU nDjfcYYoANSz/6niMAcxGZKuo9StcPkm91e4xZ0a+QluxAz1tgZiWJ3dzLlIPEwMuigv jRDQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Mdmt+lhOZH8aw5/Yz1SgT+IrdPJCjGZNswHR/oCa06E=; b=Z6mBc+WdvzdR7381shHmA5olA0VuQXtsowW8zxNN5fErD3Bs9kII81DGxrcZK1S8g9 Gp8uCWyd9kfnjlmBiSSMEgBYfct7K9nhcKlp+DLB5ehWnyr1J7y/6BJyjAiUtmR/swx/ iRJx2g2xOSpn10Kd0FMWWO/ZyHUL3xvxczDjr3FbJP8Aql6EbaQX2hIYuIE38e8Jtwrr rnb/xn8S6dupLON1p4fYLRNk1D6ok77y+DltUnW4oqU0LQytlHzWtH1iTwLDow08SMtC 3soTTGptztq7InBN8882UgzuwdYYVPenb27fGhQDMtpGNiBafjOqVD1wopT2Ri9tTmCv fRvg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25si258917pfi.39.2018.02.13.10.54.59; Tue, 13 Feb 2018 10:55:13 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965601AbeBMSyK (ORCPT + 99 others); Tue, 13 Feb 2018 13:54:10 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33770 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965473AbeBMSyI (ORCPT ); Tue, 13 Feb 2018 13:54:08 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D38444023113; Tue, 13 Feb 2018 18:54:07 +0000 (UTC) Received: from [10.40.204.133] (ovpn-204-133.brq.redhat.com [10.40.204.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DE572166BC7; Tue, 13 Feb 2018 18:54:02 +0000 (UTC) Subject: Re: [PATCH] powerpc/via-pmu: Fix section mismatch warning To: Mathieu Malaterre , Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20180207194439.32680-1-malat@debian.org> From: Laurent Vivier Message-ID: Date: Tue, 13 Feb 2018 19:54:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180207194439.32680-1-malat@debian.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 13 Feb 2018 18:54:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 13 Feb 2018 18:54:07 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lvivier@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/02/2018 20:44, Mathieu Malaterre wrote: > Remove the __init annotation from pmu_init() to avoid the > following warning. > > WARNING: vmlinux.o(.data+0x4739c): Section mismatch in reference from the variable via_pmu_driver to the function .init.text:pmu_init() > The variable via_pmu_driver references > the function __init pmu_init() > If the reference is valid then annotate the > variable with __init* or __refdata (see linux/init.h) or name the variable: > *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console > > Signed-off-by: Mathieu Malaterre > --- > drivers/macintosh/via-pmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c > index 08849e33c567..5f378272d5b2 100644 > --- a/drivers/macintosh/via-pmu.c > +++ b/drivers/macintosh/via-pmu.c > @@ -378,7 +378,7 @@ static int pmu_probe(void) > return vias == NULL? -ENODEV: 0; > } > > -static int __init pmu_init(void) > +static int pmu_init(void) > { > if (vias == NULL) > return -ENODEV; > pmu_init() is really an init function only called by another init function (adb_init()). So I think it could be good to let the __init marker. Did you try: --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -198,7 +198,7 @@ static const struct file_operations pmu_battery_proc_fops; static const struct file_operations pmu_options_proc_fops; #ifdef CONFIG_ADB -struct adb_driver via_pmu_driver = { +const struct adb_driver via_pmu_driver = { "PMU", pmu_probe, pmu_init, Thanks, Laurent