Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE178C6FD19 for ; Fri, 10 Mar 2023 21:10:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231499AbjCJVKB (ORCPT ); Fri, 10 Mar 2023 16:10:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230118AbjCJVJ7 (ORCPT ); Fri, 10 Mar 2023 16:09:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6CD91204A6 for ; Fri, 10 Mar 2023 13:09:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A427FB8240B for ; Fri, 10 Mar 2023 21:09:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DC18C433EF; Fri, 10 Mar 2023 21:09:54 +0000 (UTC) Date: Fri, 10 Mar 2023 16:09:52 -0500 From: Steven Rostedt To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Mark Rutland , Jason Baron , Ard Biesheuvel , Christophe Leroy , Paolo Bonzini , Sean Christopherson Subject: Re: [RFC][PATCH 0/5] Improve static call NULL handling Message-ID: <20230310160952.161d6833@gandalf.local.home> In-Reply-To: References: 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 Fri, 10 Mar 2023 12:31:12 -0800 Josh Poimboeuf wrote: > static_call_update(foo, STATIC_CALL_NOP); // do nothing and return 0 > static_call_update(foo, STATIC_CALL_BUG); // panic > static_call_update(foo, NULL); // ??? > > The default behavior for NULL could be a key-specific policy, stored as > a flag in the static_call_key struct. Could we just get rid of the ambiguity and make static_call_update(foo, NULL); trigger a WARN_ON() instead, and always do nop? The issue I have with allowing NULL, is that it's not easy to know from the call site what it does. -- Steve