Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2478895rbb; Wed, 28 Feb 2024 03:12:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXqJkFV3C6TrAUw3VcEhLBVfR/zRXPDNNJUFcYM9+VsJg7frPlhSTIFq4bHZtGN3LqeJeS/Z33eD+kCvntHzLoX0hO7gshDQIQxHSd4Pg== X-Google-Smtp-Source: AGHT+IH7tNrsx5tdL3Lqa4c9lCwmaf6Ai7BeIV+29wIUrdOz2eNipppqIXMNC6a3HYFGPNDkDmGj X-Received: by 2002:a05:622a:1a10:b0:42e:1577:795d with SMTP id f16-20020a05622a1a1000b0042e1577795dmr13713895qtb.59.1709118726637; Wed, 28 Feb 2024 03:12:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709118726; cv=pass; d=google.com; s=arc-20160816; b=WGJMAJuAmoPVSUoKHminCRybyrJ+gBzxVeWhiDMcHT42nXhT7Owsv0sVfDFpsDApSh YvfS9//SUFJBS76/JHyCPfWdr9KFc/LqILMYDMYN/Q7ctZBTZ5idCNWVPfkxbp8N1CJB 9H7xxfQbrISIOLwNicO+72OcZXz2qmNRqKd2VHG9EAhsJ0WId9r8BtX/rLL9Jy9SNks8 IMhnuQnxXoWWiTYlwlE3zK+9v30J9HeiXJyVPBJuIQi0AG2qV/xhTsu4oYmfE0RaLUhR 9cCmyZHo0xeQNov5XOM5LnQpBU1OBIPFeeAvz2udISiD4QJxYk5e/ZJRkhO/YX3oktDU a4RA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=XykWehRh/Q3JKZpNubsMMCwtMQpxQixWGPomFz/fw1E=; fh=QCRMbNmxBrwEohLjUHQ8w4lzVnBUUFoRxUspyxOIxFc=; b=zQHnIkS1eyMWBJ/qG+YuIAeZIejDb/wuujbIZY5BdP/no2mdvaXWxUKYBpN2Cq03fl TEOZrIioevHrNqznkJS9h+5iaicefBKKfYwuP3imub0lvweIHm44gRs1Rrcqm3nW1GQf YuAsq6BDgz16iIseEqAH/pqrrI53ZQuTe5f4H1tIdL2By3U6UTvwEqao2zK/5l8MKluj 9BaUUrJwicoGmCPtaa8s/nobqXl22MUlx+5DjGO6F92RNKGgXxli3fPji/2yXcs5Hu2u m3xeBMxAMFZnjmfeOkPJKcjPLF88KtCYIQR/4rKz52eQmUM5YqEoe/mBl1/aYxduVz3/ J5cQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Hz9c8uVA; 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-4181-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4181-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. [147.75.199.223]) by mx.google.com with ESMTPS id z21-20020ac84555000000b0042eab8dd698si1033325qtn.689.2024.02.28.03.12.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 03:12:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4181-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=Hz9c8uVA; 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-4181-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4181-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 62CC11C21F80 for ; Wed, 28 Feb 2024 11:12:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5AD5012BEA1; Wed, 28 Feb 2024 11:12:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="Hz9c8uVA" 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 8E2BB1292F5 for ; Wed, 28 Feb 2024 11:12:01 +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=1709118723; cv=none; b=cmdArMIXUkYSbZldQ1wVMnXpPBEs6HEH1VpaHAFuAd//NXuMhKaZbsKxwl+QFseU5pMVltuEtgBglzq8TwyuQcXku1xxxwWSlNb1rxdQvA4TsDGVyBaZ1gyZGmtwOFFcP7YU+PnBBQQUu2pCcdIq/r49uDTZ017yPQqAxha6c8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709118723; c=relaxed/simple; bh=WyoTElTLbucLCjgz7Zc4Lnin5COFihGmksaMg3w+GpU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZXHtiG5oz20i96nLIykS1fNcqToumRkU26sLr42jgtiE6cn6KhfMALN5Se0q0x1v0k1PwXN6xF+RB+GJVLp13FuTfARn3FYdmbfjPhsyy2mKwi98CnzbwAIMkcgyr24aA1+FQQv77OtQAweYiGuVb1ABlwE6ra0RRmvqL8STspE= 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=Hz9c8uVA; 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: 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:In-Reply-To:References; bh=XykWehRh/Q3JKZpNubsMMCwtMQpxQixWGPomFz/fw1E=; t=1709118721; x=1710328321; b=Hz9c8uVArro6xuvdhIRh6/I3JVSkalAgblWHmYW81KhNAUL3kXsRvGWVR5TozE5ynNk0pA6vDVU 0TZ809zNTvM5oxVT5AXWSXUuc5WPZxSB0HTD2TFf+roeX9JNFJx3ddV8dR+kubQ9+pWta/zD6dEQC Q4fuvBfYcD3w5koA610V7/U2G261OJmeodDtzxq1GvpCkUbNXSX9eUq6Mlgufabd69b37pQR84wLA 1+E7uf99vXEtoXEYcXxmZHr59a8B1I1P8GyU0BHPY5vKjN4koHxnNVgweeky7rTt5XVqRHJ3ngAN6 AKSo+BnBhifcjCEjUXFmxjxm6zzM2YJ8aHgQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rfHqw-0000000C5pS-10Tv; Wed, 28 Feb 2024 12:11:58 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] wifi: cw1200: restore endian swapping Date: Wed, 28 Feb 2024 12:11:56 +0100 Message-ID: <20240228121156.62f820aa6dfb.Ia63314e4d0ed1ee76f100846d68f0722abf6b793@changeid> X-Mailer: git-send-email 2.43.2 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 The code here looks well thought-out, so it seems likely that the byte-swaps are actually needed, due to SPI bus and device behaviour. Restore the byte-swapping, in a way that doesn't result in sparse warnings. Fixes: 7ceade653429 ("wifi: cw1200: fix __le16 sparse warnings") Signed-off-by: Johannes Berg --- drivers/net/wireless/st/cw1200/cw1200_spi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/st/cw1200/cw1200_spi.c b/drivers/net/wireless/st/cw1200/cw1200_spi.c index fb3aafcafe18..4f346fb977a9 100644 --- a/drivers/net/wireless/st/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/st/cw1200/cw1200_spi.c @@ -81,6 +81,9 @@ static int cw1200_spi_memcpy_fromio(struct hwbus_priv *self, pr_info("READ : %04d from 0x%02x (%04x)\n", count, addr, regaddr); #endif + /* Header is LE16 */ + regaddr = (__force u16)cpu_to_le16(regaddr); + /* We have to byteswap if the SPI bus is limited to 8b operation or we are running on a Big Endian system */ @@ -143,6 +146,9 @@ static int cw1200_spi_memcpy_toio(struct hwbus_priv *self, pr_info("WRITE: %04d to 0x%02x (%04x)\n", count, addr, regaddr); #endif + /* Header is LE16 */ + regaddr = (__force u16)cpu_to_le16(regaddr); + /* We have to byteswap if the SPI bus is limited to 8b operation or we are running on a Big Endian system */ -- 2.43.2