Thread (22 messages) flat view 22 messages, 5 authors, 2021-08-11

Re: [PATCH net-next v2 2/2] bonding: combine netlink and console error messages

From: Joe Perches <joe@perches.com>
Date: 2021-08-11 13:25:53
Also in: lkml

On Wed, 2021-08-11 at 05:49 -0700, Jakub Kicinski wrote:
On Tue, 10 Aug 2021 20:27:01 -0700 Joe Perches wrote:
quoted
quoted
+#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.


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help