Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp999768pxt; Fri, 6 Aug 2021 20:56:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMiLGGI+BJJVnH/I93fxkHfOXPvWTsPd2AtMSnzbmyTXx7/uMB3ONfmLrn6f+4gtSiNqUh X-Received: by 2002:a17:906:144e:: with SMTP id q14mr12998564ejc.19.1628308615346; Fri, 06 Aug 2021 20:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628308615; cv=none; d=google.com; s=arc-20160816; b=dtu2+37AH9xZkbbTWZhyuCsge5anInEY5mBO2tWYvu9uVx2SDFjym7LKwFieuoLMC1 tWP81gGLNx7rsbenEou/rKmoHwGxkP0Lpph8HEJ1HyJGTltRBz55tjD7hqW/o9fjJW8p UAoXtz7JNvWAaEN+pmdRhMYHdiKECWSezQWVbQXLkMU9GexegW2LYwv/GaZ2PXk+hWYJ bTk6zDsyaR2L/JoNDfkG1fw+kqHNWtETSqL9qVNsXojiNLWvNYP79gcHwQF81KDCr6Gi kI77IzNVkgb/lcwrH7H0/25AVqQud+XXv3M8feGfsVNSvkO9VoJFbjyLQqsT83E7tfXL Xm5A== 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=PgZO0USzYZb0Z8qu4KhZ8SlIna5m9fwbhHUgvvumWdA=; b=OBtYjzoQbiW48ANFRjmU96HfR6kk09pttAXm66H9KVMl9e+tN4icH0HJuiKmfqUEgV zuFHC2oXNshmwR3Yu7M1/h3oLUT1lyLuC89uLHP0MtIsFkaVfO61IEoplJMfPgJv0yHj oK3EACcdbjdwbN3FwfAa/8Sk3ajvGYV83rNhum+FFo8U86it4GAol+0+TzRVkcs7jgYD l9LPkMDCh9SEMdnzU0QSdlvDMyq5sd1CIrJn7WIsNoazoqOMpoMEgnrWSk7eQMJxPya0 68Y/nfp+iWPGnOMVXAIkNEU3OfGxJJU5D0qZH70lcSa7OM37l6QuzjcTdGpItA5ntHcc 9hWg== 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 e1si11379543edl.348.2021.08.06.20.56.33; Fri, 06 Aug 2021 20:56:55 -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 S230510AbhHGDws (ORCPT + 99 others); Fri, 6 Aug 2021 23:52:48 -0400 Received: from smtprelay0174.hostedemail.com ([216.40.44.174]:58550 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230144AbhHGDwr (ORCPT ); Fri, 6 Aug 2021 23:52:47 -0400 Received: from omf16.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 50B54202FE; Sat, 7 Aug 2021 03:52:30 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA id 180B6255112; Sat, 7 Aug 2021 03:52:28 +0000 (UTC) Message-ID: <37c7bbbb01ede99974fc9ce3c3f5dad4845df9ee.camel@perches.com> Subject: Re: [PATCH net-next 2/2] bonding: combine netlink and console error messages From: Joe Perches To: Jonathan Toppins , netdev@vger.kernel.org Cc: Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org Date: Fri, 06 Aug 2021 20:52:27 -0700 In-Reply-To: References: 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: rspamout03 X-Rspamd-Queue-Id: 180B6255112 X-Spam-Status: No, score=-0.76 X-Stat-Signature: a577bogzupnxsjdub1xh6gonof1eoazw X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+/yXwzhyRhXkajZ0vJp1z3F0z122Pyujo= X-HE-Tag: 1628308348-626008 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-08-06 at 23:30 -0400, Jonathan Toppins wrote: > There seems to be no reason to have different error messages between > netlink and printk. It also cleans up the function slightly. [] > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c [] > +#define BOND_NL_ERR(bond_dev, extack, errmsg) do { \ > + NL_SET_ERR_MSG(extack, errmsg); \ > + netdev_err(bond_dev, "Error: " errmsg "\n"); \ > +} while (0) > + > +#define SLAVE_NL_ERR(bond_dev, slave_dev, extack, errmsg) do { \ > + NL_SET_ERR_MSG(extack, errmsg); \ > + slave_err(bond_dev, slave_dev, "Error: " errmsg "\n"); \ > +} while (0) If you are doing this, it's probably smaller object code to use "%s", errmsg as the errmsg string can be reused #define BOND_NL_ERR(bond_dev, extack, errmsg) \ do { \ NL_SET_ERR_MSG(extack, errmsg); \ netdev_err(bond_dev, "Error: %s\n", errmsg); \ } while (0) #define SLAVE_NL_ERR(bond_dev, slave_dev, extack, errmsg) \ do { \ NL_SET_ERR_MSG(extack, errmsg); \ slave_err(bond_dev, slave_dev, "Error: %s\n", errmsg); \ } while (0)