From patchwork Tue Jan 30 15:15:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 768405 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5C28581AB6 for ; Tue, 30 Jan 2024 15:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627760; cv=none; b=L9+xXqvR3medVx+f90aebC9laYN3YM1Gfx/G+197E2DVgZLKzMaM6V3yJOQtHex13BcEppff+kfFw0Xr+ZIfH1kExppLERpHgvVEJd6qv8pmw/Cif3ynfu12QrIzK88lPYH7vhzPDCZ4gcrZ8jM+mtbag3gOBEOa4ML+whtJ2pY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627760; c=relaxed/simple; bh=sEVJJm4UKZVfvmZUWFRBTTWSMsrevLrRpTcncgmRbuQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uzI68OU48Xy78tfA29zw+gNliqgR1NcHqVHlqQp8a7I70eAgRkj/k9I+aWXtPFbambJNbTEvuJ+YueR3ZZtUYqRf8Fr5tM4yTAiTi9o3g6T42tTQ96JjJDVBc5i4dUlLu8lGBmFdbkIDPaHEBHJBWA3D2wjgyrJrZQu24AYcc3E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fxHQKXzj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fxHQKXzj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C459C433A6; Tue, 30 Jan 2024 15:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706627759; bh=sEVJJm4UKZVfvmZUWFRBTTWSMsrevLrRpTcncgmRbuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fxHQKXzjQO01K8aC0cwHeVTVoU50V9S1XN17T36oxEd2ojzgninbO2MbUdrBCAYF8 pUzYZgevgicdiTQn6210Wm6FfHABBpujlU/3twHxMMfOY870PYFLOnv40I6humbNn1 2H70YO3zyanfMlFHd8TTrnQU26p/U4JplFB83z4syhCQ1IT0vck3gHLCy49vH76cp5 Z+xSXbHkaqQznSYzf5YVC74PFePa+2ycbbMVfANb5p1D41SYidOLcu1l4mJLs+UTz7 BEBUKn2wXUuh5zXu1zkPPEPyanPIqYYsZtTMbRamH+BCf2dRWz6PoubUrTUFe+ZZEK /9QCQDC3H+I3w== From: Kalle Valo To: linux-wireless@vger.kernel.org Cc: xl@wp.pl Subject: [PATCH 1/4] wifi: zd1211rw: remove __nocast from zd_addr_t Date: Tue, 30 Jan 2024 17:15:53 +0200 Message-Id: <20240130151556.2315951-2-kvalo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130151556.2315951-1-kvalo@kernel.org> References: <20240130151556.2315951-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sparse warns: drivers/net/wireless/zydas/zd1211rw/zd_usb.c:383:24: warning: implicit cast from nocast type drivers/net/wireless/zydas/zd1211rw/zd_usb.c:419:24: warning: implicit cast from nocast type This is an ancient driver which has not have any meaningfuli changes for a long time and hopefully removed soon. So just remove the __nocast to get rid of the sparse warnings. Compile tested only. Signed-off-by: Kalle Valo --- drivers/net/wireless/zydas/zd1211rw/zd_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_def.h b/drivers/net/wireless/zydas/zd1211rw/zd_def.h index 8ca2d0aab170..2f55e8deee82 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_def.h +++ b/drivers/net/wireless/zydas/zd1211rw/zd_def.h @@ -12,7 +12,7 @@ #include #include -typedef u16 __nocast zd_addr_t; +typedef u16 zd_addr_t; #define dev_printk_f(level, dev, fmt, args...) \ dev_printk(level, dev, "%s() " fmt, __func__, ##args) From patchwork Tue Jan 30 15:15:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 768832 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6C5A6823B3 for ; Tue, 30 Jan 2024 15:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627761; cv=none; b=pvlMnDFeF5zIC41AYr3P4u4ZJhqr1SLZH1uDh4TMAS9EPXrX1awmsQOKQfj1EDu/oxkmEdjSLawBaiwb87n3QPHGamW0mvWo0xEpFV7Y3HaycDc4CvgTP2azCA5WjbLQXeDe66nT6MSK4ZFKeHgSuoYoonvgV3P36pomH3cH/cE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627761; c=relaxed/simple; bh=s5Y+P0O9OKlotbVfhZrh6FsjQx6MHf41BjyaHQPEXaA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qAIw1qn3iCPIWjrQAdhTYRDEmP3E7bCCMOPE6FS/c4pBB9s5n7y6t5MwAvnRjhZpHdVdvHNJAtvCX1p9oNK3Jl3W74G66EIvSZC+23YH72kUr1QjbblYXQKEn/54NUcMDJWB8diFomJQpH+jAEQfr0xLrRApszSlHKfi81Ek1R8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IJy/aMNG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IJy/aMNG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ADCBC43609; Tue, 30 Jan 2024 15:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706627760; bh=s5Y+P0O9OKlotbVfhZrh6FsjQx6MHf41BjyaHQPEXaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IJy/aMNGbjTo0+FhDrRHxpyV/ED4hPKh/dSnt/70ee7IDesiXinoJuOF0PWoQA7a5 i2NbCTowo++f7Kmyc36C7UwKuqHaOIEjzDAXx4Wg1LQ8vZbR/JTHO9aheQFcy7wbTs DiP+l4t0ZHvtocPZ/vCzp3v4xqB2WE9q+mzAbFMXJN1zBq0l/JHWYKZ+tqofx58pSp 7xVp4RC/t0nDJtxMIccSUTYvfrOAJ1v4/aeCuTppNF0rFwzTusN/sdDGLjjNeh0fJ6 O49fCVPGpqgkirn0gBJuvj7TrTrR4SVnWu7bQ97QdvJ+zEIwoNPYHwDYfpMwqfhHdi O0M9haVsKfZHw== From: Kalle Valo To: linux-wireless@vger.kernel.org Cc: xl@wp.pl Subject: [PATCH 2/4] wifi: rsi: fix restricted __le32 degrades to integer sparse warnings Date: Tue, 30 Jan 2024 17:15:54 +0200 Message-Id: <20240130151556.2315951-3-kvalo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130151556.2315951-1-kvalo@kernel.org> References: <20240130151556.2315951-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 drivers/net/wireless/rsi/rsi_91x_usb.c:235:27: warning: restricted __le32 degrades to integer drivers/net/wireless/rsi/rsi_91x_usb.c:236:27: warning: restricted __le32 degrades to integer drivers/net/wireless/rsi/rsi_91x_usb.c:237:27: warning: restricted __le32 degrades to integer drivers/net/wireless/rsi/rsi_91x_usb.c:238:27: warning: restricted __le32 degrades to integer drivers/net/wireless/rsi/rsi_91x_usb.c:244:36: warning: restricted __le32 degrades to integer drivers/net/wireless/rsi/rsi_91x_usb.c:245:35: warning: restricted __le32 degrades to integer These cpu_to_le32() are not making sense. With usb_reg_buf we handle the values byte at a time to make sure usb_reg_buf is in little endian so no need to convert anything. And usb_control_msg() expects to have the values in native endian anyway. So just remove these so they are not spamming our logs. Compile tested only. Signed-off-by: Kalle Valo --- drivers/net/wireless/rsi/rsi_91x_usb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index 10a465686439..dccc139cabb2 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -232,17 +232,17 @@ 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] = value & 0x00ff; + usb_reg_buf[1] = (value & 0xff00) >> 8; + usb_reg_buf[2] = (value & 0x00ff0000) >> 16; + usb_reg_buf[3] = (value & 0xff000000) >> 24; 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), + (reg & 0xffff0000) >> 16, + reg & 0xffff, (void *)usb_reg_buf, len, USB_CTRL_SET_TIMEOUT); From patchwork Tue Jan 30 15:15:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 768404 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 81ECC7F7F8 for ; Tue, 30 Jan 2024 15:16:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627762; cv=none; b=j5q2aUAKXtaxWW35eElpeC3gofzYq3ndRnob1CS6W/NmWL/B7goMrM0zRDrWDX4fEUaO0f9hFaLYk65tdV8JwT+WJRzf/eGHJLWz4V+pZJuQ2+PD2h6XUctkTLDsDyJM3E7r9SFiRwvPMj9CVBHmULrb63Nz25aBuTTA+b6mYgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627762; c=relaxed/simple; bh=661G/XNd/XpaNMgjXRXDDVUfCFyZa8CkM+1nZ+Jeon8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=S7vZFrOOc8Vx5aa/lrzJawG2RUfvWD2q8xYhxMd4ikpo/dUGtNcLkaYmKKrqOVOzz56Jr00OMCvY2LShjOv7HhQWd6wkNm6dMBTjqWBkvCnv9WKHWxgCv8yI09dclqOJlHUpL1GFOahFFGa5u+pHpRljkhFRBIcR5mOJfu20Fxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TVxwOnV9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TVxwOnV9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A4DBC43142; Tue, 30 Jan 2024 15:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706627762; bh=661G/XNd/XpaNMgjXRXDDVUfCFyZa8CkM+1nZ+Jeon8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TVxwOnV9cVfGDeRVXgWohtCvXjM44gsm84TqVaKoygtd5Ea5PPAEKNk4LEuFm/7n7 5J90lb90zWBjl6fMEu88YVagQ3hjy3QX+vAygMIlD1gFlhTBm9UYxzUBPdpL1l0DFm 8YgJWEC9yokz2mFam4OUa+ITm8F7gqf9s/cdsB7ha3ouggKrXbfgeYVRG3QOj2CDQH ubhKOkgxpdg/6GI44Ve7Sosn6inmQWbWBsUtOuVOnIjD+bakI+US+WDWwUZ6f8r6gd Vy9LcHBGD+c6mr9pdih6LKKYNxZ6zm9qaKwvl1bZBbPWYnno1iaZrf9fyF18FzLLu3 yz95S70D6AhNQ== From: Kalle Valo To: linux-wireless@vger.kernel.org Cc: xl@wp.pl Subject: [PATCH 3/4] wifi: cw1200: fix __le16 sparse warnings Date: Tue, 30 Jan 2024 17:15:55 +0200 Message-Id: <20240130151556.2315951-4-kvalo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130151556.2315951-1-kvalo@kernel.org> References: <20240130151556.2315951-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sparse warns: drivers/net/wireless/st/cw1200/cw1200_spi.c:83:17: got restricted __le16 [usertype] drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17: warning: incorrect type in assignment (different base types) drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17: expected unsigned short [addressable] [assigned] [usertype] regaddr drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17: got restricted __le16 [usertype] These cpu_to_le16() calls are not really making any sense to me. On a big endian system we first convert regaddr from big to little using cpu_to_le16() but immediately after we convert them back to big endian? So just remove them. Compile tested only. Signed-off-by: Kalle Valo --- drivers/net/wireless/st/cw1200/cw1200_spi.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/wireless/st/cw1200/cw1200_spi.c b/drivers/net/wireless/st/cw1200/cw1200_spi.c index c82c0688b549..b27b57fc25bc 100644 --- a/drivers/net/wireless/st/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/st/cw1200/cw1200_spi.c @@ -79,9 +79,6 @@ 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 = 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 */ @@ -144,9 +141,6 @@ 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 = 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 */ From patchwork Tue Jan 30 15:15:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 768831 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3B08F82D74 for ; Tue, 30 Jan 2024 15:16:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627763; cv=none; b=KjaJcf28epCVMsr3nLw2dAtzyvRNnb2jn/S88m5HYbt5FvZ50i5H26aUhnY0YAKtoVSauGArWOFPSHx8jvI0s4CfegkICYPNvkFgGZOYJwzqqvQdGe3MbAhk+pjb5LyifAplLlMR5/1qHIUGx9ILLr9Gf2x8JRbLLRlf074S710= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627763; c=relaxed/simple; bh=dLtn+d92qFT0cX+Rq4JpFNoJDaDmwf6jvb8ASjLVIf8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=APbi4auRSx3wCTY/4ANNr0xNy4QGp+sL5kp7mNtl0Opfjam2128nAJKjP4oE7rjgWQJus3ELV683TKej82N3NQkp+AcSoL1znMB7lJjjxDCSwTuhL15ThRKC5MKI/jDESx6P1eXDvO43fXao+9J2CphwkaacHKLdqi0plQhbqbQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JCLAN1BI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JCLAN1BI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AAEDC43609; Tue, 30 Jan 2024 15:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706627763; bh=dLtn+d92qFT0cX+Rq4JpFNoJDaDmwf6jvb8ASjLVIf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JCLAN1BIRn5o2+x+Xjo1PWUeB+NGOa7WAVRees7WNT3Qb3lJi5fBwwbuxxOhE/W1B s8PLBzy4Gcxr2ksmU8HYxbsMJopJ7yfIQrxonWz66pq52jEqh43OM19yGLV+tQEtlo uZ2MsCJ+5E9UNN/cmiyfCNQWazVw8YvroVHgF1zW7rjwb/jsCCJJ7UjJ2Al1VXgjzp 4crJyvdfC8xwJPmNhv2v/OsqaiH6uw9IrkQV4P7YnEzy6FRkbf+DLWroAA2o8ydQ1A 68eaK9g3mhhTHudlWGyaEKl4fOJIdmCTCHIln+Lg0xNL3pUmyMnyz3lyJ6gc+f8s/1 OxWN5pTlIUiKg== From: Kalle Valo To: linux-wireless@vger.kernel.org Cc: xl@wp.pl Subject: [PATCH 4/4] wifi: rt2x00: fix __le32 sparse warnings Date: Tue, 30 Jan 2024 17:15:56 +0200 Message-Id: <20240130151556.2315951-5-kvalo@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240130151556.2315951-1-kvalo@kernel.org> References: <20240130151556.2315951-1-kvalo@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sparse warns: drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10949:39: warning: incorrect type in assignment (different base types) drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10949:39: expected unsigned int [usertype] drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10949:39: got restricted __le32 [usertype] drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10951:43: warning: incorrect type in assignment (different base types) drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10951:43: expected unsigned int [usertype] drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10951:43: got restricted __le32 [usertype] drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10953:43: warning: incorrect type in assignment (different base types) drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10953:43: expected unsigned int [usertype] drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10953:43: got restricted __le32 [usertype] drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10955:43: warning: incorrect type in assignment (different base types) drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10955:43: expected unsigned int [usertype] drivers/net/wireless/ralink/rt2x00/rt2800lib.c:10955:43: got restricted __le32 [usertype] rt2x00 does some wicked casting here so no wonder sparse warns. Clean that up and use cpu_to_le16() to avoid any warnings. Compile tested only. Signed-off-by: Kalle Valo --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c index aaf31857ae1e..8e8fab88fb2b 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c @@ -10946,13 +10946,20 @@ static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i) /* Apparently the data is read from end to start */ reg = rt2800_register_read_lock(rt2x00dev, efuse_data3_reg); /* The returned value is in CPU order, but eeprom is le */ - *(u32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg); + rt2x00dev->eeprom[i] = cpu_to_le16(reg); + rt2x00dev->eeprom[i + 1] = cpu_to_le16(upper_16_bits(reg)); + reg = rt2800_register_read_lock(rt2x00dev, efuse_data2_reg); - *(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg); + rt2x00dev->eeprom[i + 2] = cpu_to_le16(reg); + rt2x00dev->eeprom[i + 3] = cpu_to_le16(upper_16_bits(reg)); + reg = rt2800_register_read_lock(rt2x00dev, efuse_data1_reg); - *(u32 *)&rt2x00dev->eeprom[i + 4] = cpu_to_le32(reg); + rt2x00dev->eeprom[i + 4] = cpu_to_le16(reg); + rt2x00dev->eeprom[i + 5] = cpu_to_le16(upper_16_bits(reg)); + reg = rt2800_register_read_lock(rt2x00dev, efuse_data0_reg); - *(u32 *)&rt2x00dev->eeprom[i + 6] = cpu_to_le32(reg); + rt2x00dev->eeprom[i + 6] = cpu_to_le16(reg); + rt2x00dev->eeprom[i + 7] = cpu_to_le16(upper_16_bits(reg)); mutex_unlock(&rt2x00dev->csr_mutex); }