diff mbox series

[v1] driver:net:et131x:Remove NULL check of list_entry()

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

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 3 maintainers not CCed: jacob.e.keller@intel.com shannon.nelson@amd.com sd@queasysnail.net
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-08-22--06-00 (tests: 712)

Commit Message

Yuesong Li Aug. 22, 2024, 3:05 a.m. UTC
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(-)

Comments

Mark Einon Aug. 22, 2024, 11:03 a.m. UTC | #1
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--;
>
Simon Horman Aug. 22, 2024, 12:07 p.m. UTC | #2
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 mbox series

Patch

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--;