* [RFC] weirdness in cxgb3_main.c:init_tp_parity()
@ 2018-08-05 17:46 Al Viro
0 siblings, 0 replies; only message in thread
From: Al Viro @ 2018-08-05 17:46 UTC (permalink / raw)
To: Santosh Raspatur; +Cc: netdev
for (i = 0; i < 2048; i++) {
...
req->l2t_idx = htonl(V_L2T_W_IDX(i));
...
in there is very odd; l2t_idx is a 16bit field, and
#define V_L2T_W_IDX(x) ((x) << S_L2T_W_IDX)
#define S_L2T_W_IDX 0
IOW, we are taking htonl(something in range 0..2047) and
shove it into 16bit field. Which would, on a little-endian
host, be a fancy way of spelling
req->l2t_idx = 0;
What's the intended behaviour there? I'm not familiar with
the hardware in question; this smells like a typoed
req->l2t_idx = htons(...)
but how does the current code manage to work (i.e. does
anything even care about the value stored there)? It's not
a big-endian-only driver, after all...
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-08-05 19:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-05 17:46 [RFC] weirdness in cxgb3_main.c:init_tp_parity() Al Viro
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).