Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1838696pxt; Sun, 8 Aug 2021 03:18:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6w7i5bCx++RrGXRGC7ESM7l0b2Gfxm8yU2i9nTvQboD3AE9DcfSylEEvFOtKiVcQuKbGY X-Received: by 2002:a05:6e02:1bc7:: with SMTP id x7mr3024968ilv.116.1628417918502; Sun, 08 Aug 2021 03:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628417918; cv=none; d=google.com; s=arc-20160816; b=lpmnYD6UykAxRyulMumyDdTEHy0JvKNTplQq8k2Fj7LAniyaV3/XpRpOa53o66r4p4 XOZBr04XSxIaFfEWWh92mf/+fA64hWP4fVFerFtdiHYVsDwbPWIHvWgFV2DOmwP4DyCF DWcQTB1bi/0Sf8KZI3mGmbKs7sJLnSV9g5TEWdKF8w0K2Ekg0qK5YVLupJOj2irMkK9Q EJRQc7k1wDGl20k19BtBcrfGnulxL5KxJK7m/bGfzPTAyqKRYlmznOaSV1zANMcZ10I2 +hk0wXgIzUaKkJbyahyPpUblKtgo7m+nC+eGjYLQhztsYf7ro/NApeXeyrg6//UK79mx DPag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ight+ZAg3FYdozaduJt+c/JNVEAyTizQXHeSM7xGViM=; b=xGmvlQu7FvjS9FQMBjDA14izm8LF/xwAd8zddjQxPjVrVzTLTdR9UefmjTF9Cg53KK Ou/vwKf0b9CJY/NQjX6b7U/VcrKH606usFUK5fxd5bS27FDBB6wxXHQmDpvCNWI/o40j W6UieK3AYBpi1GZ9DN7pjlBXP3FMz3q4DoJJ6fQdQHYKYd52YXe0Ynz0ZiP63R/4qted 8TMSgtrXFOzW1b1fU0pnBCgbIG4Uuah7ukrpz3gT8WveAlCWMDKW7yUpeRVIQn7Bce5i wEhtebrZ0MULR1YF0LgJVL5XBzET6YgGlFunb9vy8Wo+8zow2t7WZJJYZJuHRjf7DDlL mfjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wa1neRgs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si17295625ilc.93.2021.08.08.03.18.13; Sun, 08 Aug 2021 03:18: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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wa1neRgs; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbhHHKRK (ORCPT + 99 others); Sun, 8 Aug 2021 06:17:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:41678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbhHHKRJ (ORCPT ); Sun, 8 Aug 2021 06:17:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 566D261002; Sun, 8 Aug 2021 10:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628417811; bh=X9dnTD0xyKMIdTIRG+oJBdvfJeZaP8irwsirpacwiZ0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Wa1neRgs6ZQchJmGvV2//Z3KqL0LzwQa2fSBU2jlLzqJ3o1SxAXyj76TV32RtoeNK E8tPA1RBLqZJskjm/0VitWGAZD1elaq6cgm0IokCgaCjaaWQbgEo+1gGp9ZHmrCVBr luRZQ4+4vgnmk2M0zjHENrcQJbjS9WO5p1dl8IeflUZRlfZBxNh4DDCRt8LIHFSd1Q cC154kLyWE63rE4vtbWY63KCmLvdS0iK6USw9Dx8YkGJbDw6WTluIVzZIzDw1uOEOP JAaiz8yNg56rcZccmt/wvewDjTTbxWgC2UI5xl3HoDOGf8EaYmOVjQLmsRbjLxfTJT rQygtY0KjZjKw== Date: Sun, 8 Aug 2021 13:16:46 +0300 From: Leon Romanovsky To: Jonathan Toppins Cc: netdev@vger.kernel.org, Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/2] bonding: combine netlink and console error messages Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 06, 2021 at 11:30:55PM -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. > > Signed-off-by: Jonathan Toppins > --- > drivers/net/bonding/bond_main.c | 45 ++++++++++++++++++--------------- > 1 file changed, 25 insertions(+), 20 deletions(-) > > diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c > index 3ba5f4871162..46b95175690b 100644 > --- a/drivers/net/bonding/bond_main.c > +++ b/drivers/net/bonding/bond_main.c > @@ -1712,6 +1712,16 @@ void bond_lower_state_changed(struct slave *slave) > netdev_lower_state_changed(slave->dev, &info); > } > > +#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) I don't think that both extack messages and dmesg prints are needed. They both will be caused by the same source, and both will be seen by the caller, but duplicated. IMHO, errors that came from the netlink, should be printed with NL_SET_ERR_MSG(), other errors should use netdev_err/slave_err prints. Thanks