Message ID | 20240822030535.1214176-1-liyuesong@vivo.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v1] driver:net:et131x:Remove NULL check of list_entry() | expand |
On Thu, 2024-08-22 at 11:05 +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> Thanks, Mark > --- > drivers/net/ethernet/agere/et131x.c | 5 ----- > 1 file changed, 5 deletions(-) > > 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--; >
On Thu, Aug 22, 2024 at 11:05:35AM +0800, Yuesong Li wrote: > list_entry() will never return a NULL pointer, thus remove the > check. > > Signed-off-by: Yuesong Li <liyuesong@vivo.com> Hi Yuesong Li, Thanks for your patch. Some minor points about process. 1. As a Networking patch, that is not a bug fix, it should be explicitly targeted at net-next. Subject: [PATCH net-next] ... 2. Looking at git history, it looks like 'et131x' would be an appropriate prefix for this patch. Subject: [PATCH net-next] et131x: ... Please consider reading https://docs.kernel.org/process/maintainer-netdev.html And, please post a v2, addressing the above, and including Mark's tag, after waiting 24h from the initial patch posting (as described in the link above). Please do so as a new email thread. FWIIW, the code change itself looks good to me. ...
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--;
list_entry() will never return a NULL pointer, thus remove the check. Signed-off-by: Yuesong Li <liyuesong@vivo.com> --- drivers/net/ethernet/agere/et131x.c | 5 ----- 1 file changed, 5 deletions(-)