From: raphael.beamonte@gmail.com (Raphaël Beamonte)
To: kernelnewbies@lists.kernelnewbies.org
Subject: [PATCH 0/1] staging: wilc1000: need feedback about a patch
Date: Mon, 17 Aug 2015 12:55:06 -0400 [thread overview]
Message-ID: <cover.1439829770.git.raphael.beamonte@gmail.com> (raw)
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
next reply other threads:[~2015-08-17 16:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-17 16:55 Raphaël Beamonte [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1439829770.git.raphael.beamonte@gmail.com \
--to=raphael.beamonte@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.