Received: by 10.223.185.116 with SMTP id b49csp1204702wrg; Wed, 14 Feb 2018 13:18:31 -0800 (PST) X-Google-Smtp-Source: AH8x225RD9SuOFtLA78EwjdA4x0tCDjEkpTerchpFhE56UgRJWe9T+SAQzZZzStDCb3aj82LfaAw X-Received: by 2002:a17:902:2943:: with SMTP id g61-v6mr320674plb.435.1518643111471; Wed, 14 Feb 2018 13:18:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518643111; cv=none; d=google.com; s=arc-20160816; b=svpmTKvoyU8uy78b9eLjqeswyRNvwLtX/K32rXqrb31CtPKk2vvye6uLqietG1Ivqy jG9J5xPtbqQLGMcPAufetTDkwu1J9OahnqXwJNz2s0TfOUEPPAFJ9qfGNoiwmmduZTGz trSt2nbJxVmvopzFrBT7kMcuBNpvPYFPaBttCK10a1u5BATj/070uS4sqWRzWPzfQESr RIo6qX+LsoPRwsLrg34AOwkkmwQVaSB5d+mwLV1W9R7mL1r58PwnTL9pn4rLOHqmqwiE Tq9B7OO5Je269rwgbHR+cSwD8UUR4GAziNoXhl9Bqnh7EffoB6k24HMN9/+VDQ57E8Mz ZrVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=hftVGmOf6xTwWqBq956MbvOYoWIul61UKCZ4HSQwYP4=; b=z16LkCeO2inQSA9J/FJjYATpvNK42PeUO5BULw0rZS/AUO0UEIFw1dR/V5lfeyI5WZ zvcrqLM9L53jk+J8p6EFMIA1Q/gqF+X+cPE+vOtjHg6rgl3BNpqNE0nnxvVHh7zYyJDi CgVzeSHgxC13M0tk/D1Xag5jT6FZdd3Nq5e0i/oBvK53fGl++tMZAY6+5oSV/GI0nCZH ZJd8C9mVaIEn5nx4V855V4zuKfrSvDT8plSXhJIgC7SCUMN2dDav0h18nhTzrnSM23xo GdUqAJv84RQBajdg7ryN2tnVXVzEdwhP97dIWTM7lrErxwTB2XS/z43hpaFZ/KcMumVn er9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Kcp27MIt; 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 t76si3195314pgc.273.2018.02.14.13.18.16; Wed, 14 Feb 2018 13:18:31 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Kcp27MIt; 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 S1031232AbeBNVRD (ORCPT + 99 others); Wed, 14 Feb 2018 16:17:03 -0500 Received: from mail-ua0-f194.google.com ([209.85.217.194]:34385 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030501AbeBNVRC (ORCPT ); Wed, 14 Feb 2018 16:17:02 -0500 Received: by mail-ua0-f194.google.com with SMTP id m43so1780521uah.1 for ; Wed, 14 Feb 2018 13:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hftVGmOf6xTwWqBq956MbvOYoWIul61UKCZ4HSQwYP4=; b=Kcp27MItxXvrc0Rt7ryGTM24MHHUleRS0GrgMdx8zC8WUf6sF8YpHm34rbY6aJSrCS eLFVwcGFmmBtWFYgoLZU2s9PUlYla9WCdhSRdVzEbuPT2YDZjGlRfVZ4RMoUhXTf0mVv ig3UMcx5Fe5CvFX4bl6AWT2oxqzE9d4RU6KyFTmskc+9t30R/9GeJO4DT/0fmqiEFv6o v4SjVWgZNePGz0ay3XR2I34ptep9L5N9FlhuB1gcUJyXXgz5azJJI3DkslksWxf2M4xk 3GcAWVibjNbhGj8MNMVxxsVfKtskrMk+BHdAGwKJ6BHo9Fznx3BOBVUwdoF7RskWxofl tUjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hftVGmOf6xTwWqBq956MbvOYoWIul61UKCZ4HSQwYP4=; b=gyfR+rsREBEGNSF8NfdmhRcdCQoHiTfFVK6R7HvW6wkkky2Or/VhMJ5MmSsmbWrxhW mjFdvIHcGc73o9b5Zpl8i+VMx4vbo7KELBOSu8vNm9LLFqaWEg50U1h8vpbuqv/37v8a Z1OhkjZ0oHe//FMhkeu15JWfA0hKZiYPEP9d/epL0thuQfT5FtnWZI9dJQbEZDnXk8pW 5bIhu4hB6HCbXhhjOq6ivRgFImyldz4XgAuCBcsZ5wn4gAah5DKQACaAcJ8eI37Ko/06 /cdaItFsGQ1dXv/cFFynZVEaQN5Q+EMdirgYVeyqIHrRSjG2VAUjA/56L4Zm+2Acx4MH DS+w== X-Gm-Message-State: APf1xPDMGH2C5tosgZvC6STnewxwaUCuPgY6Qz4kTnh4iahYGUFU5xbC /Egs41pQydbs0lHdZsJEECb9c5r2dIhtQC+9LSk= X-Received: by 10.176.13.130 with SMTP id i2mr539165uak.85.1518643021934; Wed, 14 Feb 2018 13:17:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.159.38.193 with HTTP; Wed, 14 Feb 2018 13:16:41 -0800 (PST) In-Reply-To: References: <20180207194439.32680-1-malat@debian.org> From: Mathieu Malaterre Date: Wed, 14 Feb 2018 22:16:41 +0100 X-Google-Sender-Auth: iaPuJsfXXCgIwf62gcM-2B7XkSU Message-ID: Subject: Re: [PATCH] powerpc/via-pmu: Fix section mismatch warning To: Laurent Vivier Cc: Michael Ellerman , linuxppc-dev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 13, 2018 at 7:54 PM, Laurent Vivier wrote: > 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, > > Indeed much better ! Thanks