netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] LIB82596: correct data types for hardware addresses
Date: Sat, 01 Dec 2007 16:43:02 -0500	[thread overview]
Message-ID: <4751D566.7070703@pobox.com> (raw)
In-Reply-To: <20071130221316.3CDBEC2EAD@solo.franken.de>

Thomas Bogendoerfer wrote:
> dma_addr_t is 64bit wide on some architectures (for example 64bit MIPS),
> so it's not a good idea to use it for 32bit wide addresses in descriptors.
> 
> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> ---
> 
>  drivers/net/lib82596.c |   50 ++++++++++++++++++++++++------------------------
>  1 files changed, 25 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/net/lib82596.c b/drivers/net/lib82596.c
> index 9a855e5..b59f442 100644
> --- a/drivers/net/lib82596.c
> +++ b/drivers/net/lib82596.c
> @@ -176,8 +176,8 @@ struct i596_reg {
>  struct i596_tbd {
>  	unsigned short size;
>  	unsigned short pad;
> -	dma_addr_t     next;
> -	dma_addr_t     data;
> +	u32            next;
> +	u32            data;
>  	u32 cache_pad[5];		/* Total 32 bytes... */
>  };

applied, though its incomplete for today's drivers.  I recommend 
converting those data types to the "sparse" data types that indicate 
endian-ness (see __le32, etc.).  Then verify that the code passes all 
sparse checks.

See Documentation/sparse.txt for more info.

Also, make sure it passes scripts/checkpatch.pl checks too, while you're 
at it...

Thanks,

	Jeff




      reply	other threads:[~2007-12-01 21:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30 22:13 [PATCH] LIB82596: correct data types for hardware addresses Thomas Bogendoerfer
2007-12-01 21:43 ` Jeff Garzik [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=4751D566.7070703@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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).