Message ID | 20201212234426.177015-1-kuba@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 8163962aadde4ab23ec794f30bf4972325bd6439 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: vxget: clean up sparse warnings | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 63 this patch: 3 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | warning | WARNING: A patch subject line should describe the change not the tool that found it |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 61 this patch: 1 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Sat, 12 Dec 2020 15:44:26 -0800 you wrote: > This code is copying strings in 64 bit quantities, the device > returns them in big endian. As long as we store in big endian > IOW endian on both sides matches, we're good, so swap to_be64, > not from be64. > > This fixes ~60 sparse warnings. > > [...] Here is the summary with links: - [net-next] net: vxget: clean up sparse warnings https://git.kernel.org/netdev/net-next/c/8163962aadde You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c index da48dd85770c..5162b938a1ac 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-config.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c @@ -871,11 +871,11 @@ static enum vxge_hw_status __vxge_hw_vpath_card_info_get(struct __vxge_hw_virtualpath *vpath, struct vxge_hw_device_hw_info *hw_info) { + __be64 *serial_number = (void *)hw_info->serial_number; + __be64 *product_desc = (void *)hw_info->product_desc; + __be64 *part_number = (void *)hw_info->part_number; enum vxge_hw_status status; u64 data0, data1 = 0, steer_ctrl = 0; - u8 *serial_number = hw_info->serial_number; - u8 *part_number = hw_info->part_number; - u8 *product_desc = hw_info->product_desc; u32 i, j = 0; data0 = VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_SERIAL_NUMBER; @@ -887,8 +887,8 @@ __vxge_hw_vpath_card_info_get(struct __vxge_hw_virtualpath *vpath, if (status != VXGE_HW_OK) return status; - ((u64 *)serial_number)[0] = be64_to_cpu(data0); - ((u64 *)serial_number)[1] = be64_to_cpu(data1); + serial_number[0] = cpu_to_be64(data0); + serial_number[1] = cpu_to_be64(data1); data0 = VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_PART_NUMBER; data1 = steer_ctrl = 0; @@ -900,8 +900,8 @@ __vxge_hw_vpath_card_info_get(struct __vxge_hw_virtualpath *vpath, if (status != VXGE_HW_OK) return status; - ((u64 *)part_number)[0] = be64_to_cpu(data0); - ((u64 *)part_number)[1] = be64_to_cpu(data1); + part_number[0] = cpu_to_be64(data0); + part_number[1] = cpu_to_be64(data1); for (i = VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_DESC_0; i <= VXGE_HW_RTS_ACCESS_STEER_DATA0_MEMO_ITEM_DESC_3; i++) { @@ -915,8 +915,8 @@ __vxge_hw_vpath_card_info_get(struct __vxge_hw_virtualpath *vpath, if (status != VXGE_HW_OK) return status; - ((u64 *)product_desc)[j++] = be64_to_cpu(data0); - ((u64 *)product_desc)[j++] = be64_to_cpu(data1); + product_desc[j++] = cpu_to_be64(data0); + product_desc[j++] = cpu_to_be64(data1); } return status;
This code is copying strings in 64 bit quantities, the device returns them in big endian. As long as we store in big endian IOW endian on both sides matches, we're good, so swap to_be64, not from be64. This fixes ~60 sparse warnings. Signed-off-by: Jakub Kicinski <kuba@kernel.org> --- .../net/ethernet/neterion/vxge/vxge-config.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)