[bug report] net: ax88796c: ASIX AX88796C SPI Ethernet Adapter Driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Łukasz Stelmach,

The patch a97c69ba4f30: "net: ax88796c: ASIX AX88796C SPI Ethernet
Adapter Driver" from Oct 20, 2021, leads to the following Smatch
static checker warning:

	drivers/net/ethernet/asix/ax88796c_main.c:391 ax88796c_start_xmit()
	warn: test_bit() takes a bit number

drivers/net/ethernet/asix/ax88796c_main.c
    382 static int
    383 ax88796c_start_xmit(struct sk_buff *skb, struct net_device *ndev)
    384 {
    385         struct ax88796c_device *ax_local = to_ax88796c_device(ndev);
    386 
    387         skb_queue_tail(&ax_local->tx_wait_q, skb);
    388         if (skb_queue_len(&ax_local->tx_wait_q) > TX_QUEUE_HIGH_WATER)
    389                 netif_stop_queue(ndev);
    390 
--> 391         set_bit(EVENT_TX, &ax_local->flags);

EVENT_TX is BIT(1) so this ends up being a double BIT(BIT(1));.  Which
is fine because it seems to be done consistently.  But probably it
should be:

#define EVENT_INTR		0
#define EVENT_TX		1
#define EVENT_SET_MULTI		2

    392         schedule_work(&ax_local->ax_work);
    393 
    394         return NETDEV_TX_OK;
    395 }

regards,
dan carpenter



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux