All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] staging: wilc1000: need feedback about a patch
@ 2015-08-17 16:55 Raphaël Beamonte
  2015-08-17 16:55 ` [PATCH 1/1] staging: wilc1000: replace addresses variables type from u32 to size_t for x64 systems Raphaël Beamonte
  2015-08-17 19:55 ` [PATCH 0/1] staging: wilc1000: need feedback about a patch Greg Kroah-Hartman
  0 siblings, 2 replies; 5+ messages in thread
From: Raphaël Beamonte @ 2015-08-17 16:55 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-17 23:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-17 16:55 [PATCH 0/1] staging: wilc1000: need feedback about a patch Raphaël Beamonte
2015-08-17 16:55 ` [PATCH 1/1] staging: wilc1000: replace addresses variables type from u32 to size_t for x64 systems Raphaël Beamonte
     [not found]   ` <14628.1439831571@turing-police.cc.vt.edu>
2015-08-17 17:33     ` Raphaël Beamonte
2015-08-17 19:55 ` [PATCH 0/1] staging: wilc1000: need feedback about a patch Greg Kroah-Hartman
2015-08-17 23:20   ` Raphaël Beamonte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.