From patchwork Tue Oct 24 09:28:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10023851 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA9CB60381 for ; Tue, 24 Oct 2017 09:34:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2AC9288A9 for ; Tue, 24 Oct 2017 09:34:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5A52289D8; Tue, 24 Oct 2017 09:34:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E27A288A9 for ; Tue, 24 Oct 2017 09:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751920AbdJXJ2q (ORCPT ); Tue, 24 Oct 2017 05:28:46 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:54860 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751884AbdJXJ2k (ORCPT ); Tue, 24 Oct 2017 05:28:40 -0400 Received: by mail-pg0-f68.google.com with SMTP id l24so14040434pgu.11 for ; Tue, 24 Oct 2017 02:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=yO7Nj4VD6ytR116PuQR2gJAvprau/TFrW/zzxgqHs4E=; b=PSjBnTl1Et3HW1sFAlTU5mop6at5+3GwwrzS06DYc9PLFJ13NeUO/DGFbkgoeX07Vi tds/AXDepZCuIGPF2nch/TceuZ/ATBpUxJXvuJwWAIRQnSm8TnB772Fgd0ehOFpYF57r Cv7YKqIr+PbibSXV8XfE0z2U4o28qorgNAtOU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=yO7Nj4VD6ytR116PuQR2gJAvprau/TFrW/zzxgqHs4E=; b=ipjNdYBn7D3TQwQAmT82Wkqmuhd6zfXAN4h/rIVgJZQGnfiZoPcN2hHxWhy0a+x9vb YUaxPb7DVuPKesgYy9xGBDY0PV5Kkx0FhgggA7C/zTK5RwP9VK6CQO7GKzcVNlfW83rF bE5bNRYFCopah037nwoc2XFgZp7VT754eGoty6IurED+5INycgD7xElV6gPVAI4trsJ+ 7gFiIvpsIfIki3b4WaBlNplzu/3cIxEFzuCoIpoapnHJjVXAEmD1bWnlnuViQFd4+fPo GfdyGdpUaxr7NRD6BIXTPQKjK0GsBi4YR6I8l8hBAhA6BUwIPWrzdIbe/LnmLNGC9WQA MLCg== X-Gm-Message-State: AMCzsaVlKjn8iZja7qUO9+WZPe3XjbglY2phqZdJPYAg4uS12S3mfUrk sM8hhWDhENew7WpDHNwuUK/deg== X-Google-Smtp-Source: ABhQp+R7NvL13/gBf9/fPPameAeQV7MzkGPMwVGQ2Arq/G0YaIvpMKpzZ/YnsgQUcaLzHp4L5dy/5w== X-Received: by 10.98.218.13 with SMTP id c13mr15693281pfh.342.1508837319167; Tue, 24 Oct 2017 02:28:39 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id j8sm15809847pff.131.2017.10.24.02.28.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 02:28:38 -0700 (PDT) Date: Tue, 24 Oct 2017 02:28:37 -0700 From: Kees Cook To: Kalle Valo Cc: Igor Mitsyanko , Avinash Patil , Sergey Matyukevich , Kamlesh Rath , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/wireless: qtnfmac: Convert timers to use timer_setup() Message-ID: <20171024092837.GA47040@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Kalle Valo Cc: Igor Mitsyanko Cc: Avinash Patil Cc: Sergey Matyukevich Cc: Kamlesh Rath Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 7 +++---- drivers/net/wireless/quantenna/qtnfmac/core.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 32bf72c0399f..ac1b9bd5ed90 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -581,9 +581,9 @@ qtnf_del_station(struct wiphy *wiphy, struct net_device *dev, return ret; } -static void qtnf_scan_timeout(unsigned long data) +static void qtnf_scan_timeout(struct timer_list *t) { - struct qtnf_wmac *mac = (struct qtnf_wmac *)data; + struct qtnf_wmac *mac = from_timer(mac, t, scan_timeout); pr_warn("mac%d scan timed out\n", mac->macid); qtnf_scan_done(mac, true); @@ -602,8 +602,7 @@ qtnf_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) return -EFAULT; } - mac->scan_timeout.data = (unsigned long)mac; - mac->scan_timeout.function = qtnf_scan_timeout; + mac->scan_timeout.function = (TIMER_FUNC_TYPE)qtnf_scan_timeout; mod_timer(&mac->scan_timeout, jiffies + QTNF_SCAN_TIMEOUT_SEC * HZ); diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 5e60180482d1..aa7f146278a7 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -289,7 +289,7 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, mac->iflist[i].vifid = i; qtnf_sta_list_init(&mac->iflist[i].sta_list); mutex_init(&mac->mac_lock); - init_timer(&mac->scan_timeout); + setup_timer(&mac->scan_timeout, NULL, 0); } qtnf_mac_init_primary_intf(mac);