This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 41a3c8a5e3 virtio-net:Fix the compile error.
41a3c8a5e3 is described below
commit 41a3c8a5e313145585c5868978d59137a262bc56
Author: liqinhui <[email protected]>
AuthorDate: Mon Dec 18 17:41:54 2023 +0800
virtio-net:Fix the compile error.
CC: virtio/virtio-net.c virtio/virtio-net.c: In function
'virtio_net_set_macaddr':
virtio/virtio-net.c:595:17: error: invalid operands to binary % (have
'struct net_driver_s *' and 'int')
595 | dev % 256
| ^
make[1]: *** [Makefile:107: virtio-net.o] Error 1
make: *** [tools/LibTargets.mk:101: drivers/libdrivers.a] Error 2
make: *** Waiting for unfinished jobs....
Signed-off-by: liqinhui <[email protected]>
---
drivers/virtio/virtio-net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio-net.c b/drivers/virtio/virtio-net.c
index 0e3142c697..93d94818b1 100644
--- a/drivers/virtio/virtio-net.c
+++ b/drivers/virtio/virtio-net.c
@@ -591,7 +591,7 @@ static void virtio_net_set_macaddr(FAR struct
virtio_net_priv_s *priv)
#ifdef CONFIG_NETDEV_IFINDEX
dev->d_ifindex
#else
- dev % 256
+ (uintptr_t)dev % 256
#endif
);