Thread (53 messages) flat view 53 messages, 4 authors, 2016-01-06

Re: [RFC PATCH net-next 05/24] phy: add phydev_name() macro

From: Joe Perches <joe@perches.com>
Date: 2016-01-04 17:48:50

On Mon, 2016-01-04 at 18:36 +0100, Andrew Lunn wrote:
Add a phydev_name() macro, to help with moving some structure members
from phy_device.
[]
quoted hunk ↗ jump to hunk
diff --git a/include/linux/phy.h b/include/linux/phy.h
[]
quoted hunk ↗ jump to hunk
@@ -783,6 +783,8 @@static inline int phy_read_status(struct phy_device *phydev)
 #define phydev_dbg(_phydev, format, args...)	\
 	dev_dbg(&_phydev->dev, format, ##args)
 
+#define phydev_name(_phydev) dev_name(&_phydev->dev)
+
This should use parentheses around phydev

#define phydev_name(phydev)	dev_name(&(phydev)->dev)

or likely even better be a static inline

static inline const char * phydev_name(const struct phy_device *phydev)
{
	return dev_name(&phydev->dev);
}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help