Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp871229rdb; Fri, 23 Feb 2024 02:45:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWk8NXwogtJdLSHYRnr2SuyG9Vcx2ALu9os2OeYb0k2LIBI/0EfJ3bCUqKpvu/aBsdVI5frtM0YDHj9HGFIo1fYMnUAACCtOVEwsgcbdQ== X-Google-Smtp-Source: AGHT+IGvHq/0qxngdoluQxrfZZyAKXQYcLPnBwLyTsomLS2gCk/yh/Gmd6DL8pj16EJj0qraacf1 X-Received: by 2002:a17:903:2b03:b0:1db:a0f0:fffe with SMTP id mc3-20020a1709032b0300b001dba0f0fffemr1764685plb.17.1708685114264; Fri, 23 Feb 2024 02:45:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708685114; cv=pass; d=google.com; s=arc-20160816; b=DMQa5WfjCETZ8VluTCb8tsLauMVb3D83DE+JIB1aD3iAtX/gOsa1vsfFUeh6tP9Nvb OozUsA4rx23eEPkV9UQ0/7hlC3hRTBPSofeeUIQN2zr3fEk2CgWYByKjRhWkPb1iD3gB SzH8vMhTtxDb3kVFUS0QncyFGlw5gXxx9+0ETar4Pi4xzlvb3wmhx24HOs/2iTjdpowk ipjyv12DR42MPIMVcwn7ejYS0XiCVjIFI6kn0b02s24RYzEK8J2kaJKaUhD+u+DYQ410 S/2gCE1lsZvZhLbeoMrg0lLTo9DNF033ErG0O7OsD8wiFIAfekt9bR99pc6K0cGgXYM1 IcTg== 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=JsyHyOE7XGMBIWQkskHzTGwQdcYe1pZjgIGs5D7Llgk=; fh=g3BFBLrKoEPOekXbJY1C5OfQeXpUnYwWgHlrpZTouHE=; b=oXIVbScWOmRDzulOD6UuK+gbPNvBuuZE7xZIWCOJEYxZzJW+wA+92EYecM3osnGpHP Z27qMylBrFJR1oI2nruWD6mB+7zS8TisflMmaa+MMslnA6JLjDiWka1TwiJ0EsFN2zqh 9AzjvKcTdVCZGJz8EGI98p2dpnII9wULxThPs/RRcXYfXmtKSevNsYCT/4R5ZhEY9Ih7 xnqn2/H1uxgzb4d5FaUdVUy6lKn9xjsYSWl8/2zDKcNf/BATO5eAA7k8atDUEBqJ1YGs TxH/AXp7Cd+yUndkODMXYeXkudfw7dYGsV851aKJSCTHsW9RWYMxggeyV/PAoSsJe6Qm magQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=G9Y1gaOQ; 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-3958-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3958-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c11-20020a170903234b00b001db47573c41si11032848plh.57.2024.02.23.02.45.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 02:45:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3958-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=G9Y1gaOQ; 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-3958-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3958-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EC15D285158 for ; Fri, 23 Feb 2024 10:45:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD498664B9; Fri, 23 Feb 2024 10:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="G9Y1gaOQ" 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 5775665189 for ; Fri, 23 Feb 2024 10:40:50 +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=1708684851; cv=none; b=nCeRz4G0qE4aYUIvr0SRr1xJd6crneVpx5z2InlqEAK/wCfO9MzvAWtUc8S4vh8jin2R2WS699GqaHGp+gs4aZLEXUU/IjofMuFThQwxDSTk7/EmEmE6CCnWbKekXCrc38ItDI7fBpkqyjbccYU527oLRJUsUjv9DhuOlBraE14= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708684851; c=relaxed/simple; bh=2Ny4ZKkPvfcxx0hqI52hsY8mzq6R+cI5RkmIGS/LIEU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ETZ32Is63JkYPw5PmM8NCb+d8S//Tu+4DqN33Bb0vyEtWvNfYflP7ix8THo2W6N8z7lUi2/4Av36TvDcENsxTl9iAhtpuXekq6Ft5/9AZ7M7M3iFyP6CEHOYGAlJYQZ560iAwczYqXrVxJXcilQ0Lr3k66SEUie27BPETRj1fe8= 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=G9Y1gaOQ; 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=JsyHyOE7XGMBIWQkskHzTGwQdcYe1pZjgIGs5D7Llgk=; t=1708684850; x=1709894450; b=G9Y1gaOQg5/f4qQ1vr2XQIeq+srjS6UT9buQ5n5dpOjjpUOlcD+JnCIMCkfYB+tpmUffFDzjgYf Imr6agjHTszRay56+KmbQpn4jQDZ4/mUDYbe2g0wmp1h4GZEB8stFR3zU7GzMaYaZp7lje5Xd8zPx sb6nP7/y0Qc4EWnEkximmDosrMIw1RfVFZFtqiXnDJtUyQgvCMRdpnaKXCzZDCGQoVnRJQFU4NBO2 WYg3zL7lQKX1iAME6CLSp56BI2Syfpsm0D4XSmHaSMTQg+E84aJwtmaqH6hAgSMnsUfLfqFNVPTZE BwHaI1up+8OYT98/e7ljRzxNLRVFSObSVuPg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rdSz1-000000051q6-47fD; Fri, 23 Feb 2024 11:40:48 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Siva Rebbagondla , Johannes Berg Subject: [PATCH] wifi: rsi: fix endian conversions Date: Fri, 23 Feb 2024 11:40:45 +0100 Message-ID: <20240223114045.7bfdc048832c.I576bbf9fe7ca2948dbe3e00c0fa0f37594e85046@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 This really seems like a bug, endian conversions now happen twice in this code. Remove one conversion to make sparse no longer warn, not sure anyone can even test this on big endian platforms. Fixes: 0a60014b76f5 ("rsi: miscallaneous changes for 9116 and common") Signed-off-by: Johannes Berg --- drivers/net/wireless/rsi/rsi_91x_usb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index 10a465686439..0ce8c9aad1f1 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -222,7 +222,7 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, u32 value, u16 len) { - u8 *usb_reg_buf; + __le32 *usb_reg_buf; int status = -ENOMEM; if (len > RSI_USB_CTRL_BUF_SIZE) @@ -232,17 +232,14 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, if (!usb_reg_buf) return status; - usb_reg_buf[0] = (cpu_to_le32(value) & 0x00ff); - usb_reg_buf[1] = (cpu_to_le32(value) & 0xff00) >> 8; - usb_reg_buf[2] = (cpu_to_le32(value) & 0x00ff0000) >> 16; - usb_reg_buf[3] = (cpu_to_le32(value) & 0xff000000) >> 24; + usb_reg_buf[0] = cpu_to_le32(value); status = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), USB_VENDOR_REGISTER_WRITE, RSI_USB_REQ_OUT, - ((cpu_to_le32(reg) & 0xffff0000) >> 16), - (cpu_to_le32(reg) & 0xffff), + upper_16_bits(reg), + lower_16_bits(reg), (void *)usb_reg_buf, len, USB_CTRL_SET_TIMEOUT); -- 2.43.2