[ofa-general] [PATCH] UMAD: Correct unalign access bug on IA64

Roland Dreier rdreier at cisco.com
Wed Dec 3 07:51:03 PST 2008


thanks... a couple comments, since I don't think we need to write our
own helpers for this:

 > -		if ((hdr->tid != sent_hdr->tid) ||
 > +		if ((!cmp_tid(&hdr->tid, &sent_hdr->tid)) ||

this could be done with get_unaligned() (are both tids possibly
unaligned, or just one?) or even with memcmp() -- if we use memcmp() I
guess a comment explaining it's for alignment reasons would be a good
thing to have.

 > -		rmpp_mad->mad_hdr.tid = *tid;
 > +		copy_tid(&rmpp_mad->mad_hdr.tid ,tid);

And this can just be

	put_unaligned(tid, &rmpp_mad->mad_hdr.tid);

right?

Also, a couple of minor issues that would make it easier to apply the
patch:

 > Signed-off-by: Nicolas Morey-Chaisemartin
 > <nicolas.morey-chaisemartin at ext.bull.net>

email should be on the same line here.

Also checkpatch.pl warns about several things like trailing whitespace
and bogus spacing around the ',' in "copy_tid(&rmpp_mad->mad_hdr.tid ,tid);"

Even for simple patches like this I appreciated not having to fix things
like that up by hand.

 - R.



More information about the general mailing list