Re: [PATCH v3 1/2] staging: skein: Adds CryptoAPI Support

From: Dan Carpenter
Date: Fri Oct 24 2014 - 00:52:38 EST


First of all this patch does too many things at once. Collapsing files
and deleting them needs to be done in separate patches from adding them.
There is the "one thing per patch" and each one of those is a separate
thing.

On Thu, Oct 23, 2014 at 05:12:10PM -0500, Eric Rost wrote:
> +int skein256_update(struct shash_desc *desc, const u8 *data,
> + unsigned int len)
> +{
> + return skein_256_update((struct skein_256_ctx *) shash_desc_ctx(desc),
> + data, (size_t) len);
> +}

The two line version of this cast was prettier. Also if you run
checkpatch.pl --strict over this it will hopefully warn about the
space in the middle of the cast and the alignment of data. Also the
cast to size_t is superflous.

The checkpatch --strict version of this looks like:

int skein256_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{
return skein_256_update((struct skein_256_ctx *)shash_desc_ctx(desc),
data, len);
}

Eventually, I feel like we would wave skein_256_update() to just take
a shash_desc pointer? We'd have to shuffle the skein_ctx struct a bit
to make that work. (I haven't looked at this carefully).

regards,
dan carpenter

--
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/