From: Krzysztof Kozlowski <krzk@kernel.org>
To: David Miller <davem@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] net: ethernet: 3c515: Fix cast from pointer to integer of different size
Date: Tue, 7 Jan 2020 09:35:48 +0100 [thread overview]
Message-ID: <20200107083548.GA31906@pi3> (raw)
In-Reply-To: <20200106.133155.1221137250116950495.davem@redhat.com>
On Mon, Jan 06, 2020 at 01:31:55PM -0800, David Miller wrote:
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Date: Sat, 4 Jan 2020 15:33:05 +0100
>
> > Pointer passed as integer should be cast to unsigned long to
> > avoid warning (compile testing on alpha architecture):
> >
> > drivers/net/ethernet/3com/3c515.c: In function ‘corkscrew_start_xmit’:
> > drivers/net/ethernet/3com/3c515.c:1066:8: warning:
> > cast from pointer to integer of different size [-Wpointer-to-int-cast]
> >
> > Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> >
> > ---
> >
> > Only compile tested
>
> Sorry, I'm not applying these two.
>
> It is clear that these drivers only work properly on 32-bit architectures
> where virtual address equals the DMA address.
>
> Making this warning goes away creates a false sense that they are in
> fact 64-bit clean and capable, they are not.
The existing casts are clearly wrong - the convention is that pointer
should be cast to unsigned long, not int. In the second case it is even
weirder - the buffer array is actually unsigned long so the cast is
confusing.
However I understand your argument that these casts serve as a
documentation purpose of only 32-bit support, so let it be.
Thanks!
Best regards,
Krzysztof
prev parent reply other threads:[~2020-01-07 8:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-04 14:33 [PATCH 1/2] net: ethernet: 3c515: Fix cast from pointer to integer of different size Krzysztof Kozlowski
2020-01-04 14:33 ` [PATCH 2/2] net: ethernet: ni65: " Krzysztof Kozlowski
2020-01-06 21:31 ` [PATCH 1/2] net: ethernet: 3c515: " David Miller
2020-01-07 8:35 ` Krzysztof Kozlowski [this message]
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=20200107083548.GA31906@pi3 \
--to=krzk@kernel.org \
--cc=davem@redhat.com \
--cc=linux-kernel@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 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.