diff mbox series

[net-next] net: moxa: fix endianness-related issues from 'sparse'

Message ID 20220902125037.1480268-1-saproj@gmail.com (mailing list archive)
State Accepted
Commit 03fdb11da92fde0bdc0b6e9c1c642b7414d49e8d
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: moxa: fix endianness-related issues from 'sparse' | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: edumazet@google.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: A patch subject line should describe the change not the tool that found it
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline warning Was 2 now: 2

Commit Message

Sergei Antonov Sept. 2, 2022, 12:50 p.m. UTC
Sparse checker found two endianness-related issues:

.../moxart_ether.c:34:15: warning: incorrect type in assignment (different base types)
.../moxart_ether.c:34:15:    expected unsigned int [usertype]
.../moxart_ether.c:34:15:    got restricted __le32 [usertype]

.../moxart_ether.c:39:16: warning: cast to restricted __le32

Fix them by using __le32 type instead of u32.

Signed-off-by: Sergei Antonov <saproj@gmail.com>
---
 drivers/net/ethernet/moxa/moxart_ether.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 6, 2022, 8:50 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Fri,  2 Sep 2022 15:50:37 +0300 you wrote:
> Sparse checker found two endianness-related issues:
> 
> .../moxart_ether.c:34:15: warning: incorrect type in assignment (different base types)
> .../moxart_ether.c:34:15:    expected unsigned int [usertype]
> .../moxart_ether.c:34:15:    got restricted __le32 [usertype]
> 
> .../moxart_ether.c:39:16: warning: cast to restricted __le32
> 
> [...]

Here is the summary with links:
  - [net-next] net: moxa: fix endianness-related issues from 'sparse'
    https://git.kernel.org/netdev/net-next/c/03fdb11da92f

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
index 9e57d23e57bf..3da99b62797d 100644
--- a/drivers/net/ethernet/moxa/moxart_ether.c
+++ b/drivers/net/ethernet/moxa/moxart_ether.c
@@ -29,12 +29,12 @@ 
 
 #include "moxart_ether.h"
 
-static inline void moxart_desc_write(u32 data, u32 *desc)
+static inline void moxart_desc_write(u32 data, __le32 *desc)
 {
 	*desc = cpu_to_le32(data);
 }
 
-static inline u32 moxart_desc_read(u32 *desc)
+static inline u32 moxart_desc_read(__le32 *desc)
 {
 	return le32_to_cpu(*desc);
 }