Re: [PATCH 07/19] dlm: swap bytes for rcom lock reply
From: David Teigland
Date: Tue Jan 29 2008 - 17:08:37 EST
On Sat, Jan 26, 2008 at 10:00:29PM -0800, Andrew Morton wrote:
> > On Thu, 24 Jan 2008 10:50:30 -0600 David Teigland <teigland@xxxxxxxxxx> wrote:
> > void dlm_rcom_in(struct dlm_rcom *rc)
> > {
> > struct dlm_header *hd = (struct dlm_header *) rc;
>
> aww, c'mon guys, this is nonsense.
>
> struct dlm_header *hd = &rc->rc_header;
>
> there seems to be rather a lot of this unnecessary casting going on in dlm.
> Please do a hunt-and-exterminate.
Most of the casting appears to involve either rc_buf in dlm_rcom, or
lkb_astparam in dlm_lkb. I don't see a way of changing the former, but a
union might improve the latter. I'll work on another patch for astparam,
but here's a quick one covering what's above.