From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Jeffrey Ladouceur <jladouceur@gmail.com>
Cc: Mark Einon <mark.einon@gmail.com>,
devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] staging: et131x: Fix 64bit tx dma address handling
Date: Thu, 18 Oct 2012 10:59:56 +0100 [thread overview]
Message-ID: <20121018105956.2f3ea239@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <CAEJO9GS6Q72bSc+FgK29=dASu+E731uL-nFApKw0-tMSjaTsDw@mail.gmail.com>
> > + skb_headlen(skb),
> > + DMA_TO_DEVICE);
> > + desc[frag].addr_lo = dma_addr & 0xFFFFFFFF;
> > + desc[frag].addr_hi = dma_addr >> 32;
>
> Maybe use macros defined in kernel.h instead:
>
> desc[frag].addr_lo = lower_32_bits(dma_addr);
> desc[frag].addr_hi = upper_32_bits(dma_addr);
>
> A few more instances below.
This is actually important because >> 32 of a 32bit value is undefined in
C. The compiler is free to do what it likes with this. While the results
are usually sane some architectures do generate the equivalent of
x >> (n % wordsize);
Alan
next prev parent reply other threads:[~2012-10-18 9:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-17 21:15 [PATCH 1/2] staging: et131x: Use skb_headlen() where appropriate Mark Einon
2012-10-17 21:15 ` [PATCH 2/2] staging: et131x: Fix 64bit tx dma address handling Mark Einon
2012-10-18 0:31 ` Jeffrey Ladouceur
2012-10-18 9:59 ` Alan Cox [this message]
2012-10-18 10:17 ` Mark Einon
2012-10-18 20:34 ` [PATCH 2/2 v2] " Mark Einon
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=20121018105956.2f3ea239@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jladouceur@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.einon@gmail.com \
/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