From patchwork Wed Sep 5 07:07:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1405631 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 60495DF28C for ; Wed, 5 Sep 2012 07:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756461Ab2IEHHa (ORCPT ); Wed, 5 Sep 2012 03:07:30 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:41477 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753287Ab2IEHH3 (ORCPT ); Wed, 5 Sep 2012 03:07:29 -0400 Received: by qaas11 with SMTP id s11so4218222qaa.19 for ; Wed, 05 Sep 2012 00:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=M8IuieWpeh8saHTfiNBNNfksBr7H14YBXeqodzFkfAM=; b=FThfrjJevihKT1/FAd6P6nn7cr8k+ygPVYruQeguE8/VrJiIpiAnOVnGOZSZpDG6ch 4tP76wxU0jPkHkA7OLyDo6ilZFQvvaX84z5xGQOKo4X0xP/4tlGi4meG3P87ukCstuU5 mdtadLpNOobZDVVNoWjxfAgNOao07Wb9UDMKygeo1uPyBAC8nq6z2ur6mJLn0EFgB3jn TKtI7+cacua3x16JaPGQHHV6XtDGBK9mFY2mW2soHUBni65BafB68J8IitOfyKER2Hmn 1X9AHNfBgYZK5ciWNFn7wkP8rcygqDyADd9ZEhMDEoiDhWtLDY+YWOKs8TmywKbmKpJz phCg== MIME-Version: 1.0 Received: by 10.224.193.132 with SMTP id du4mr43574001qab.75.1346828849043; Wed, 05 Sep 2012 00:07:29 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Wed, 5 Sep 2012 00:07:29 -0700 (PDT) Date: Wed, 5 Sep 2012 15:07:29 +0800 Message-ID: Subject: [PATCH] ath6kl: use list_move_tail instead of list_del/list_add_tail From: Wei Yongjun To: kvalo@qca.qualcomm.com, linville@tuxdriver.com Cc: yongjun_wei@trendmicro.com.cn, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Wei Yongjun 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 --- drivers/net/wireless/ath/ath6kl/htc_pipe.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c index f9626c7..ba6bd49 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c +++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c @@ -374,9 +374,8 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target, packet = list_first_entry(txq, struct htc_packet, list); - list_del(&packet->list); - /* insert into local queue */ - list_add_tail(&packet->list, &send_queue); + /* move to local queue */ + list_move_tail(&packet->list, &send_queue); } /* @@ -399,11 +398,10 @@ static enum htc_send_queue_result htc_try_send(struct htc_target *target, * for cleanup */ } else { /* callback wants to keep this packet, - * remove from caller's queue */ - list_del(&packet->list); - /* put it in the send queue */ - list_add_tail(&packet->list, - &send_queue); + * move from caller's queue to the send + * queue */ + list_move_tail(&packet->list, + &send_queue); } }