From patchwork Mon Oct 16 23:36:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10010229 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 ED996601D5 for ; Mon, 16 Oct 2017 23:36:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF6B6286E7 for ; Mon, 16 Oct 2017 23:36:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4791286FF; Mon, 16 Oct 2017 23:36:44 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI 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 DCCEE286E7 for ; Mon, 16 Oct 2017 23:36:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932959AbdJPXg1 (ORCPT ); Mon, 16 Oct 2017 19:36:27 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:45151 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932950AbdJPXgY (ORCPT ); Mon, 16 Oct 2017 19:36:24 -0400 Received: by mail-pg0-f52.google.com with SMTP id b192so8064616pga.2 for ; Mon, 16 Oct 2017 16:36:24 -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=8uBJXMV3wFMO86Wb/rhIRKqAn4sIP3F1oOkuJW8Syfk=; b=IB004Anj6+iu3Wdcs+gnXXWmr15RBkg1ABLBEyIpZmv9EaWCs+o1ylBp/lcmO3sqFI FVclOtj76V3w874XhnCqdYgNiG3CyHVGUfaPtEXvQvA5Cbh6bIJUiaLOXAXZlnPpMiL1 Cvrv1LdgIzcZ8vINKbgM58OFGIg0r9jjrYRDw= 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=8uBJXMV3wFMO86Wb/rhIRKqAn4sIP3F1oOkuJW8Syfk=; b=KRvtuMh8Uea704OXb80b9An/bK/yfeH4P2zAsBHU7sOgE5wyjpGhDf2+y7sdubWlTU 3xjQM59k8Sx2bSUbwIZmOWeDFhQ2G0PtZ8aXcJt43bX9DSKIf0miSDB3H4aEMpbWFsPE h76JlKCPjS2+9sCYrr6JiErGXCAE0UkpS7pA/OkP8Ml2bapOvTLSQrT4hbRZmmPox8GR xdQ46mpkH1Ve4XwPgf60RH9URNRv5CYkczVDbybIXC5bedJzMJxmk48+GKIf6GT1K0M6 /6QEJFjpC2DqYD1KjgI18Am4FhRuJLQc2pISMTJojE0XNq2tlCZ7BPv7g8LFHFYtA9ic 9DNQ== X-Gm-Message-State: AMCzsaVkWLofsWVzWwbwqkIApGFLhvFc9YgIajENIaNPcKwmC/e+ouuY 3uvkJl+gkF0mkSCcTHrDXMV2Mg== X-Google-Smtp-Source: AOwi7QDWyP0A7pfLu+gFH5zRtYjREKhNT6itIG8ba24Q5nxc7q1bRTpljGME4h9sNLB+HuhN9kPrKw== X-Received: by 10.84.230.134 with SMTP id e6mr10310918plk.46.1508196984522; Mon, 16 Oct 2017 16:36:24 -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 68sm17351528pfx.105.2017.10.16.16.36.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 16:36:23 -0700 (PDT) Date: Mon, 16 Oct 2017 16:36:22 -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] wireless: qtnfmac: Convert timers to use timer_setup() Message-ID: <20171016233622.GA101550@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: Igor Mitsyanko Cc: Avinash Patil Cc: Sergey Matyukevich Cc: Kalle Valo Cc: Kamlesh Rath Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Sergey Matyukevich --- 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);