Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3888802pxk; Tue, 29 Sep 2020 08:41:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN3FOxWOOzGtpAxamkSkjq6IJgjLABksmPsycfApOvmZCwqOJvzfgxihFhQI6468VpATAk X-Received: by 2002:a05:6402:304f:: with SMTP id bu15mr3982493edb.201.1601394097278; Tue, 29 Sep 2020 08:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601394097; cv=none; d=google.com; s=arc-20160816; b=GHZU2VFjDVT9JY2IC7Dess2/K4PT+MND9gZRbPkF9DbC2iyAUIKsbtdo4NHUjMTXN9 oDitQLxUm3571xMnlFgyf+jra5cqK4MSHI7SZ4FctINi233TxUy38Ny19bpxiSs+5w2w n4a8g0Ts6sCNcnfvaIBU7v7P4z3kx74NMGPQgcL25NdIlFWAgaaX10ltzRetRCTDJFl6 nhn26QPcTHj9urdYdPLuh8e0jPqbvrapZduvbXbl/KHDqILfMO3fwpqmNVf/Gv67lpSM fa/Txf9khztT/ufeth+yYgdvDb6OQ94YxoqfBjBrw9sV8NXP24OWifxP2Q9Y7fjPeV69 26SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=b/ndqPAMEfMRymlJX6dxjBJfNF/RdG7bAvnqIWB8lEs=; b=Z5mZ5wn+lJ6LpHdZ8R9ciy/KL6ee4zTmgsNhGGV8P9e5Sy8oro/yVSRV9J2RK9B2Jr osH5JzgT3xVOJa/ZmJUd9xdhtLV2Hda/L34KdHm12mYYlXEznnJ72F5cXDnbLaCDFEuZ AzBHgmrnjPoSBS4mIHkBwK7zvu5sKvg/YbQg18Kn/Y1EdBcF5bQqbrWL8X7/VH/HrXo5 reC8NQ5A77GyrvZ6eCa1hdwMDONcaO/SZvx+DiHnnW1smaroreisLHUZX7dqSiQp8FhZ TlgxdH6lT7prYSVt7/9t4iQ8dOKwscX4/sgsP1w+cmflknaSRX5L+VECxX5xRC+7rh19 PnGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="m6ew1pj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si3031728edy.292.2020.09.29.08.41.13; Tue, 29 Sep 2020 08:41:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="m6ew1pj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729043AbgI2Pj4 (ORCPT + 99 others); Tue, 29 Sep 2020 11:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbgI2Pj4 (ORCPT ); Tue, 29 Sep 2020 11:39:56 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20FA8C061755 for ; Tue, 29 Sep 2020 08:39:56 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id e22so6841380edq.6 for ; Tue, 29 Sep 2020 08:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=b/ndqPAMEfMRymlJX6dxjBJfNF/RdG7bAvnqIWB8lEs=; b=m6ew1pj/QCtmtZdVPKnuFy/yv9ikzPhdzLQZb3eTh7KNJANrqRcPQiJEVwwigx97ST 7qToS47jUQXt9AY2dttqo+p/YyvGEMMH9woupRvvs/CwdLsLjYbwrE+EH+8VQsFit4UJ +CTrbQOEDF0pwC3LNjxK36v3KNrLTCnVcn9hqU/ysYdjhpyAFE5smjZi2UKRfcvJ0MYE XNIrg0HOOHpTGHP/WVefkWKXPCq+AdDbxDIAmSETPKQK1+a1K5bazpcKmhXcIORGxM0+ PP6Tqo0w+efWK18koinSdhezu0kZHorH69OHpLxvyETwOWeNBSFPivYsY/yJo7Iyulgr WZuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b/ndqPAMEfMRymlJX6dxjBJfNF/RdG7bAvnqIWB8lEs=; b=gRxIxMCdWEDLd3HGfkb9nRJUeih11Ae9UXJufpNbhrwdoNvfjAYhaNHnY7dCpHKlNa bUZCScYX8MSJ4PLLwoZZboTfKa0nF85B1RTPCwjt2UdCVhJ8mr+okYcgI4zfhIKaA4AR y7fF6Kr1R5XRrrysfVoRzE6CkVAkLSTu2CsJlzXI+QNuxby+Zjb4+fKsGhc9sbOV15vv hOBqMhFaagp6sLPDpc7V18BY2ZaQlQzETaN1t6ybgPY/iDQzknwGw3a7HSJLDAhs95YD vBZwhCXsiqshjqdKC+enb81VJyH7H4myaEfo9xlizmpEargzzAqmV1vrIBQ1paFTEuo+ YW6A== X-Gm-Message-State: AOAM531Mtv0Jp2xPI0y6byar3Us86oGxYPqA48hnQ7HDygUD+Ep+vh6Z xKQCPepZQIGoU0zclicq6E3Wu+U8IY1lboUagjtyVg== X-Received: by 2002:a05:6402:78b:: with SMTP id d11mr4046267edy.341.1601393994450; Tue, 29 Sep 2020 08:39:54 -0700 (PDT) MIME-Version: 1.0 References: <20200928230939.5574-1-natechancellor@gmail.com> In-Reply-To: <20200928230939.5574-1-natechancellor@gmail.com> From: Sami Tolvanen Date: Tue, 29 Sep 2020 08:39:43 -0700 Message-ID: Subject: Re: [PATCH] static_call: Fix return type of static_call_init To: Nathan Chancellor Cc: Ingo Molnar , Peter Zijlstra , Josh Poimboeuf , "Steven Rostedt (VMware)" , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nathan, On Mon, Sep 28, 2020 at 4:09 PM Nathan Chancellor wrote: > > Functions that are passed to early_initcall should be of type > initcall_t, which expects a return type of int. This is not currently an > error but a patch in the Clang LTO series could change that in the > future. > > Fixes: 9183c3f9ed71 ("static_call: Add inline static call infrastructure") > Link: https://lore.kernel.org/lkml/20200904044559.GA507165@ubuntu-n2-xlarge-x86/ > Link: https://lore.kernel.org/lkml/20200903203053.3411268-17-samitolvanen@google.com/ > Signed-off-by: Nathan Chancellor > --- > include/linux/static_call.h | 6 +++--- > kernel/static_call.c | 5 +++-- > 2 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/include/linux/static_call.h b/include/linux/static_call.h > index bfa2ba39be57..695da4c9b338 100644 > --- a/include/linux/static_call.h > +++ b/include/linux/static_call.h > @@ -136,7 +136,7 @@ extern void arch_static_call_transform(void *site, void *tramp, void *func, bool > > #ifdef CONFIG_HAVE_STATIC_CALL_INLINE > > -extern void __init static_call_init(void); > +extern int __init static_call_init(void); > > struct static_call_mod { > struct static_call_mod *next;Thank you for sending the patch, this looks correct to me. > @@ -187,7 +187,7 @@ extern int static_call_text_reserved(void *start, void *end); > > #elif defined(CONFIG_HAVE_STATIC_CALL) > > -static inline void static_call_init(void) { } > +static inline int static_call_init(void) { return 0; } > > struct static_call_key { > void *func; > @@ -234,7 +234,7 @@ static inline int static_call_text_reserved(void *start, void *end) > > #else /* Generic implementation */ > > -static inline void static_call_init(void) { } > +static inline int static_call_init(void) { return 0; } > > struct static_call_key { > void *func; > diff --git a/kernel/static_call.c b/kernel/static_call.c > index f8362b3f8fd5..84565c2a41b8 100644 > --- a/kernel/static_call.c > +++ b/kernel/static_call.c > @@ -410,12 +410,12 @@ int static_call_text_reserved(void *start, void *end) > return __static_call_mod_text_reserved(start, end); > } > > -void __init static_call_init(void) > +int __init static_call_init(void) > { > int ret; > > if (static_call_initialized) > - return; > + return 0; > > cpus_read_lock(); > static_call_lock(); > @@ -434,6 +434,7 @@ void __init static_call_init(void) > #ifdef CONFIG_MODULES > register_module_notifier(&static_call_module_nb); > #endif > + return 0; > } > early_initcall(static_call_init); > > > base-commit: de394e7568ce2cdb4643ed230169f484f25f9442 > -- > 2.28.0 Thank you for sending the patch, this looks correct to me. Reviewed-by: Sami Tolvanen Sami