Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4240196pxb; Tue, 26 Jan 2021 16:45:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8jZLIahq3ELBMK95M832xxKpKhi/HeITmJFnAKfKaBSHRvwwb/6pqOF75AxDFoxSkpWj/ X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr5152276ejn.484.1611708318256; Tue, 26 Jan 2021 16:45:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611708318; cv=none; d=google.com; s=arc-20160816; b=MFqCxolDPE2LsLdzeV/61z3I0Cir4a8UobkSLkZ4Ksew8lovILnb3CExTlw2a9IZ// FfSzF5mZ/tsCFwB8uBHwoauIJtIfNO5AwBB/leK634x2BlWVsbXt/cUA7gj57+kA9WIX HV0wx6Dx3wO8Ed0Mf5vD2ABb2+768vQI0y5lb+wLlGqTIwhdHf2/giqAOHpjsPYJwFIS KZDzR17VRqn7Rm9aS18a+eIe9hcximVcuumtA3j6QJEk3RdQApLqeXkFb4fnwGBQOhtR VFwSD1b2LE+eT1NOXi7UFyCreWmOgD5JdWweOU9bxxYSXMng4EQAHoKL0lP/x3IigOZ1 JIRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=lr7TRr5ybLv57MYeVSWFh/csc4/2QYh3XPd9jhyIC78=; b=mdqTrTmP3i9G76Q7U0uy96S/lT6g56eQfNPs9u5G4MriBwDbAZH14qhV19dkC8IwQk Z0KDkOKAu6NMYHXMtkqqGAv4KXsu/UE70edEIftWJ07OaHCL9ip2RcpXWBFVNIGKYVGc W5XzWCHkJPgF4s6Z+zW85oIibmb7ZEJoMpR2ktSU1obB99M5c+JZir388ctUbDhs9R+j XxZLEviDondee3Lx/6w3Gs+IfOLdtAogha3WiQuHrq87yMC/ZY37BnmYwBhUewD/qGC8 4++jIU2o/1odI9rmqmDXvbzxgyKyXPS8rqwJWeMYLU5hEtdBSds1jzxz/zR4cJIj+NFR 6QxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PtJzM0hZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm27si74980edb.83.2021.01.26.16.44.53; Tue, 26 Jan 2021 16:45:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PtJzM0hZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390816AbhA0AaW (ORCPT + 99 others); Tue, 26 Jan 2021 19:30:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729293AbhAZRQr (ORCPT ); Tue, 26 Jan 2021 12:16:47 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70A88C061352; Tue, 26 Jan 2021 09:16:07 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id ox12so24101109ejb.2; Tue, 26 Jan 2021 09:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=lr7TRr5ybLv57MYeVSWFh/csc4/2QYh3XPd9jhyIC78=; b=PtJzM0hZaAS6/hkwv1qr+GiEDC6Y5XkpDO4px6qOx6rszb7u/qbkOpDrwHPrvq1ITI YHRSk3i1lldKme3bpCaLN0xadQ05qZtwk/y5aeyDMLBN/cLeJ9fWszwe4IUMj26p0m1c ym16VW5+6GTgSGiuJoFgmRsyJYamkUljbsI1qKIZOueETECXMX0mhOA4AZ1dUFs5/0kU OWhcsdK6j5FODhq5AqFyV9/Dd3exGOGmXJS3YFUbebFccu5kGKGWgZDj9+ywl6ilcGCh cOfzeZakQAeSpdMhjJs6Oef2Af5sKma0HqEYPPv2y0T6/ntq6QL++Ux4whLBMfrWzYCH z3ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=lr7TRr5ybLv57MYeVSWFh/csc4/2QYh3XPd9jhyIC78=; b=fPfVUOTmkKa1U4w4VKDTrhTaGqOFIVDJYo/fV3CXT/wgP08Se55wPM+eq0P2tlVp39 BGM/Otf9ZnpL1hHH+JeWbjnNnUOAKNTsBHRy70P6KI4j1IKrhFvm3IJXgHzFTQ0Fs2Bo XPlhnaD0nVGx1mOZgG1sNm33UEfs7DCyvbugiyTNADlQHOC5KPxwOLjIb05jy7rFeSV4 7jgzNQ9AlM9w8U9G8JCFSjm1Ec9wGoth0/WrOVBE8ytPCFIM/6ggvKLTjgLAwTMDYgn5 fR5M+zhjeYwFKpAB9QQS8z2ydfCwhUJqaFoE/RYc1eXF7xrCxXMyekRVrlB54hZ8Orbb jh4Q== X-Gm-Message-State: AOAM532y8JgJofKBN5w/PyG8LcZX2i9JdYdvyWddlUy3gBVccgvy4Bzz jyLwice7rz4G+2qBvgdr0UZ9v1BRx2843g== X-Received: by 2002:a17:906:ce49:: with SMTP id se9mr4136989ejb.341.1611681366244; Tue, 26 Jan 2021 09:16:06 -0800 (PST) Received: from stitch.. ([2a01:4262:1ab:c:f1a3:95f9:9758:8995]) by smtp.gmail.com with ESMTPSA id p26sm12970046edq.94.2021.01.26.09.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 09:16:05 -0800 (PST) Sender: Emil Renner Berthing From: Emil Renner Berthing To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: Emil Renner Berthing , Ping-Ke Shih , Kalle Valo , "David S. Miller" , Jakub Kicinski , Allen Pais , Romain Perier , linux-kernel@vger.kernel.org Subject: [PATCH] rtlwifi: use tasklet_setup to initialize rx_work_tasklet Date: Tue, 26 Jan 2021 18:15:50 +0100 Message-Id: <20210126171550.3066-1-kernel@esmil.dk> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In commit d3ccc14dfe95 most of the tasklets in this driver was updated to the new API. However for the rx_work_tasklet only the type of the callback was changed from void _rtl_rx_work(unsigned long data) to void _rtl_rx_work(struct tasklet_struct *t). The initialization of rx_work_tasklet was still open-coded and the function pointer just cast into the old type, and hence nothing sets rx_work_tasklet.use_callback = true and the callback was still called as t->func(t->data); with uninitialized/zero t->data. Commit 6b8c7574a5f8 changed the casting of _rtl_rx_work a bit and initialized t->data to a pointer to the tasklet cast to an unsigned long. This way calling t->func(t->data) might actually work through all the casting, but it still doesn't update the code to use the new tasklet API. Let's use the new tasklet_setup to initialize rx_work_tasklet properly and set rx_work_tasklet.use_callback = true so that the callback is called as t->callback(t); without all the casting. Fixes: 6b8c7574a5f8 ("rtlwifi: fix build warning") Fixes: d3ccc14dfe95 ("rtlwifi/rtw88: convert tasklets to use new tasklet_setup() API") Signed-off-by: Emil Renner Berthing --- drivers/net/wireless/realtek/rtlwifi/usb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c index d62b87f010c9..6c5e242b1bc5 100644 --- a/drivers/net/wireless/realtek/rtlwifi/usb.c +++ b/drivers/net/wireless/realtek/rtlwifi/usb.c @@ -310,8 +310,7 @@ static int _rtl_usb_init_rx(struct ieee80211_hw *hw) init_usb_anchor(&rtlusb->rx_cleanup_urbs); skb_queue_head_init(&rtlusb->rx_queue); - rtlusb->rx_work_tasklet.func = (void(*))_rtl_rx_work; - rtlusb->rx_work_tasklet.data = (unsigned long)&rtlusb->rx_work_tasklet; + tasklet_setup(&rtlusb->rx_work_tasklet, _rtl_rx_work); return 0; } -- 2.30.0