Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1286107 > unrolled thread
| Started by | Felix Fietkau <nbd@openwrt.org> |
|---|---|
| First post | 2015-12-08 00:40 +0100 |
| Last post | 2015-12-08 00:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] net: emac: emac gigabit ethernet controller driver Felix Fietkau <nbd@openwrt.org> - 2015-12-08 00:40 +0100
Re: [PATCH] net: emac: emac gigabit ethernet controller driver Gilad Avidov <gavidov@codeaurora.org> - 2015-12-08 00:50 +0100
| From | Felix Fietkau <nbd@openwrt.org> |
|---|---|
| Date | 2015-12-08 00:40 +0100 |
| Subject | Re: [PATCH] net: emac: emac gigabit ethernet controller driver |
| Message-ID | <qDdxU-2Vw-17@gated-at.bofh.it> |
On 2015-12-07 23:58, Gilad Avidov wrote:
> +/* RRD (Receive Return Descriptor) */
> +union emac_rrd {
> + struct {
> + /* 32bit word 0 */
> + u32 xsum:16;
> + u32 nor:4; /* number of RFD */
> + u32 si:12; /* start index of rfd-ring */
> + /* 32bit word 1 */
> + u32 hash;
> + /* 32bit word 2 */
You should never use bitfields for hardware structs.
I think in general, kernel code should be made endian safe, even if you
only care about one particular endian type for your platform.
- Felix
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Gilad Avidov <gavidov@codeaurora.org> |
|---|---|
| Date | 2015-12-08 00:50 +0100 |
| Message-ID | <qDdHz-2YK-11@gated-at.bofh.it> |
| In reply to | #1286107 |
On Tue, 8 Dec 2015 00:33:04 +0100
Felix Fietkau <nbd@openwrt.org> wrote:
> On 2015-12-07 23:58, Gilad Avidov wrote:
> > +/* RRD (Receive Return Descriptor) */
> > +union emac_rrd {
> > + struct {
> > + /* 32bit word 0 */
> > + u32 xsum:16;
> > + u32 nor:4; /* number of RFD */
> > + u32 si:12; /* start index of rfd-ring */
> > + /* 32bit word 1 */
> > + u32 hash;
> > + /* 32bit word 2 */
> You should never use bitfields for hardware structs.
> I think in general, kernel code should be made endian safe, even if
> you only care about one particular endian type for your platform.
>
> - Felix
Thank you Felix,
I will change the bit fields to bitwise operations and macros.
Gilad
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web