diff mbox series

[-next] ptp: ptp_ines: Use list_for_each_entry() helper

Message ID 20230830090816.529438-1-ruanjinjie@huawei.com (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series [-next] ptp: ptp_ines: Use list_for_each_entry() helper | 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/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: 1330 this patch: 1330
netdev/cc_maintainers success CCed 2 of 2 maintainers
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
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: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jinjie Ruan Aug. 30, 2023, 9:08 a.m. UTC
Convert list_for_each() to list_for_each_entry() so that the this
list_head pointer and list_entry() call are no longer needed, which
can reduce a few lines of code. No functional changed.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/ptp/ptp_ines.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Michal Swiatkowski Aug. 30, 2023, 9:38 a.m. UTC | #1
On Wed, Aug 30, 2023 at 05:08:16PM +0800, Jinjie Ruan wrote:
> Convert list_for_each() to list_for_each_entry() so that the this
> list_head pointer and list_entry() call are no longer needed, which
> can reduce a few lines of code. No functional changed.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>  drivers/ptp/ptp_ines.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
> index ed215b458183..c74f2dbbe3a2 100644
> --- a/drivers/ptp/ptp_ines.c
> +++ b/drivers/ptp/ptp_ines.c
> @@ -237,11 +237,9 @@ static struct ines_port *ines_find_port(struct device_node *node, u32 index)
>  {
>  	struct ines_port *port = NULL;
>  	struct ines_clock *clock;
> -	struct list_head *this;
>  
>  	mutex_lock(&ines_clocks_lock);
> -	list_for_each(this, &ines_clocks) {
> -		clock = list_entry(this, struct ines_clock, list);
> +	list_for_each_entry(clock, &ines_clocks, list) {
>  		if (clock->node == node) {
>  			port = &clock->port[index];
>  			break;
> -- 
> 2.34.1
> 

Nice
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Jakub Kicinski Aug. 31, 2023, 1:29 a.m. UTC | #2
On Wed, 30 Aug 2023 17:08:16 +0800 Jinjie Ruan wrote:
> Convert list_for_each() to list_for_each_entry() so that the this
> list_head pointer and list_entry() call are no longer needed, which
> can reduce a few lines of code. No functional changed.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

## Form letter - net-next-closed

The merge window for v6.6 has begun and therefore net-next is closed
for new drivers, features, code refactoring and optimizations.
We are currently accepting bug fixes only.

Please repost when net-next reopens after Sept 11th.

RFC patches sent for review only are obviously welcome at any time.

See:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
diff mbox series

Patch

diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
index ed215b458183..c74f2dbbe3a2 100644
--- a/drivers/ptp/ptp_ines.c
+++ b/drivers/ptp/ptp_ines.c
@@ -237,11 +237,9 @@  static struct ines_port *ines_find_port(struct device_node *node, u32 index)
 {
 	struct ines_port *port = NULL;
 	struct ines_clock *clock;
-	struct list_head *this;
 
 	mutex_lock(&ines_clocks_lock);
-	list_for_each(this, &ines_clocks) {
-		clock = list_entry(this, struct ines_clock, list);
+	list_for_each_entry(clock, &ines_clocks, list) {
 		if (clock->node == node) {
 			port = &clock->port[index];
 			break;