Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp871000rdb; Fri, 23 Feb 2024 02:44:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVtTx3y25XEkWXBSnDvFsMQUfO+0jJUTC6NtUScwY/TdN2cS2+EueI5SQTZyxthJ2cHGjt2cRbx0Mrwr6HLQPsOiJwg4cKnVQl7LpPvvg== X-Google-Smtp-Source: AGHT+IH7piwQC4UVAnuOBqnMzm1JmoCHWDnh+FhRYAUABuNbS/YaJwQ+lOFWZOnxev04vvWal93P X-Received: by 2002:ac8:5e8d:0:b0:42e:5eea:e0f7 with SMTP id r13-20020ac85e8d000000b0042e5eeae0f7mr1176183qtx.47.1708685080868; Fri, 23 Feb 2024 02:44:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708685080; cv=pass; d=google.com; s=arc-20160816; b=oPBjAQz6q7bYInbZ/61tlrFqCDR8nfaTaWWxytTXMi2F94Lp/2Was4i0vPuzuvLqKx V26oa2l3Hz4ccfwP7jUSJcPpnSLFvlvGyEtarCaiVLVbFMRy8FYJ37Ci+0gbjydeDSf8 2Ttvp5426lUWyOrLejEJrghBe2OGNoaK+ulkuZ50LkPCVRbKvKXgbrnkY9AIHxS3y6f3 GHCLB6t3w8G5z1yEIHH2kB3p01b0T+1yDAdMiMIHNgcImVkGFIGZ1iqE/MPLB1RIQj7V amc5EGOe3lfxBB74xYWTt3ROv/uD1pDxtTJinhDkTfFs73jiFxgaBvE7ld/r1SPwoZMB zoNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=szU5A2/fb9fuRVNP/Fl2eh853klpAqTds4ZyeiHJd+8=; fh=QCRMbNmxBrwEohLjUHQ8w4lzVnBUUFoRxUspyxOIxFc=; b=NlxiZ0DuuoxyBaL5qBRLJBruq2+suEh4RiEAK9yXC26JQnHn9z0yQvh9eVUwyNeMLj oyHeX1liCgqfLxIEZE+9LxagjJGhh5MV6eBeaPdKkRDjZ/7Jbzlra58mBfue/Qcm6FfN SwgJn0eVGGG3lFAEDGRry02+BYElE2HtsMPNADO4ceMtOkms4ofMWJC0+P/hy4zt5Qka d67ldjAvUNA8yLPPoceK5jT8up+C86kGbiPIgf7qnqCGHJ/6K7g01VStyUWzE5PJnsks jhftIRQPdtp1mBTYBTBZZHynjOYwVnWLkXZ263uAoV8d/emF3V1/kd0g/QEV733hnIfz Ac2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Zkude+fj; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-3957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e9-20020ac85dc9000000b0042c0effa9bfsi15998317qtx.295.2024.02.23.02.44.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 02:44:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Zkude+fj; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-3957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 92AC21C2192B for ; Fri, 23 Feb 2024 10:44:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB5957E593; Fri, 23 Feb 2024 10:40:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="Zkude+fj" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65641823C1 for ; Fri, 23 Feb 2024 10:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708684831; cv=none; b=MSn9s4lgQw8CZHqvC8+WPcrnSAnKeuGG5uD7NnFCoqL4XxvbJI5bPi9mq5i1/vf4/LIdZSxpmOecGooQwG2UAjZpJ4/Sjn/OCGbbZhznwSuhdFFDWGWK35WSyfRYiJL0G2Cq+RrDXk60OCN1ycjL5DcQ6iqV5tlJJAy/Apt2aPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708684831; c=relaxed/simple; bh=hV/yKZZi42u/3GX5RrWl/h2TSUXotFB4WE2JNkiUvfk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kOa6VdGzadwHTe/PVS2lSpkBSO1p7QYczhRuQbYyqykCvBQydeYWR0J7OCLGwiUB3O/4OYTwPX88PpvDzeE+BwiKSQ9rJraQD5olOc4ffCt5Jr6S5JRS9451ltkQxhGbJ1TPhrHU5R9mZdAWstyaESvEDN5A71IAI26dLGHv9pY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=Zkude+fj; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=szU5A2/fb9fuRVNP/Fl2eh853klpAqTds4ZyeiHJd+8=; t=1708684830; x=1709894430; b=Zkude+fjij/6sEieZVxDRectXbRLCP1sz2xxGR7hmrRipYq HDVnXLqSX3AVK3Oxi4Bkre5BZg3lDUMJ7eMO4g5ECnpJCCZl1jOcL4rstyvV8iAuviogYp/eRXutH 18W5gO4g06PET0/IH4A1lWyNJTJpukDAarVjqs9udyGnkYA3giIYBloqI9tHn1XeksD3k07IM4Ly3 KpqNFLsMTBQ/uf1pruOfx5WlpL+k8Pjit22Fw4klK4M1sD4IX92OrIF7kot5EZHg1ayIx+9Dlg9KL BpjSiF5uZJDidYzCv1XUXPs/tJIb0KP9om1AVkdtW9EzgNhI1IWy+5Joatl/LOYQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rdSyh-000000051om-2NVb; Fri, 23 Feb 2024 11:40:27 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 5/5] wifi: zd1211rw: silence sparse warnings Date: Fri, 23 Feb 2024 11:40:27 +0100 Message-ID: <20240223114023.976fcd59e97a.I0bba4ef7dc2847ce8ab5ec229149e1a09413b8b9@changeid> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240223114023.c64e2d348453.Iccc4ace1116721a044e5f31f40ea7709e72145f3@changeid> References: <20240223114023.c64e2d348453.Iccc4ace1116721a044e5f31f40ea7709e72145f3@changeid> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg This code wants to compare the obtained value, but as it also has a special type for register addresses to find places doing such compares and calculations wrong, we need explicit casts here to silence sparse. Signed-off-by: Johannes Berg --- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c index 8505d84eeed6..f3b567a13ded 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c @@ -380,7 +380,7 @@ static inline void handle_regs_int(struct urb *urb) spin_lock_irqsave(&intr->lock, flags); int_num = le16_to_cpu(*(__le16 *)(urb->transfer_buffer+2)); - if (int_num == CR_INTERRUPT) { + if (int_num == (u16)CR_INTERRUPT) { struct zd_mac *mac = zd_hw_mac(zd_usb_to_hw(urb->context)); spin_lock(&mac->lock); memcpy(&mac->intr_buffer, urb->transfer_buffer, @@ -416,7 +416,8 @@ static inline void handle_regs_int(struct urb *urb) spin_unlock_irqrestore(&intr->lock, flags); /* CR_INTERRUPT might override read_reg too. */ - if (int_num == CR_INTERRUPT && atomic_read(&intr->read_regs_enabled)) + if (int_num == (u16)CR_INTERRUPT && + atomic_read(&intr->read_regs_enabled)) handle_regs_int_override(urb); } -- 2.43.2