netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] isdn: capi, Use list_for_each_entry() helper
@ 2023-08-30  9:05 Jinjie Ruan
  2023-08-30  9:42 ` Michal Swiatkowski
  2023-08-31  1:29 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Jinjie Ruan @ 2023-08-30  9:05 UTC (permalink / raw)
  To: netdev, gregkh, jirislaby, benjamin.tissoires, Karsten Keil; +Cc: ruanjinjie

Convert list_for_each() to list_for_each_entry() so that the l
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/isdn/capi/capi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 2f3789515445..6664eb3dc35c 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1326,11 +1326,9 @@ static inline void capinc_tty_exit(void) { }
 static int __maybe_unused capi20_proc_show(struct seq_file *m, void *v)
 {
 	struct capidev *cdev;
-	struct list_head *l;
 
 	mutex_lock(&capidev_list_lock);
-	list_for_each(l, &capidev_list) {
-		cdev = list_entry(l, struct capidev, list);
+	list_for_each_entry(cdev, &capidev_list, list) {
 		seq_printf(m, "0 %d %lu %lu %lu %lu\n",
 			   cdev->ap.applid,
 			   cdev->ap.nrecvctlpkt,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] isdn: capi, Use list_for_each_entry() helper
  2023-08-30  9:05 [PATCH -next] isdn: capi, Use list_for_each_entry() helper Jinjie Ruan
@ 2023-08-30  9:42 ` Michal Swiatkowski
  2023-08-31  1:29 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Swiatkowski @ 2023-08-30  9:42 UTC (permalink / raw)
  To: Jinjie Ruan; +Cc: netdev, gregkh, jirislaby, benjamin.tissoires, Karsten Keil

On Wed, Aug 30, 2023 at 05:05:28PM +0800, Jinjie Ruan wrote:
> Convert list_for_each() to list_for_each_entry() so that the l
> 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/isdn/capi/capi.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
> index 2f3789515445..6664eb3dc35c 100644
> --- a/drivers/isdn/capi/capi.c
> +++ b/drivers/isdn/capi/capi.c
> @@ -1326,11 +1326,9 @@ static inline void capinc_tty_exit(void) { }
>  static int __maybe_unused capi20_proc_show(struct seq_file *m, void *v)
>  {
>  	struct capidev *cdev;
> -	struct list_head *l;
>  
>  	mutex_lock(&capidev_list_lock);
> -	list_for_each(l, &capidev_list) {
> -		cdev = list_entry(l, struct capidev, list);
> +	list_for_each_entry(cdev, &capidev_list, list) {
>  		seq_printf(m, "0 %d %lu %lu %lu %lu\n",
>  			   cdev->ap.applid,
>  			   cdev->ap.nrecvctlpkt,
> -- 
> 2.34.1

Probably { } aren't needed now.
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] isdn: capi, Use list_for_each_entry() helper
  2023-08-30  9:05 [PATCH -next] isdn: capi, Use list_for_each_entry() helper Jinjie Ruan
  2023-08-30  9:42 ` Michal Swiatkowski
@ 2023-08-31  1:29 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-08-31  1:29 UTC (permalink / raw)
  To: Jinjie Ruan; +Cc: netdev, gregkh, jirislaby, benjamin.tissoires, Karsten Keil

On Wed, 30 Aug 2023 17:05:28 +0800 Jinjie Ruan wrote:
> Convert list_for_each() to list_for_each_entry() so that the l
> 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
-- 
pw-bot: defer


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-31  1:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-30  9:05 [PATCH -next] isdn: capi, Use list_for_each_entry() helper Jinjie Ruan
2023-08-30  9:42 ` Michal Swiatkowski
2023-08-31  1:29 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).