Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4451926pxt; Wed, 11 Aug 2021 06:27:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4SxhG36BM8N6YGfibGLZMwosptfBbDM42zk1udzdvqG7fowQF222T2JNztd0Apzj4mQpc X-Received: by 2002:a17:907:2706:: with SMTP id w6mr3662255ejk.101.1628688458867; Wed, 11 Aug 2021 06:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628688458; cv=none; d=google.com; s=arc-20160816; b=pYT6S/MJmAGmUWFSYOEtz0IFERLgtbHjEp9aShEd0AnMnEBIoshJd5abo+Z9zDtqZv TiSTTwtJAlw+BH5AJHd0sr2fJWv0k19veBXvIkb/gRTLWgZKKTy75eU9BTnslrWGsdes t4ltC/xln8Fvu1+NDzJ8os1aP9PKWpclrN0DdSDKsDzon3nVUU+8zr7WjykNI22vi04S s8lM/fOYS3CUDjQY9rf3W6dcAL84pH3poGFxOvjzKrC2cz7722SD2G5Be4dr4yti5E3P /U3djIDFKRc6pw5VzXR5DF21u08o9Y8yxubTSQV4IZ+MAIQYQZRzi1JGGX/nnMvDout4 xGhg== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=EvirhJJ6QN5lblCbvvceb/s9moVHdiLpqS78/jKPOVg=; b=w/a6M71fuecJSxV7FmXwJVmVPjPAI99wUqsSuCSpt3fIjo7EY1eSNnIjjJ9mcqysKP NzcqZnJxTzHQwhBEYYNzwMv4V/nqONgzDzE2R/LhdJ2eaZtJuu0HsxdgTvVCZC1Dzn4v WejY18rtCoLrY+zVrk1T94ytJMQh4QZic9T5ifrdBPvkR6s5+c+DUX2RUT1oVEqljNDK fs28jp30NEN2XlSXp8ZfwzcT4kOLZUyPoFvxfvyoyVS4GPIW140Rfcr4NB7iuOSilcNJ fYaBlNv1q/yPs1sXmnmHZY33mxe/mKKpe5d7Q2tZuks4t9af+RFST5gul0zQQpXPV7fm zVdA== 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 ca23si3685152edb.598.2021.08.11.06.27.13; Wed, 11 Aug 2021 06:27:38 -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 S230486AbhHKN0O (ORCPT + 99 others); Wed, 11 Aug 2021 09:26:14 -0400 Received: from smtprelay0160.hostedemail.com ([216.40.44.160]:44116 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231405AbhHKNYL (ORCPT ); Wed, 11 Aug 2021 09:24:11 -0400 Received: from omf08.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id DB3C91807F217; Wed, 11 Aug 2021 13:23:44 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA id 593651A29FE; Wed, 11 Aug 2021 13:23:43 +0000 (UTC) Message-ID: Subject: Re: [PATCH net-next v2 2/2] bonding: combine netlink and console error messages From: Joe Perches To: Jakub Kicinski Cc: Jonathan Toppins , netdev@vger.kernel.org, leon@kernel.org, Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , linux-kernel@vger.kernel.org Date: Wed, 11 Aug 2021 06:23:41 -0700 In-Reply-To: <20210811054917.722bd988@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20210811054917.722bd988@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: 593651A29FE X-Spam-Status: No, score=1.56 X-Stat-Signature: 4djjjcjq8kkr7c1aewnaurrx6cw1hctk X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/EeNUAF09QPTMPt+4vmd/b8cehfzKAmU8= X-HE-Tag: 1628688223-324698 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-08-11 at 05:49 -0700, Jakub Kicinski wrote: > On Tue, 10 Aug 2021 20:27:01 -0700 Joe Perches wrote: > > > +#define BOND_NL_ERR(bond_dev, extack, errmsg) do { \ > > > + if (extack) \ > > > + NL_SET_ERR_MSG(extack, errmsg); \ > > > + else \ > > > + netdev_err(bond_dev, "Error: %s\n", errmsg); \ > > > +} while (0) > > > + > > > +#define SLAVE_NL_ERR(bond_dev, slave_dev, extack, errmsg) do { \ > > > + if (extack) \ > > > + NL_SET_ERR_MSG(extack, errmsg); \ > > > + else \ > > > + slave_err(bond_dev, slave_dev, "Error: %s\n", errmsg); \ > > > +} while (0) > > > > Ideally both of these would be static functions and not macros. > > That may break our ability for NL_SET_ERR_MSG to place strings > back in a static buffer, no? Not really. The most common way to place things in a particular section is to use __section("whatever") It's pretty trivial to mark these errmsg strings as above.