public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: greg@kroah.com, linux-kernel@vger.kernel.org,
	Mark Allyn <mark.a.allyn@intel.com>
Subject: Re: [PATCH] sep: SEP update
Date: Wed, 28 Dec 2011 14:14:38 -0800	[thread overview]
Message-ID: <1325110478.16729.7.camel@joe2Laptop> (raw)
In-Reply-To: <20111228173748.3323.89307.stgit@bob.linux.org.uk>

On Wed, 2011-12-28 at 17:37 +0000, Alan Cox wrote:
> From: Mark Allyn <mark.a.allyn@intel.com>
> The new driver supports the kernel crypto layer, passes the coding style checks,
> passes human taste checks and has proper kernel-doc formatted comments.

These are just taste comments.

> diff --git a/drivers/staging/sep/sep_crypto.c b/drivers/staging/sep/sep_crypto.c
[]
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

> +/* #define DEBUG */
> +#include <linux/init.h>
[]
> +	sep_work->callback = funct;
> +	sep_work->data = data;
> +	INIT_WORK(&sep_work->work, sep_do_callback);
> +	result = queue_work(work_queue, &sep_work->work);
> +	if (!result) {
> +		pr_debug("sep_crypto: queue_work failed\n");

So these pr_debug and any other pr_<level> become:
		pr_debug("queue_work failed\n");

> +/* Debug - prints only if DEBUG is defined; follows kernel debug model */
> +static void sep_dump(struct sep_device *sep, char *stg, void *start, int len)
> +{
> +#if 0
> +	int ct1;
> +	u8 *ptt;
> +
> +	dev_dbg(&sep->pdev->dev,
> +		"Dump of %s starting at %08lx for %08x bytes\n",
> +		stg, (unsigned long)start, len);
> +	for (ct1 = 0; ct1 < len; ct1 += 1) {
> +		ptt = (u8 *)(start + ct1);
> +		dev_dbg(&sep->pdev->dev, "%02x ", *ptt);
> +		if (ct1 % 16 == 15)
> +			dev_dbg(&sep->pdev->dev, "\n");
> +	}

While this is #if 0, more likely it should
use print_hex_dump_bytes

> +/**
> + * RFC2451: Weak key check
> + * Returns: 1 (weak), 0 (not weak)
> + */
> +static int sep_weak_key(const u8 *key, unsigned int keylen)
> +{
> +	static const u8 parity[] = {
> +	8, 1, 0, 8, 0, 8, 8, 0, 0, 8, 8, 0, 8, 0, 2, 8,
> +	0, 8, 8, 0, 8, 0, 0, 8, 8,
> +	0, 0, 8, 0, 8, 8, 3,

Any reason this is formatted with line lengths of 16, 9, 7
instea of all 16?

> +	0, 8, 8, 0, 8, 0, 0, 8, 8, 0, 0, 8, 0, 8, 8, 0,
> +	8, 0, 0, 8, 0, 8, 8, 0, 0,
> +	8, 8, 0, 8, 0, 0, 8,

> +	if (!((n - (w >> 3)) & w)) {
> +		if (n < 0x41415151) {

Perhaps use a switch/case instead of an 
difficult to read binary chop?


> +			/* Portion of msg is nulled (no data) */
> +			msg[0] = (u32)0;

The casts of zero are odd.


  reply	other threads:[~2011-12-28 22:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-28 17:37 [PATCH] sep: SEP update Alan Cox
2011-12-28 22:14 ` Joe Perches [this message]
2011-12-29 12:25   ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1325110478.16729.7.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.a.allyn@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox