From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Joe Perches <joe@perches.com>
Cc: "David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"Linux/m68k" <linux-m68k@vger.kernel.org>
Subject: Re: drivers/net/mac8390.c: Remove useless memcpy casting
Date: Sun, 7 Mar 2010 10:19:40 +0100 [thread overview]
Message-ID: <10f740e81003070119s3eb433d9r4f1cc79e59d56316@mail.gmail.com> (raw)
In-Reply-To: <201003022001.o22K16vJ011337@hera.kernel.org>
On Tue, Mar 2, 2010 at 21:01, Linux Kernel Mailing List
<linux-kernel@vger.kernel.org> wrote:
> Gitweb: http://git.kernel.org/linus/5c7fffd0e3b57cb63f50bbd710868f012d67654f
> Commit: 5c7fffd0e3b57cb63f50bbd710868f012d67654f
> Parent: 35076402a9936fa8a73b57a1f97fecbeceeec34a
> Author: Joe Perches <joe@perches.com>
> AuthorDate: Mon Jan 4 11:53:00 2010 +0000
> Committer: David S. Miller <davem@davemloft.net>
> CommitDate: Wed Jan 6 20:44:02 2010 -0800
>
> drivers/net/mac8390.c: Remove useless memcpy casting
>
> Signed-off-by: Joe Perches <joe@perches.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> drivers/net/mac8390.c | 19 ++++++++++---------
> 1 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c
> index 6b6f375..517cee4 100644
> --- a/drivers/net/mac8390.c
> +++ b/drivers/net/mac8390.c
> @@ -237,14 +237,14 @@ static enum mac8390_access __init mac8390_testio(volatile unsigned long membase)
As indicated by the prototype above, membase is not a pointer...
> unsigned long outdata = 0xA5A0B5B0;
> unsigned long indata = 0x00000000;
> /* Try writing 32 bits */
> - memcpy((char *)membase, (char *)&outdata, 4);
> + memcpy(membase, &outdata, 4);
> /* Now compare them */
> if (memcmp((char *)&outdata, (char *)membase, 4) == 0)
> return ACCESS_32;
> /* Write 16 bit output */
> - word_memcpy_tocard((char *)membase, (char *)&outdata, 4);
> + word_memcpy_tocard(membase, &outdata, 4);
> /* Now read it back */
> - word_memcpy_fromcard((char *)&indata, (char *)membase, 4);
> + word_memcpy_fromcard(&indata, membase, 4);
> if (outdata == indata)
> return ACCESS_16;
> return ACCESS_UNKNOWN;
... hence you introduced 3 compiler warnings:
drivers/net/mac8390.c:249: warning: passing argument 1 of
'__builtin_memcpy' makes pointer from integer without a cast
drivers/net/mac8390.c:254: warning: passing argument 1 of
'word_memcpy_tocard' makes pointer from integer without a cast
drivers/net/mac8390.c:256: warning: passing argument 2 of
'word_memcpy_fromcard' makes pointer from integer without a cast
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next parent reply other threads:[~2010-03-07 9:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201003022001.o22K16vJ011337@hera.kernel.org>
2010-03-07 9:19 ` Geert Uytterhoeven [this message]
2010-03-08 16:16 ` drivers/net/mac8390.c: Remove useless memcpy casting Joe Perches
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=10f740e81003070119s3eb433d9r4f1cc79e59d56316@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).