[v5,2/25] linux-gen: pktio: ethtool: add void pointer type casts

Message ID 1503396009-8350-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [v5,1/25] configure: move configure header to include dir
Related show

Commit Message

Github ODP bot Aug. 22, 2017, 9:59 a.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


It makes sense to convert ifr_data to void pointer, since exact type is
implementation-defined.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 127 (lumag:improve-build)
 ** https://github.com/Linaro/odp/pull/127
 ** Patch: https://github.com/Linaro/odp/pull/127.patch
 ** Base sha: aecb3c7a442b426761f1e6f43308a1e9ea709ef3
 ** Merge commit sha: 86e036501e05c61e5570d0908af382a61c2d4e89
 **/
 platform/linux-generic/pktio/ethtool.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/platform/linux-generic/pktio/ethtool.c b/platform/linux-generic/pktio/ethtool.c
index d8f9e12c..482af5b6 100644
--- a/platform/linux-generic/pktio/ethtool.c
+++ b/platform/linux-generic/pktio/ethtool.c
@@ -30,13 +30,13 @@  static struct ethtool_gstrings *get_stringset(int fd, struct ifreq *ifr)
 	sset_info.hdr.cmd = ETHTOOL_GSSET_INFO;
 	sset_info.hdr.reserved = 0;
 	sset_info.hdr.sset_mask = 1ULL << ETH_SS_STATS;
-	ifr->ifr_data =  &sset_info;
+	ifr->ifr_data =  (void *)&sset_info;
 	if (ioctl(fd, SIOCETHTOOL, ifr) == 0) {
 		len = sset_info.hdr.sset_mask ? sset_info.hdr.data[0] : 0;
 	} else if (errno == EOPNOTSUPP && drvinfo_offset != 0) {
 		/* Fallback for old kernel versions */
 		drvinfo.cmd = ETHTOOL_GDRVINFO;
-		ifr->ifr_data = &drvinfo;
+		ifr->ifr_data = (void *)&drvinfo;
 		if (ioctl(fd, SIOCETHTOOL, ifr)) {
 			__odp_errno = errno;
 			ODP_ERR("Cannot get stats information\n");
@@ -62,7 +62,7 @@  static struct ethtool_gstrings *get_stringset(int fd, struct ifreq *ifr)
 	strings->cmd = ETHTOOL_GSTRINGS;
 	strings->string_set = ETH_SS_STATS;
 	strings->len = len;
-	ifr->ifr_data = strings;
+	ifr->ifr_data = (void *)strings;
 	if (ioctl(fd, SIOCETHTOOL, ifr)) {
 		__odp_errno = errno;
 		ODP_ERR("Cannot get stats information\n");
@@ -101,7 +101,7 @@  static int ethtool_stats(int fd, struct ifreq *ifr, odp_pktio_stats_t *stats)
 
 	estats->cmd = ETHTOOL_GSTATS;
 	estats->n_stats = n_stats;
-	ifr->ifr_data = estats;
+	ifr->ifr_data = (void *)estats;
 	err = ioctl(fd, SIOCETHTOOL, ifr);
 	if (err < 0) {
 		__odp_errno = errno;