Skip to content

staging: wilc1000: need feedback about a patch

Raphaël Beamonte kernelnewbies 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1staging: wilc1000: replace addresses variables type from u32 to size_t for x64 systemsdrivers/staging/wilc1000/coreconfigurator.c drivers/staging/wilc1000/coreconfigurator.h drivers/staging/wilc1000/host_interface.c +1 more+66 -660 replies
1/1staging: wilc1000: replace addresses variables type from u32 to size_t for x64 systems+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] staging: wilc1000: need feedback about a patch

Hello there,

I just started patching some drivers to familiarize myself better with the kernel and perhaps contribute more to it if I find things that I can actually handle! (hoping I'll be able to handle more and more throughout time).

Doing so, I found out that in the wilc1000 (staging) driver, I got compiler warnings for casts from u32 variables to pointers and pointers to u32 variables. Of course, as my system is 64 bits, the pointers are stored on that format, while u32 is stored on only 32 bits, making this cast insecure. Replacing the u32 variables by size_t ones corrects this behavior, as size_t is stored on 32 bits for 32 bits systems and 64 bits for 64 bits systems. But I'm wondering if doing so breaks everything here? I mean, why use u32 instead of int at first if 32 bits wasn't needed? Also, there is a variable named u32address, which clearly states that u32 was researched here.

So, you'll find following this email the patch I made for the file host_interface.c which was reporting these warnings a lot. I'd like to get some advice on that patch: is it a good idea to do that? If so, can I improve it? If no, what can I do differently to correct those warnings? I'm here to learn, all feedbacks are welcome!

Once everything is figured out on how to correct that, I'll be happy to apply that correction to the other files of the modules that still report that warning!

Thanks,
Rapha?l

Rapha?l Beamonte (1):
staging: wilc1000: replace addresses variables type from u32 to size_t
for x64 systems

 drivers/staging/wilc1000/coreconfigurator.c |   2 +-
 drivers/staging/wilc1000/coreconfigurator.h |   2 +-
 drivers/staging/wilc1000/host_interface.c   | 126 ++++++++++++++--------------
 drivers/staging/wilc1000/host_interface.h   |   2 +-
 4 files changed, 66 insertions(+), 66 deletions(-)
Signature · 1 line
2.1.4