Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8712: changed typecast to __le

Fixed sparse warning.
Changed uint to __le16 and __le32.

Signed-off-by: Jannik Becher <becher.jannik@gmail.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jannik Becher and committed by
Greg Kroah-Hartman
aa2e04bc 3d7164c3

+6 -6
+6 -6
drivers/staging/rtl8712/hal_init.c
··· 117 117 118 118 static void update_fwhdr(struct fw_hdr *pfwhdr, const u8 *pmappedfw) 119 119 { 120 - pfwhdr->signature = le16_to_cpu(*(u16 *)pmappedfw); 121 - pfwhdr->version = le16_to_cpu(*(u16 *)(pmappedfw + 2)); 120 + pfwhdr->signature = le16_to_cpu(*(__le16 *)pmappedfw); 121 + pfwhdr->version = le16_to_cpu(*(__le16 *)(pmappedfw + 2)); 122 122 /* define the size of boot loader */ 123 - pfwhdr->dmem_size = le32_to_cpu(*(uint *)(pmappedfw + 4)); 123 + pfwhdr->dmem_size = le32_to_cpu(*(__le32 *)(pmappedfw + 4)); 124 124 /* define the size of FW in IMEM */ 125 - pfwhdr->img_IMEM_size = le32_to_cpu(*(uint *)(pmappedfw + 8)); 125 + pfwhdr->img_IMEM_size = le32_to_cpu(*(__le32 *)(pmappedfw + 8)); 126 126 /* define the size of FW in SRAM */ 127 - pfwhdr->img_SRAM_size = le32_to_cpu(*(uint *)(pmappedfw + 12)); 127 + pfwhdr->img_SRAM_size = le32_to_cpu(*(__le32 *)(pmappedfw + 12)); 128 128 /* define the size of DMEM variable */ 129 - pfwhdr->fw_priv_sz = le32_to_cpu(*(uint *)(pmappedfw + 16)); 129 + pfwhdr->fw_priv_sz = le32_to_cpu(*(__le32 *)(pmappedfw + 16)); 130 130 } 131 131 132 132 static u8 chk_fwhdr(struct fw_hdr *pfwhdr, u32 ulfilelength)