From patchwork Sat Dec 22 01:56:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 1905251 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 9B705DFAC4 for ; Sat, 22 Dec 2012 02:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752442Ab2LVB6R (ORCPT ); Fri, 21 Dec 2012 20:58:17 -0500 Received: from mail-ia0-f172.google.com ([209.85.210.172]:51770 "EHLO mail-ia0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752303Ab2LVB6O (ORCPT ); Fri, 21 Dec 2012 20:58:14 -0500 Received: by mail-ia0-f172.google.com with SMTP id z13so4459214iaz.17 for ; Fri, 21 Dec 2012 17:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=a4hMh8C276OziKeKgEopwKvRIyidD/LmoiLHiBiFi2c=; b=YzGgZNIZeL+ITC0ebHC9Rpi7TaHIss7lp+VLHKOy9DxsgNefD9OoJOzKJLizffcLFZ vsvgfd8/w06ZqtHoo0DGNMt8b6qb/rlDIL38NW7AJLDsFrwucNeJPljukE/56H0lUnhA 4kgc22/qVu+cgbyjsg+tzcSPs5j5RTnB3CpdNOEcPwgDyOT7toFsu/kR3FUcHyeY68Wc +XeJZ0ke8Eso8OfHjHQHsMZsSACi+Rr2U7hQPABPyQcuHB4zErXq53SRvooBKZlSzuDt +STqLdaG+zp1rLE6bmKj9ETELtQ6nRq7TuopVCmRAaMtti13huIiWArepWigMU5f9UzC FRgg== X-Received: by 10.43.69.206 with SMTP id yd14mr13021068icb.57.1356141494016; Fri, 21 Dec 2012 17:58:14 -0800 (PST) Received: from htj.dyndns.org.com (c-69-181-251-227.hsd1.ca.comcast.net. [69.181.251.227]) by mx.google.com with ESMTPS id v12sm10975374igv.3.2012.12.21.17.58.12 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Dec 2012 17:58:13 -0800 (PST) From: Tejun Heo To: linux-kernel@vger.kernel.org Cc: Tejun Heo , Luciano Coelho , linux-wireless@vger.kernel.org Subject: [PATCH 09/25] wl1251: don't use [delayed_]work_pending() Date: Fri, 21 Dec 2012 17:56:59 -0800 Message-Id: <1356141435-17340-10-git-send-email-tj@kernel.org> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <1356141435-17340-1-git-send-email-tj@kernel.org> References: <1356141435-17340-1-git-send-email-tj@kernel.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There's no need to test whether a (delayed) work item in pending before queueing, flushing or cancelling it. Most uses are unnecessary and quite a few of them are buggy. Remove unnecessary pending tests from wl1251. Only compile tested. Signed-off-by: Tejun Heo Cc: Luciano Coelho Cc: linux-wireless@vger.kernel.org Acked-by: Luciano Coelho --- Please let me know how this patch should be routed. I can take it through the workqueue tree if necessary. Thanks. drivers/net/wireless/ti/wl1251/ps.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/ti/wl1251/ps.c b/drivers/net/wireless/ti/wl1251/ps.c index db719f7..b9e27b9 100644 --- a/drivers/net/wireless/ti/wl1251/ps.c +++ b/drivers/net/wireless/ti/wl1251/ps.c @@ -68,8 +68,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl) unsigned long timeout, start; u32 elp_reg; - if (delayed_work_pending(&wl->elp_work)) - cancel_delayed_work(&wl->elp_work); + cancel_delayed_work(&wl->elp_work); if (!wl->elp) return 0;