RE: [GIT] Networking

From: David Laight
Date: Fri Sep 04 2015 - 05:07:57 EST


> I find them useful as syntactic sugar. We have not used them a lot, but there are cases in our crypto
> handling code where we have fixed size array inputs/outputs and there we opted to use them. They make
> it easy to remember what the expected sizes of input and output are without having to read through the
> implementation (of course we never even tried to use sizeof on these pointers).
>
> static int smp_ah(struct crypto_blkcipher *tfm, const u8 irk[16],
> const u8 r[3], u8 res[3])

Expect that it looks like you are passing arrays by value,
but instead you are passing by reference.

Explicitly pass by reference and sizeof works.
The object code will be the same.

David


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/