netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: use list_move instead of list_del/list_add
@ 2012-09-06  5:20 Wei Yongjun
  2012-09-06  9:56 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2012-09-06  5:20 UTC (permalink / raw)
  To: linville, johannes; +Cc: yongjun_wei, linux-wireless, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Using list_move() instead of list_del() + list_add().

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

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 net/mac80211/offchannel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 635c325..7fbf99d 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -227,8 +227,7 @@ static void ieee80211_hw_roc_start(struct work_struct *work)
 			u32 dur = dep->duration;
 			dep->duration = dur - roc->duration;
 			roc->duration = dur;
-			list_del(&dep->list);
-			list_add(&dep->list, &roc->list);
+			list_move(&dep->list, &roc->list);
 		}
 	}
  out_unlock:

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

* Re: [PATCH] mac80211: use list_move instead of list_del/list_add
  2012-09-06  5:20 [PATCH] mac80211: use list_move instead of list_del/list_add Wei Yongjun
@ 2012-09-06  9:56 ` Johannes Berg
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2012-09-06  9:56 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: linville, yongjun_wei, linux-wireless, netdev

On Thu, 2012-09-06 at 13:20 +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Using list_move() instead of list_del() + list_add().
> 
> spatch with a semantic match is used to found this problem.
> (http://coccinelle.lip6.fr/)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied. FWIW, I don't think it's really a "problem" rather than a
simplification or something like that, but anyway.

johannes

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

* Re: [PATCH] mac80211: use list_move instead of list_del/list_add
@ 2012-09-06 13:57 Wei Yongjun
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Yongjun @ 2012-09-06 13:57 UTC (permalink / raw)
  To: johannes; +Cc: linville, yongjun_wei, linux-wireless, netdev

On 09/06/2012 05:56 PM, Johannes Berg wrote:

Hi Johannes,

> On Thu, 2012-09-06 at 13:20 +0800, Wei Yongjun wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> Using list_move() instead of list_del() + list_add().
>>
>> spatch with a semantic match is used to found this problem.
>> (http://coccinelle.lip6.fr/)
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> Applied. FWIW, I don't think it's really a "problem" rather than a
> simplification or something like that, but anyway.

That is right, I will change the patch description if I send some other
patchs like this cleanup.

Thanks,
Yongjun Wei

>
> johannes
>
>
>

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

end of thread, other threads:[~2012-09-06 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-06  5:20 [PATCH] mac80211: use list_move instead of list_del/list_add Wei Yongjun
2012-09-06  9:56 ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2012-09-06 13:57 Wei Yongjun

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).