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 BE40DC74A5B for ; Thu, 23 Mar 2023 17:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231163AbjCWRPv (ORCPT ); Thu, 23 Mar 2023 13:15:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229796AbjCWRPu (ORCPT ); Thu, 23 Mar 2023 13:15:50 -0400 Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB0D624CAA for ; Thu, 23 Mar 2023 10:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1679591750; x=1711127750; h=references:from:to:cc:date:in-reply-to:message-id: mime-version:subject; bh=H9FCwyOBIMI7LAIdMYKzQmwNUK+qazmGbPFABy0XitI=; b=pIiYz4NRhWIEavgl3htF9w767X+C/HEe5V6pkU/2Xup9BemuF9qeAOEM Yt3a4FUk1GEurxOEQFcAB6RAzvAGklOPY3SoNYdtEOB4qA7IaKqy5IE2k Fp/+r9jjNueE916w68a5xwd1imAJrsB5hz2g3dWUd7IrUz9a3z9X9stAT c=; X-IronPort-AV: E=Sophos;i="5.98,285,1673913600"; d="scan'208";a="196758202" Subject: Re: [PATCH v6 net-next 1/7] netlink: Add a macro to set policy message with format string Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2a-m6i4x-8a14c045.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 17:15:37 +0000 Received: from EX19D009EUA002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-pdx-2a-m6i4x-8a14c045.us-west-2.amazon.com (Postfix) with ESMTPS id 4200782DA8; Thu, 23 Mar 2023 17:15:36 +0000 (UTC) Received: from EX19D028EUB003.ant.amazon.com (10.252.61.31) by EX19D009EUA002.ant.amazon.com (10.252.50.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 23 Mar 2023 17:15:35 +0000 Received: from u570694869fb251.ant.amazon.com.amazon.com (10.85.143.179) by EX19D028EUB003.ant.amazon.com (10.252.61.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.24; Thu, 23 Mar 2023 17:15:23 +0000 References: <20230320132523.3203254-1-shayagr@amazon.com> <20230320132523.3203254-2-shayagr@amazon.com> <20230322114041.71df75d1@kernel.org> <20230323095454.048d7130@kernel.org> User-agent: mu4e 1.8.13; emacs 28.0.91 From: Shay Agroskin To: Jakub Kicinski CC: Paolo Abeni , David Miller , , "Woodhouse, David" , "Machulsky, Zorik" , "Matushevsky, Alexander" , Saeed Bshara , "Wilson, Matt" , "Liguori, Anthony" , "Bshara, Nafea" , "Belgazal, Netanel" , "Saidi, Ali" , "Herrenschmidt, Benjamin" , "Kiyanovski, Arthur" , "Dagan, Noam" , "Arinzon, David" , "Itzko, Shahar" , "Abboud, Osama" , Eric Dumazet , Vladimir Oltean , Andrew Lunn , Guangbin Huang , Jie Wang , Johannes Berg , Edward Cree , "Florian Westphal" Date: Thu, 23 Mar 2023 19:13:15 +0200 In-Reply-To: <20230323095454.048d7130@kernel.org> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Originating-IP: [10.85.143.179] X-ClientProxiedBy: EX19D033UWA003.ant.amazon.com (10.13.139.42) To EX19D028EUB003.ant.amazon.com (10.252.61.31) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Jakub Kicinski writes: > CAUTION: This email originated from outside of the > organization. Do not click links or open attachments unless you > can confirm the sender and know the content is safe. > > > > On Thu, 23 Mar 2023 18:38:59 +0200 Shay Agroskin wrote: >> Couldn't find a way to avoid both code duplication and >> evaluating >> extact only once \= Submitted a new patchset with the modified >> version of this macro. > > That's why we have the local variable called __extack, that we > *can* > use multiple times, because it's a separate variable, (extack) > is > evaluated only once, to initialize it... > > We don't need to copy the string formatting, unless I'm missing > something. Paolo was just asking for: > > - NL_SET_ERR_MSG_FMT(extack, fmt, ##args); > + NL_SET_ERR_MSG_FMT(__extack, fmt, ##args); > > that's it. Oh shoot... That makes much more sense than my solution .... Thanks