Thread (72 messages) 72 messages, 7 authors, 2011-03-03

Re: [PATCH v3] net: add Faraday FTMAC100 10/100 Ethernet driver

flat view

From: Michał Mirosław <hidden>
Date: 2011-01-20 19:01:49
Also in: lkml

2011/1/20 Po-Yu Chuang [off-list ref]:
[...]
quoted hunk ↗ jump to hunk
+/******************************************************************************
+ * internal functions (receive descriptor)
+ *****************************************************************************/
+static bool ftmac100_rxdes_first_segment(struct ftmac100_rxdes *rxdes)
+{
+       return le32_to_cpu(rxdes->rxdes0) & FTMAC100_RXDES0_FRS;
+}
+
+static bool ftmac100_rxdes_last_segment(struct ftmac100_rxdes *rxdes)
+{
+       return le32_to_cpu(rxdes->rxdes0) & FTMAC100_RXDES0_LRS;
+}
+
[...]

You can change these and similar functions to use:

rxdes->rxdes0 & cpu_to_le32(FTMAC100_RXDES0_LRS)

This will be subject to constant folding by compiler and produce
better code for big-endian arches.

Best Regards,
Michał Mirosław
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help