# \[PATCH\] vmlfb: use list\_move\_tail instead of list\_del/list\_add\_tail

- Subsystems: FRAMEBUFFER LAYER, THE REST
- Maintainers: Helge Deller, Linus Torvalds
- List: linux-fbdev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2012/09/13463967/t

## \[PATCH\] vmlfb: use list\_move\_tail instead of list\_del/list\_add\_tail

- From: Wei Yongjun \<hidden\>
- Date: 2012-09-05 06:40:43 
- Message: https://ratatoskr.run/linux-fbdev/2012/09/13463967.md

```text
From: Wei Yongjun <redacted>

Using list_move_tail() instead of list_del() + list_add_tail().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/video/vermilion/vermilion.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c
index 970e43d..083f0c8 100644
--- a/drivers/video/vermilion/vermilion.c
+++ b/drivers/video/vermilion/vermilion.c
@@ -1168,8 +1168,7 @@ void vmlfb_unregister_subsys(struct vml_sys *sys)
 	list_for_each_entry_safe(entry, next, &global_has_mode, head) {
 		printk(KERN_DEBUG MODULE_NAME ": subsys disable pipe\n");
 		vmlfb_disable_pipe(entry);
-		list_del(&entry->head);
-		list_add_tail(&entry->head, &global_no_mode);
+		list_move_tail(&entry->head, &global_no_mode);
 	}
 	mutex_unlock(&vml_mutex);
 }


```

## Re: \[PATCH\] vmlfb: use list\_move\_tail instead of list\_del/list\_add\_tail

- From: Florian Tobias Schandinat \<FlorianSchandinat@gmx.de\>
- Date: 2012-09-23 19:41:58 
- Message: https://ratatoskr.run/linux-fbdev/2012/09/13463968.md

```text
On 09/05/2012 06:40 AM, Wei Yongjun wrote:
> From: Wei Yongjun <redacted>
> 
> Using list_move_tail() instead of list_del() + list_add_tail().
> 
> spatch with a semantic match is used to found this problem.
> (http://coccinelle.lip6.fr/)
> 
> Signed-off-by: Wei Yongjun <redacted>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/vermilion/vermilion.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/video/vermilion/vermilion.c b/drivers/video/vermilion/vermilion.c
> index 970e43d..083f0c8 100644
> --- a/drivers/video/vermilion/vermilion.c
> +++ b/drivers/video/vermilion/vermilion.c
> @@ -1168,8 +1168,7 @@ void vmlfb_unregister_subsys(struct vml_sys *sys)
>  	list_for_each_entry_safe(entry, next, &global_has_mode, head) {
>  		printk(KERN_DEBUG MODULE_NAME ": subsys disable pipe\n");
>  		vmlfb_disable_pipe(entry);
> -		list_del(&entry->head);
> -		list_add_tail(&entry->head, &global_no_mode);
> +		list_move_tail(&entry->head, &global_no_mode);
>  	}
>  	mutex_unlock(&vml_mutex);
>  }
> 
> 
> 

```
