Re: crypto-drbg: Deletion of unnecessary checks before the function call kzfree

2014-11-20 Thread SF Markus Elfring
Sorry but you're too late as someone else has already fixed this :) Thanks for your feedback. https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/crypto/drbg.c?id=46f64f6ef978dc1f36ebaa50ed79c7c8386711ee Regards, Markus -- To unsubscribe from this list: send the line

[PATCH] crypto-jitterentropy: Delete unnecessary checks before the function call kzfree

2015-06-23 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 23 Jun 2015 22:30:21 +0200 The kzfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by:

[PATCH] crypto-qat: Deletion of unnecessary checks before two function calls

2015-06-26 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Fri, 26 Jun 2015 20:30:11 +0200 The functions kfree() and release_firmware() test whether their argument is NULL and then return immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle

[PATCH 2/4] crypto-ixp4xx: Two function calls less in init_ixp_crypto() after error detection

2015-11-15 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 15 Nov 2015 18:28:39 +0100 The dma_pool_destroy() function was called twice with a null pointer if a "npe_error" was reported. This implementation detail could be improved by the introduction of another jump label. Signed-off-by:

[PATCH 0/4] crypto-ixp4xx: Deletion of a few unnecessary checks

2015-11-15 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 15 Nov 2015 19:39:00 +0100 Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (4): Delete unnecessary checks before the function call "dma_pool_destroy"

[PATCH 1/4] crypto-ixp4xx: Delete unnecessary checks before the function call "dma_pool_destroy"

2015-11-15 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 15 Nov 2015 16:51:21 +0100 The dma_pool_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software.

[PATCH 3/4] crypto-ixp4xx: Reduce assignment for a variable in init_ixp_crypto()

2015-11-15 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 15 Nov 2015 19:06:44 +0100 The variable "ret" was set more often than necessary by the init_ixp_crypto() function. * Omit its initialisation at the beginning. * Use an error return code in two cases directly. * Improve compliance

[PATCH 4/4] crypto-ixp4xx: Less function calls in init_ixp_crypto() after error detection

2015-11-15 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 15 Nov 2015 19:23:55 +0100 The dma_pool_destroy() function was called in up to two cases by the init_ixp_crypto() function during error handling even if a call of the dma_pool_create() function failed. This implementation detail

[PATCH v2 1/3] crypto-ixp4xx: Delete unnecessary checks before the function call "dma_pool_destroy"

2015-11-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 15 Nov 2015 16:51:21 +0100 The dma_pool_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software.

[PATCH v2 2/3] crypto-ixp4xx: Reduce assignment for a variable in init_ixp_crypto()

2015-11-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Nov 2015 15:45:32 +0100 The variable "ret" was set more often than necessary by the init_ixp_crypto() function. * Omit its initialisation at the beginning. * Use an error return code in two cases directly. * Improve compliance

[PATCH v2 3/3] crypto-ixp4xx: Less function calls in init_ixp_crypto() after error detection

2015-11-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Nov 2015 16:15:21 +0100 The dma_pool_destroy() function was called in up to two cases by the init_ixp_crypto() function during error handling even if a call of the dma_pool_create() function failed. This implementation detail

[PATCH v2 0/3] crypto-ixp4xx: Deletion of a few unnecessary checks

2015-11-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Nov 2015 16:26:01 +0100 Subject: [PATCH 0/3] crypto-ixp4xx: Deletion of a few unnecessary checks Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (3):

[PATCH] hwrng-PIC32: Delete unnecessary assignment for the field "owner"

2016-08-16 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 16 Aug 2016 07:51:21 +0200 The field "owner" is set by the core. Thus delete an unneeded initialisation. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Markus Elfring

[PATCH 2/6] crypto-caamhash: Rename jump labels in ahash_setkey()

2016-09-15 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 15 Sep 2016 13:54:49 +0200 Adjust jump labels according to the current Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/crypto/caam/caamhash.c | 11 +-- 1 file

[PATCH 3/6] crypto-caamhash: Rename a jump label in five functions

2016-09-15 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 15 Sep 2016 14:43:38 +0200 Adjust jump labels according to the current Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/crypto/caam/caamhash.c | 49

[PATCH 5/6] crypto-caamhash: Delete an unnecessary initialisation in seven functions

2016-09-15 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 15 Sep 2016 15:24:02 +0200 The local variable "ret" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 4/6] crypto-caamhash: Return a value directly in caam_hash_cra_init()

2016-09-15 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 15 Sep 2016 14:56:12 +0200 * Return a value at the end without storing it in an intermediate variable. * Delete the local variable "ret" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring

[PATCH 1/2] n2rng: Use devm_kcalloc() in n2rng_probe()

2017-04-19 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 19 Apr 2017 10:30:47 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". * Replace the

[PATCH 0/2] n2rng: Fine-tuning for n2rng_probe()

2017-04-19 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 19 Apr 2017 11:00:11 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use devm_kcalloc() Combine substrings for two messages drivers/char/hw_random/n2-drv.c | 12

[PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe()

2017-04-19 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 19 Apr 2017 10:50:04 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: quoted string split across lines Thus fix the affected source code places. Signed-off-by: Markus Elfring

[PATCH] crypto-testmgr: Delete an error message for a failed memory allocation in two functions

2017-05-11 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 11 May 2017 17:05:17 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Link:

[PATCH] crypto/s5p-sss: Use common error handling code in s5p_aes_probe()

2017-10-22 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 22 Oct 2017 15:00:27 +0200 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH 0/3] crypto-ansi_cprng: Fine-tuning for three function implementations

2017-10-21 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 21 Oct 2017 19:06:54 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (3): Use common error handling code in get_prng_bytes() Delete two variable assignments in

[PATCH 1/2] crypto-testmgr: Use common error handling code in drbg_cavs_test()

2017-10-21 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 21 Oct 2017 19:29:11 +0200 Adjust jump targets so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

Re: crypto-testmgr: Use common error handling code in drbg_cavs_test()

2017-10-21 Thread SF Markus Elfring
> Though, jumping back and forth like this with goto directives is something > that looks a bit strange. At least to my taste, may I suggest to have gotos > pointing only downwards and not up again? (Note, the same applies to the > ansi_cprng patch set). > > What about something like

[PATCH 1/3] crypto-ansi_cprng: Use common error handling code in get_prng_bytes()

2017-10-21 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 21 Oct 2017 15:17:52 +0200 Adjust jump targets so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH 2/3] crypto-ansi_cprng: Delete two variable assignments in get_prng_bytes()

2017-10-21 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 21 Oct 2017 16:10:43 +0200 Adjust a jump target so that two error code assignments which are redundant before condition checks can be removed because the same value will be set as an exception handling at the end of this function.

[PATCH 3/3] crypto-ansi_cprng: Delete unnecessary blank lines

2017-10-21 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 21 Oct 2017 16:27:56 +0200 The script "checkpatch.pl" pointed information out like the following. CHECK: Please don't use multiple blank lines Thus fix the affected source code places. Signed-off-by: Markus Elfring

[PATCH 2/2] crypto-testmgr: Delete an unnecessary variable initialisation in drbg_cavs_test()

2017-10-21 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 21 Oct 2017 19:33:45 +0200 The variable "ret" will eventually be set to an error code a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 0/2] crypto-testmgr: Fine-tuning for drbg_cavs_test()

2017-10-21 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 21 Oct 2017 19:47:43 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use common error handling code Delete an unnecessary variable initialisation crypto/testmgr.c | 33

[PATCH] crypto-ccp: Use common error handling code in sp_get_irqs()

2017-10-22 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 22 Oct 2017 14:10:33 +0200 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

Re: [PATCH] crypto/s5p-sss: Use common error handling code in s5p_aes_probe()

2017-10-22 Thread SF Markus Elfring
>> From: Markus Elfring >> Date: Sun, 22 Oct 2017 15:00:27 +0200 >> >> Add a jump target so that a bit of exception handling can be better reused >> at the end of this function. >> >> This issue was detected by using the Coccinelle software. >> >> Signed-off-by:

[PATCH 4/4] crypto: ux500: Delete two unnecessary variable initialisations in ux500_cryp_probe()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 10:56:38 +0100 Two local variables will eventually be set to appropriate pointers a bit later. Thus omit their explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 2/2] crypto: sahara: Improve a size determination in sahara_probe()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 14:14:05 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style

[PATCH 0/4] Ux500 crypto: Adjustments for ux500_cryp_probe()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 11:12:34 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (4): Delete an error message for a failed memory allocation Adjust two condition checks Adjust an

[PATCH 1/4] crypto: ux500: Delete an error message for a failed memory allocation in ux500_cryp_probe()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 10:12:38 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 2/4] crypto: ux500: Adjust two condition checks in ux500_cryp_probe()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 10:38:44 +0100 The local variable "cryp_error" was used only for two condition checks. * Check the return values from these function calls directly instead. * Delete this variable which became unnecessary with this

[PATCH 3/4] crypto: ux500: Adjust an error message in ux500_cryp_probe()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 10:47:31 +0100 Replace the function name in this error message so that the same name is mentioned according to what was called before. Signed-off-by: Markus Elfring ---

[PATCH 2/2] crypto: omap: Improve a size determination in three functions

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 16:12:05 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style

[PATCH] crypto: nx-842: Delete an error message for a failed memory allocation in nx842_pseries_init()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 17:05:13 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 0/2] crypto/omap: Adjustments for three function implementations

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 16:18:19 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete error messages for a failed memory allocation Improve size determinations

[PATCH 0/2] crypto/sahara: Adjustments for sahara_probe()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 14:30:28 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation Improve a size determination

[PATCH] crypto: bfin_crc: Delete an error message for a failed memory allocation in bfin_crypto_crc_probe()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 21:34:54 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 1/2] crypto: caam: Delete an error message for a failed memory allocation in seven functions

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 18:22:38 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 0/2] crypto/caam: Adjustments for eight function implementations

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 19:23:45 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation in seven functions Use common error handling

[PATCH 2/2] crypto: caam: Use common error handling code in four functions

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 19:14:49 +0100 Add jump targets so that a bit of exception handling can be better reused at the end of these functions. Signed-off-by: Markus Elfring --- drivers/crypto/caam/caamalg.c |

[PATCH 1/2] crypto: bcm: Delete an error message for a failed memory allocation in do_shash()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 22:05:11 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 2/2] crypto: bcm: One function call less in do_shash() after error detection

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 22:22:20 +0100 The kfree() function was called in one case by the do_shash() function during error handling even if the passed variable contained a null pointer. * Reorder two function calls at the end. * Add a jump

[PATCH 0/2] crypto/bcm: Adjustments for do_shash()

2018-02-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Feb 2018 22:30:07 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation One function call less after error detection

[PATCH] crypto: atmel: Delete error messages for a failed memory allocation in six functions

2018-02-15 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 15 Feb 2018 11:38:30 +0100 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

Re: [2/2] crypto: bcm: One function call less in do_shash() after error detection

2018-02-23 Thread SF Markus Elfring
> This patch is pointless as kfree on NULL is a no-op. I prefer to avoid unnecessary function calls generally. Regards, Markus

Re: [PATCH 2/2] crypto: omap: Improve a size determination in three functions

2018-02-22 Thread SF Markus Elfring
>> @@ -1032,14 +1032,13 @@ static int omap_aes_get_res_pdev(struct omap_aes_dev >> *dd, >> static int omap_aes_probe(struct platform_device *pdev) >> { >> struct device *dev = >dev; >> -struct omap_aes_dev *dd; >> struct crypto_alg *algp; >> struct aead_alg *aalg; >>

[PATCH 1/2] crypto: talitos: Use common error handling code in talitos_edesc_alloc()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 14:08:55 +0100 Add jump targets so that an error message and the setting of a specific error code is stored only once at the end of this function. Signed-off-by: Markus Elfring ---

[PATCH 2/2] crypto: talitos: Delete an error message for a failed memory allocation in talitos_edesc_alloc()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 14:18:23 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH] crypto: ccp: Use memdup_user() rather than duplicating its implementation

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 5 Mar 2018 13:50:13 +0100 Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring