[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200801094707.13449-1-insafonov@gmail.com>
Date: Sat, 1 Aug 2020 12:47:07 +0300
From: Ivan Safonov <insafonov@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
B K Karthik <bkkarthik@...u.pes.edu>,
Michael Straube <straube.linux@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Ivan Safonov <insafonov@...il.com>
Subject: [PATCH] staging: r8188eu: replace rtw_netdev_priv define with inline function
The function guarantees type checking of arguments and return value.
Signed-off-by: Ivan Safonov <insafonov@...il.com>
---
drivers/staging/rtl8188eu/include/osdep_service.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h
index 31d897f1d21f..e0ccafdea9cd 100644
--- a/drivers/staging/rtl8188eu/include/osdep_service.h
+++ b/drivers/staging/rtl8188eu/include/osdep_service.h
@@ -71,8 +71,10 @@ struct rtw_netdev_priv_indicator {
};
struct net_device *rtw_alloc_etherdev_with_old_priv(void *old_priv);
-#define rtw_netdev_priv(netdev) \
- (((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv)
+static inline struct adapter *rtw_netdev_priv(struct net_device *dev)
+{
+ return (((struct rtw_netdev_priv_indicator *)netdev_priv(dev))->priv);
+}
void rtw_free_netdev(struct net_device *netdev);
#define FUNC_NDEV_FMT "%s(%s)"
--
2.26.2
Powered by blists - more mailing lists