From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751824AbdIOTXh (ORCPT ); Fri, 15 Sep 2017 15:23:37 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:59692 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388AbdIOTXf (ORCPT ); Fri, 15 Sep 2017 15:23:35 -0400 From: Arnd Bergmann To: David Kershner , Greg Kroah-Hartman Cc: Arnd Bergmann , Tim Sell , Sameer Wadgaonkar , David Binder , Bryan Thompson , sparmaintainer@unisys.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: unisys/visorbus: add __init/__exit annotations Date: Fri, 15 Sep 2017 21:23:13 +0200 Message-Id: <20170915192327.414928-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:sC74jwEVfLzGgMJFx1lN+Tv67dtIM2f0ThkaAwc+SQfXf9rW+H1 nHDAyH+35jvuzvjd768wYaRv9Qch3QjZirIXOWQAbHDo27TZG4rc/8AjFB766/Hj6KoIKjx iATv24cQWTVYjwL+4q9oZZ5AKLyEpahBasVhot5nuZkxv4fxm9Y/PYaIDZUSzxuIz4IZ8d6 ucJYHb18q/mlMy3jBSovQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:YnFwRjhVw50=:7k5t1bRXdbZtJ6x/lKTCab G17Q6TxOilqqZrZ7yBkw72g3T/NHjrwCxMeKUB8okmzyopOePFk5//vH7E9aYWr1SIFI+pSww gYrzq/EYEZmX9avduBb+97k9iIJXd+fviN6egNF7AelKDMIoP6YKIMgK6xiSJWLHWSzA1OD++ oeQXFuQwB8gsqSigPpxeSoSl1q1gKcTSlo+lbJ4Rjvv/Rzb75c6IFpqQvyMFnkXMmtFuxpRZO CPBq36NF6FQYFbszkZoAUftw51+5qvMS8nitDAPrIvRVjZrOF7CvR0RZ8G81Jzd17eOxeKf3F 5pyS0IoGtbHwOWtDMVr/wQvYYq1WHA1zn9KOefZng1GGIdsk1YiJN414qFd+NkC+1EYFuSlPj 1SyBO7bAysQO1qRad66498CYYKCSqAxdumI5nlS+rd4f4zabNNjRFBvdqdPCcZmvDEMvLXGiS 0qLzFpN6479RAkW4z5idRRFsbgljMiJ2a+BMQutoUQ12+PO8VSlNLkYmwapqSnvbn+jIVmASf hJn3Cltyng09szL/rqazrBbN41zDDLoLb87ieYISPkNxCWFgVXozwR0VtRnnmNtzncFFqFGSR pAMJIbZCTQPIOwY5HMZvK2+r+oo7pgYFoR1JkH9hjud61MxAMq1VNZhTT6gDrl8mmURqFrSmx w8NKAYswD9FB+5e5fhx/cTSE9i4jJ7LS6C0au6xbU6FjJmiROxw3WsuLr+cfR4QJxSAi4T51a aVh+O3TKm0SwOEYsGJMorwLBmNhGD10MUzT+ow== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-4.6 causes a harmless warning about the init function: WARNING: vmlinux.o(.text+0xed62c2): Section mismatch in reference from the function init_unisys() to the function .init.text:visorutil_spar_detect() The function init_unisys() references the function __init visorutil_spar_detect(). This is often because init_unisys lacks a __init annotation or the annotation of visorutil_spar_detect is wrong. It appears that newer versions inline visorutil_spar_detect(), end up with an empty __init section. This marks the module entry points as __init and __exit respectively, which avoids the warning and slightly reduces the runtime code size. Signed-off-by: Arnd Bergmann --- drivers/staging/unisys/visorbus/visorchipset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 74cce4f1a7bd..27ecf6fb49fd 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1826,7 +1826,7 @@ static __init int visorutil_spar_detect(void) return 0; } -static int init_unisys(void) +static int __init init_unisys(void) { int result; @@ -1841,7 +1841,7 @@ static int init_unisys(void) return 0; }; -static void exit_unisys(void) +static void __exit exit_unisys(void) { acpi_bus_unregister_driver(&unisys_acpi_driver); } -- 2.9.0