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

Raphaël Beamonte raphael.beamonte at gmail.com
Mon Aug 17 12:55:06 EDT 2015


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(-)

-- 
2.1.4




More information about the Kernelnewbies mailing list