[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5e1aada694465fd62f57695e264259815e60746.camel@perches.com>
Date: Tue, 10 Aug 2021 20:27:01 -0700
From: Joe Perches <joe@...ches.com>
To: Jonathan Toppins <jtoppins@...hat.com>, netdev@...r.kernel.org,
leon@...nel.org
Cc: Jay Vosburgh <j.vosburgh@...il.com>,
Veaceslav Falico <vfalico@...il.com>,
Andy Gospodarek <andy@...yhouse.net>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2 2/2] bonding: combine netlink and console
error messages
On Tue, 2021-08-10 at 22:53 -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 <jtoppins@...hat.com>
> ---
>
> Notes:
> v2:
> - changed the printks to reduce object code slightly
> - emit a single error message based on if netlink or sysfs is
> attempting to enslave
> - rebase on top of net-next/master and convert additional
> instances added by XDP additions
>
> drivers/net/bonding/bond_main.c | 69 ++++++++++++++++++---------------
> 1 file changed, 37 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
[]
> @@ -1725,6 +1725,20 @@ void bond_lower_state_changed(struct slave *slave)
> netdev_lower_state_changed(slave->dev, &info);
> }
>
> +#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.
Powered by blists - more mailing lists