On Thu, 2010-02-04 at 17:56 +0200, Yevgeny Petrilin wrote:
[...]
Do you really want the last byte to be 0 always?
Assuming you don't, you can avoid the inner loop by writing:
union {
u8 bytes[ETH_ALEN];
__le64 qword;
} rand_mac = {
.qword = 0
};
...
random_ether_addr(rand_mac.bytes);
caps->def_mac[i] = le64_to_cpup(&rand_mac.qword);
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html