From mboxrd@z Thu Jan 1 00:00:00 1970 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 0B80AC61DA4 for ; Mon, 13 Mar 2023 20:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229800AbjCMU4t (ORCPT ); Mon, 13 Mar 2023 16:56:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjCMU4s (ORCPT ); Mon, 13 Mar 2023 16:56:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E0A81CD1 for ; Mon, 13 Mar 2023 13:56:47 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5FABB61468 for ; Mon, 13 Mar 2023 20:56:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B9FFC433D2; Mon, 13 Mar 2023 20:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678741006; bh=eidNKinYLbSYCW/7JBmA+DqDOlj6BxT/8lPP0eclIaA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MtrPfOaXMHTKaVzRMc1nn3R7RKbhMRZlNCWe5Cs2R5e+N+sp8nDPr3cyEr3KZEz/W 9ISSiyX3XLVtqgwNYuK1ddSH5opblkAKnPMr5BzkIFk5r98Z0li+0+cVWITsvoOKtP dwp0B3pJorFbxsA21KXSqLnrhZguKL1VCWCb+Qgatf6pxyR98RNp9Nih7Zq1AmoNtz BDjJx8Vq1SzQ5/Y9A67/ftgtK6xpk2n9FgdzjBtiPvRGVzSn7bXEOcDm7tceu/TYuO PvUL8X9Yq179eOBbvyDqD+HgGbosZBFAWmiBOEPmYHZyOkYSKpbvxcXgA7D+cVf9cf o77Dos+2QvELw== Date: Mon, 13 Mar 2023 13:56:40 -0700 From: Jakub Kicinski To: Stephen Hemminger Cc: Willem de Bruijn , netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, alexanderduyck@fb.com, roman.gushchin@linux.dev Subject: Re: [RFC net-next 1/3] net: provide macros for commonly copied lockless queue stop/wake code Message-ID: <20230313135640.3a511db0@kernel.org> In-Reply-To: <20230312184515.5eabc8df@hermes.local> References: <20230311050130.115138-1-kuba@kernel.org> <20230311082826.3d2050c9@hermes.local> <640e7e633acec_24c5ed2088c@willemb.c.googlers.com.notmuch> <20230312184515.5eabc8df@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, 12 Mar 2023 18:45:15 -0700 Stephen Hemminger wrote: > > > Could any of these be inline functions instead for type safety? > > > > I suppose not because of the condition that is evaluated. > > It is more that the condition needs to evaluated after some other > pre-conditions. Right, I think I could slice off individual chunks and wrap them in static inlines, but I reckon the result is relatively readable now?