Message ID | 20240823012737.2995688-1-liyuesong@vivo.com (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v2] et131x: Remove NULL check of list_entry() | expand |
On Fri, Aug 23, 2024 at 09:27:37AM +0800, Yuesong Li wrote: > list_entry() will never return a NULL pointer, thus remove the > check. > > Signed-off-by: Yuesong Li <liyuesong@vivo.com> > Reviewed-by: Mark Einon <mark.einon@gmail.com> > --- > changes v2: > - update the short log and patch name Thanks for the update. Reviewed-by: Simon Horman <horms@kernel.org>
On Fri, 23 Aug 2024 09:27:37 +0800 Yuesong Li wrote: > list_entry() will never return a NULL pointer, thus remove the > check. Unclear to me whether the intent of this code is to check for empty list or this is defensive programming. Let's leave it be.
diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c index b325e0cef120..74fc55b9f0d9 100644 --- a/drivers/net/ethernet/agere/et131x.c +++ b/drivers/net/ethernet/agere/et131x.c @@ -2244,11 +2244,6 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter) element = rx_local->recv_list.next; rfd = list_entry(element, struct rfd, list_node); - if (!rfd) { - spin_unlock_irqrestore(&adapter->rcv_lock, flags); - return NULL; - } - list_del(&rfd->list_node); rx_local->num_ready_recv--;