All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Vladimir Zapolskiy <vz@mleia.com>
Cc: LABBE Corentin <clabbe.montjoie@gmail.com>,
	robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	maxime.ripard@free-electrons.com, linux@arm.linux.org.uk,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	grant.likely@linaro.org, akpm@linux-foundation.org,
	gregkh@linuxfoundation.org, mchehab@osg.samsung.com,
	crope@iki.fi, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com,
	linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 4/4] crypto: Add Allwinner Security System crypto accelerator
Date: Mon, 20 Oct 2014 16:52:53 -0700	[thread overview]
Message-ID: <1413849173.5407.6.camel@perches.com> (raw)
In-Reply-To: <54459AA5.2030705@mleia.com>

On Tue, 2014-10-21 at 02:28 +0300, Vladimir Zapolskiy wrote:
> On 19.10.2014 17:16, LABBE Corentin wrote:
> > Add support for the Security System included in Allwinner SoC A20.
> > The Security System is a hardware cryptographic accelerator that support AES/MD5/SHA1/DES/3DES/PRNG algorithms.
[]
> > diff --git a/drivers/crypto/sunxi-ss/sunxi-ss-core.c b/drivers/crypto/sunxi-ss/sunxi-ss-core.c
[]
> > +	cr = clk_get_rate(ss->busclk);
> > +	if (cr >= cr_ahb)
> > +		dev_dbg(&pdev->dev, "Clock bus %lu (%lu MHz) (must be >= %lu)\n",
> > +				cr, cr / 1000000, cr_ahb);
> > +	else
> > +		dev_warn(&pdev->dev, "Clock bus %lu (%lu MHz) (must be >= %lu)\n",
> > +				cr, cr / 1000000, cr_ahb);
> 
> See next comment.
> 
> > +	cr = clk_get_rate(ss->ssclk);
> > +	if (cr <= cr_mod)
> > +		if (cr < cr_mod)
> > +			dev_info(&pdev->dev, "Clock ss %lu (%lu MHz) (must be <= %lu)\n",
> > +					cr, cr / 1000000, cr_mod);
> > +		else
> > +			dev_dbg(&pdev->dev, "Clock ss %lu (%lu MHz) (must be <= %lu)\n",
> > +					cr, cr / 1000000, cr_mod);
> > +	else
> > +		dev_warn(&pdev->dev, "Clock ss is at %lu (%lu MHz) (must be <= %lu)\n",
> > +				cr, cr / 1000000, cr_mod);
> 
> The management of kernel log levels looks pretty strange. As far as I
> understand there is no error on any clock rate, I'd recommend to keep
> only one information message.

And if not, please add some braces.

> hash_init: initialize request context */
> > +int sunxi_hash_init(struct ahash_request *areq)
> > +{
> > +	const char *hash_type;
> > +	struct sunxi_req_ctx *op = ahash_request_ctx(areq);
> > +
> > +	memset(op, 0, sizeof(struct sunxi_req_ctx));
> > +
> > +	hash_type = crypto_tfm_alg_name(areq->base.tfm);
> > +
> > +	if (strcmp(hash_type, "sha1") == 0)
> > +		op->mode = SS_OP_SHA1;
> > +	if (strcmp(hash_type, "md5") == 0)
> > +		op->mode = SS_OP_MD5;

else if ?

> > +	if (op->mode == 0)
> > +		return -EINVAL;

maybe this?

	if (!strcmp(hash_type, "sha1"))
		op->mode = SS_OP_SHA1;
	else if (!strcmp(hash_type, "md5"))
		op->mode = SH_OP_MD5;
	else
		return -EINVAL;

> > +
> > +	return 0;
> > +}
[]
> > +int sunxi_hash_update(struct ahash_request *areq)
> > +{
[]
> > +	dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x bw=%u ww=%u",
> > +			__func__, crypto_tfm_alg_name(areq->base.tfm),
> > +			op->byte_count, areq->nbytes, op->mode,
> > +			op->nbw, op->nwait);

dev_dbg statements generally don't need __func__ as
dynamic_debug can add it.

If you want to keep it, the most common output form for
__func__ is '"%s: ...", __func__'

WARNING: multiple messages have this Message-ID (diff)
From: joe@perches.com (Joe Perches)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 4/4] crypto: Add Allwinner Security System crypto accelerator
Date: Mon, 20 Oct 2014 16:52:53 -0700	[thread overview]
Message-ID: <1413849173.5407.6.camel@perches.com> (raw)
In-Reply-To: <54459AA5.2030705@mleia.com>

On Tue, 2014-10-21 at 02:28 +0300, Vladimir Zapolskiy wrote:
> On 19.10.2014 17:16, LABBE Corentin wrote:
> > Add support for the Security System included in Allwinner SoC A20.
> > The Security System is a hardware cryptographic accelerator that support AES/MD5/SHA1/DES/3DES/PRNG algorithms.
[]
> > diff --git a/drivers/crypto/sunxi-ss/sunxi-ss-core.c b/drivers/crypto/sunxi-ss/sunxi-ss-core.c
[]
> > +	cr = clk_get_rate(ss->busclk);
> > +	if (cr >= cr_ahb)
> > +		dev_dbg(&pdev->dev, "Clock bus %lu (%lu MHz) (must be >= %lu)\n",
> > +				cr, cr / 1000000, cr_ahb);
> > +	else
> > +		dev_warn(&pdev->dev, "Clock bus %lu (%lu MHz) (must be >= %lu)\n",
> > +				cr, cr / 1000000, cr_ahb);
> 
> See next comment.
> 
> > +	cr = clk_get_rate(ss->ssclk);
> > +	if (cr <= cr_mod)
> > +		if (cr < cr_mod)
> > +			dev_info(&pdev->dev, "Clock ss %lu (%lu MHz) (must be <= %lu)\n",
> > +					cr, cr / 1000000, cr_mod);
> > +		else
> > +			dev_dbg(&pdev->dev, "Clock ss %lu (%lu MHz) (must be <= %lu)\n",
> > +					cr, cr / 1000000, cr_mod);
> > +	else
> > +		dev_warn(&pdev->dev, "Clock ss is at %lu (%lu MHz) (must be <= %lu)\n",
> > +				cr, cr / 1000000, cr_mod);
> 
> The management of kernel log levels looks pretty strange. As far as I
> understand there is no error on any clock rate, I'd recommend to keep
> only one information message.

And if not, please add some braces.

> hash_init: initialize request context */
> > +int sunxi_hash_init(struct ahash_request *areq)
> > +{
> > +	const char *hash_type;
> > +	struct sunxi_req_ctx *op = ahash_request_ctx(areq);
> > +
> > +	memset(op, 0, sizeof(struct sunxi_req_ctx));
> > +
> > +	hash_type = crypto_tfm_alg_name(areq->base.tfm);
> > +
> > +	if (strcmp(hash_type, "sha1") == 0)
> > +		op->mode = SS_OP_SHA1;
> > +	if (strcmp(hash_type, "md5") == 0)
> > +		op->mode = SS_OP_MD5;

else if ?

> > +	if (op->mode == 0)
> > +		return -EINVAL;

maybe this?

	if (!strcmp(hash_type, "sha1"))
		op->mode = SS_OP_SHA1;
	else if (!strcmp(hash_type, "md5"))
		op->mode = SH_OP_MD5;
	else
		return -EINVAL;

> > +
> > +	return 0;
> > +}
[]
> > +int sunxi_hash_update(struct ahash_request *areq)
> > +{
[]
> > +	dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x bw=%u ww=%u",
> > +			__func__, crypto_tfm_alg_name(areq->base.tfm),
> > +			op->byte_count, areq->nbytes, op->mode,
> > +			op->nbw, op->nwait);

dev_dbg statements generally don't need __func__ as
dynamic_debug can add it.

If you want to keep it, the most common output form for
__func__ is '"%s: ...", __func__'

  reply	other threads:[~2014-10-20 23:52 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-19 14:16 [PATCH v5] crypto: Add Allwinner Security System crypto accelerator LABBE Corentin
2014-10-19 14:16 ` LABBE Corentin
2014-10-19 14:16 ` LABBE Corentin
     [not found] ` <1413728182-13569-1-git-send-email-clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-19 14:16   ` [PATCH v5 1/4] ARM: sun7i: dt: Add Security System to A20 SoC DTS LABBE Corentin
2014-10-19 14:16     ` LABBE Corentin
2014-10-19 14:16     ` LABBE Corentin
2014-10-19 14:16   ` [PATCH v5 2/4] ARM: sunxi: dt: Add DT bindings documentation for SUNXI Security System LABBE Corentin
2014-10-19 14:16     ` LABBE Corentin
2014-10-19 14:16     ` LABBE Corentin
     [not found]     ` <1413728182-13569-3-git-send-email-clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-20 12:02       ` Koen Kooi
2014-10-20 12:02         ` [linux-sunxi] " Koen Kooi
2014-10-20 12:02         ` Koen Kooi
2014-10-19 14:16   ` [PATCH v5 3/4] MAINTAINERS: Add myself as maintainer of Allwinner " LABBE Corentin
2014-10-19 14:16     ` LABBE Corentin
2014-10-19 14:16     ` LABBE Corentin
2014-10-19 14:16   ` [PATCH v5 4/4] crypto: Add Allwinner Security System crypto accelerator LABBE Corentin
2014-10-19 14:16     ` LABBE Corentin
2014-10-19 14:16     ` LABBE Corentin
2014-10-20 23:28     ` Vladimir Zapolskiy
2014-10-20 23:28       ` Vladimir Zapolskiy
2014-10-20 23:52       ` Joe Perches [this message]
2014-10-20 23:52         ` Joe Perches
     [not found]         ` <1413849173.5407.6.camel-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2014-10-21 16:39           ` Corentin LABBE
2014-10-21 16:39             ` Corentin LABBE
2014-10-21 16:39             ` Corentin LABBE
     [not found]       ` <54459AA5.2030705-ChpfBGZJDbMAvxtiuMwx3w@public.gmane.org>
2014-10-21 16:25         ` Corentin LABBE
2014-10-21 16:25           ` Corentin LABBE
2014-10-21 16:25           ` Corentin LABBE
     [not found]           ` <54468902.1040802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-21 17:27             ` Vladimir Zapolskiy
2014-10-21 17:27               ` Vladimir Zapolskiy
2014-10-21 17:27               ` Vladimir Zapolskiy
2014-10-22  9:00     ` Arnd Bergmann
2014-10-22  9:00     ` Arnd Bergmann
2014-10-22  9:00       ` Arnd Bergmann
2014-10-24 18:50       ` Corentin LABBE
2014-10-24 18:50         ` [linux-sunxi] " Corentin LABBE
2014-10-24 18:50         ` Corentin LABBE
2014-10-22  9:00     ` Arnd Bergmann
     [not found]     ` <1413728182-13569-5-git-send-email-clabbe.montjoie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-21 19:11       ` Maxime Ripard
2014-10-21 19:11         ` Maxime Ripard
2014-10-21 19:11         ` Maxime Ripard
2014-10-24 18:52         ` Corentin LABBE
2014-10-24 18:52           ` Corentin LABBE
2014-10-24 18:52           ` Corentin LABBE
     [not found]           ` <544A9FEA.6020304-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-30 17:19             ` Maxime Ripard
2014-10-30 17:19               ` Maxime Ripard
2014-10-30 17:19               ` Maxime Ripard
2014-10-31  7:20               ` Herbert Xu
2014-10-31  7:20                 ` Herbert Xu
2014-10-31  7:20                 ` Herbert Xu
     [not found]                 ` <20141031072030.GA7563-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2014-10-31  8:13                   ` Maxime Ripard
2014-10-31  8:13                     ` Maxime Ripard
2014-10-31  8:13                     ` Maxime Ripard
2014-10-31  8:18                     ` Herbert Xu
2014-10-31  8:18                       ` Herbert Xu
2014-10-31  8:18                       ` Herbert Xu
     [not found]                       ` <20141031081803.GA8012-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2014-10-31  9:57                         ` Maxime Ripard
2014-10-31  9:57                           ` Maxime Ripard
2014-10-31  9:57                           ` Maxime Ripard
2014-10-31 10:05                           ` Herbert Xu
2014-10-31 10:05                             ` Herbert Xu
     [not found]                             ` <20141031100522.GA8655-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2014-11-03  9:34                               ` Maxime Ripard
2014-11-03  9:34                                 ` Maxime Ripard
2014-11-03  9:34                                 ` Maxime Ripard
2014-11-03 10:35                                 ` Herbert Xu
2014-11-03 10:35                                   ` Herbert Xu
     [not found]                                   ` <20141103103528.GA30154-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2014-11-06 14:26                                     ` Maxime Ripard
2014-11-06 14:26                                       ` Maxime Ripard
2014-11-06 14:26                                       ` Maxime Ripard
2014-11-06 14:32                                       ` Herbert Xu
2014-11-06 14:32                                         ` Herbert Xu
     [not found]                                         ` <20141106143217.GA3636-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
2014-11-16 17:13                                           ` Maxime Ripard
2014-11-16 17:13                                             ` Maxime Ripard
2014-11-16 17:13                                             ` Maxime Ripard
2014-10-22  9:00       ` Arnd Bergmann
2014-10-22  9:00     ` Arnd Bergmann
2014-11-06 14:13     ` Herbert Xu
2014-11-06 14:13       ` Herbert Xu

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=1413849173.5407.6.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=clabbe.montjoie@gmail.com \
    --cc=crope@iki.fi \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=mchehab@osg.samsung.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=vz@mleia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.