Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3692530pxf; Mon, 22 Mar 2021 12:34:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkzUmw1WIuq3sM8PYqeTAatkJIEG7fwqtc97jFurUrqL/MyOddJ2dUzMFQ6X2siLgCxBuU X-Received: by 2002:a05:6402:4415:: with SMTP id y21mr1235939eda.70.1616441649776; Mon, 22 Mar 2021 12:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616441649; cv=none; d=google.com; s=arc-20160816; b=wJJLcVkE28kH4lUHhR4tlrTZxzvsYVycZsUhwBaawUZ2LSbB2P1POBXkl59is88PMw 2NQa4EHziWBS4H9fci1ns7WxQROHL+4h2z67apI+4Vp925/dVNk07wLM6/SuXoWry4eb uxSNtD9/9jSYMTx4BUSpy+Mu1sqDCT5cK8LIku2IdyasEXNwbYYCvQp2ovKMrrmJT2sQ WP+ag5QfRwEbyhq8XsAlODqiXiSL6LxVDlfnnI2dmRDleySmCoBrD+oWyBwikTQU8+3J gPPn8TnMGHfptlzcrtBilH2NgFRcwWB6CHhwgbmhcqWx+qY/Hv0nRcsitanW9E+X1AHh 2r2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Sc6IExcQ9aFqKbLw73hKIo0oGueDF6bGSVCebqi1U+g=; b=whLMNAjHCgrIGmDWziyFDjnLoYZDSr42fZRCtRAfUncSB6SI9SW1GixvUavrWmvvMS vwIv+JmpciQbCKSFfWvsznB24FPIix3HCD50fHrXOUBTsGR/zZev5jVKoyEmG9bmTaLl JTramz62QH2oL1tyKcM94oHu7/+L/0GRSuDakGG3aT70FkBSiXPwr81cnXU685uDqnMc HpwclIbKM4YNCIS1TpXXjx//YFRdRymuuh5e2yzvPVNimmxCx3zZlBaCRcAe+tSiLebd HGEWsQjCMfe6Kuj9tzHrEba+u51RhkJF3qpzeAR3fmOGpxrX/2RcPt1wZjMlL1N1b1QZ Navg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b68si13135555edf.477.2021.03.22.12.33.45; Mon, 22 Mar 2021 12:34:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230510AbhCVTct (ORCPT + 99 others); Mon, 22 Mar 2021 15:32:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbhCVTcT (ORCPT ); Mon, 22 Mar 2021 15:32:19 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2DDD96199E; Mon, 22 Mar 2021 19:32:17 +0000 (UTC) Date: Mon, 22 Mar 2021 15:32:14 -0400 From: Steven Rostedt To: Arnd Bergmann Cc: Peter Zijlstra , Josh Poimboeuf , Jason Baron , Ingo Molnar , Juri Lelli , Vincent Guittot , Arnd Bergmann , Ard Biesheuvel , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Frederic Weisbecker , linux-kernel@vger.kernel.org Subject: Re: [PATCH] static_call: fix function type mismatch Message-ID: <20210322153214.25d869b1@gandalf.local.home> In-Reply-To: <20210322170711.1855115-1-arnd@kernel.org> References: <20210322170711.1855115-1-arnd@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Mar 2021 18:06:37 +0100 Arnd Bergmann wrote: > From: Arnd Bergmann > > The __static_call_return0() function is declared to return a 'long', > while it aliases a couple of functions that all return 'int'. When > building with 'make W=1', gcc warns about this: > > kernel/sched/core.c:5420:37: error: cast between incompatible function types from 'long int (*)(void)' to 'int (*)(void)' [-Werror=cast-function-type] > 5420 | static_call_update(might_resched, (typeof(&__cond_resched)) __static_call_return0); > > Change the function to return 'int' as well, but remove the cast to > ensure we get a warning if any of the types ever change. I think the answer is the other way around. That is, to make the functions it references return long instead. __static_call_return0 is part of the dynamic call infrastructure. Perhaps it is currently only used by functions that return int, but what happens when it is used for a function that returns a pointer? -- Steve > > Signed-off-by: Arnd Bergmann > ---