Re: [RFC v1 PATCH 1/3] drivers: soc: add support for soc_device_match returning -EPROBE_DEFER

2021-04-20 Thread Dan Carpenter
true; > > return soc_dev; > > > > out3: > > @@ -246,6 +248,9 @@ const struct soc_device_attribute *soc_device_match( > > if (!matches) > > return NULL; > > > > + if (!soc_dev_attr_init_done && !early_soc_dev_attr) > > if (!soc_bus_type.p && !early_soc_dev_attr) There is one place checking this already. We could wrap it in a helper function: static bool device_init_done(void) { return soc_bus_type.p ? true : false; } regards, dan carpenter

Re: [PATCH] crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS

2021-03-22 Thread Dan Carpenter
On Sun, Mar 21, 2021 at 11:00:09PM -0700, Eric Biggers wrote: > On Mon, Mar 22, 2021 at 08:45:22AM +0300, Dan Carpenter wrote: > > On Sun, Mar 21, 2021 at 10:07:48PM -0700, Eric Biggers wrote: > > > From: Eric Biggers > > > > > > crypto_stats_get() is a no-op

Re: [PATCH] crypto: rng - fix crypto_rng_reset() refcounting when !CRYPTO_STATS

2021-03-21 Thread Dan Carpenter
; Presumably the intention was that _get() and _put() should always pair. It's really ugly and horrible that they don't. We could have predicted bug like this would happen and will continue to happen until the crypto_stats_get() is renamed. regards, dan carpenter

Re: [PATCH] crypto: qat - fix use of 'dma_map_single'

2021-03-04 Thread Dan Carpenter
9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/crypto/qat/qat_common/qat_algs.c:809 qat_alg_sgl_to_bufl() error: uninitialized symbol 'blp'. vim +/blp +809 drivers/

[PATCH] crypto: octeontx2 - fix signedness bug in cptvf_register_interrupts()

2021-01-26 Thread Dan Carpenter
The "num_vec" has to be signed for the error handling to work. Fixes: 19d8e8c7be15 ("crypto: octeontx2 - add virtual function driver support") Signed-off-by: Dan Carpenter --- drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH] crypto: keembay-ocs-hcu - Fix a WARN() message

2021-01-06 Thread Dan Carpenter
The first argument to WARN() is a condition and the messages is the second argument is the string, so this WARN() will only display the __func__ part of the message. Fixes: ae832e329a8d ("crypto: keembay-ocs-hcu - Add HMAC support") Signed-off-by: Dan Carpenter --- drivers/cryp

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Dan Carpenter
h (x) { > case 0: > ++x; > default: > ; > } Don't warn for this. If adding a break statement changes the flow of the code then warn about potentially missing break statements, but if it doesn't change anything then don't warn about it. regards, dan carpenter

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Dan Carpenter
of a warning. > > FWIW, this series has found at least one bug so far: > https://lore.kernel.org/lkml/CAFCwf11izHF=g1mGry1fE5kvFFFrxzhPSM6qKAO8gxSp=kr...@mail.gmail.com/ This is a fallthrough to a return and not to a break. That should trigger a warning. The fallthrough to a break should not generate a warning. The bug we're trying to fix is "missing break statement" but if the result of the bug is "we hit a break statement" then now we're just talking about style. GCC should limit itself to warning about potentially buggy code. regards, dan carpenter

Re: [PATCH 00/18] use semicolons rather than commas to separate statements

2020-09-29 Thread Dan Carpenter
ere commas are used deliberately to replace curly braces are just evil. Either way the code is cleaner with semi-colons. regards, dan carpenter

[PATCH] crypto: sa2ul - Fix pm_runtime_get_sync() error checking

2020-09-09 Thread Dan Carpenter
The pm_runtime_get_sync() function returns either 0 or 1 on success but this code treats a return of 1 as a failure. Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver") Signed-off-by: Dan Carpenter --- drivers/crypto/sa2ul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH] crypto/chtls: Fix double free in chtls_pass_accept_request()

2020-08-24 Thread Dan Carpenter
The chtls_recv_sock() function frees "oreq" so the free here is a double free. Fixes: 6abde0b24122 ("crypto/chtls: IPv6 support for inline TLS") Signed-off-by: Dan Carpenter --- drivers/crypto/chelsio/chtls/chtls_cm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deleti

Re: [PATCH v4 2/3] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-16 Thread Dan Carpenter
t add a "#define kzfree kfree_sensitive" so that things continue to compile and we can remove it in the next kernel release? regards, dan carpenter

Re: [PATCH v4 1/3] mm/slab: Use memzero_explicit() in kzfree()

2020-06-16 Thread Dan Carpenter
is a stable material. Is there any > known instance where the memset was optimized out from kzfree? I told him to add the stable. Otherwise it will just get reported to me again. It's a just safer to backport it before we forget. regards, dan carpenter

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-15 Thread Dan Carpenter
le kernels. > kfree(mem); > } > -EXPORT_SYMBOL(kzfree); > +EXPORT_SYMBOL(kfree_sensitive); > > /** > * ksize - get the actual amount of memory allocated for a given object regards, dan carpenter

[PATCH] crypto: marvell/octeontx - Fix a potential NULL dereference

2020-06-05 Thread Dan Carpenter
allback) 605 callback(res_code, areq, cpt_info); It does appear to me that "cpt_info" can be NULL so this could lead to a NULL dereference. Fixes: 10b4f09491bf ("crypto: marvell - add the Virtual Function driver for CPT") Signed-off-by: Dan Carpenter --- drivers/crypt

Re: [PATCH v2] crypto: hisilicon - allow smaller reads in debugfs

2020-06-05 Thread Dan Carpenter
On Fri, Jun 05, 2020 at 09:19:53AM +0800, Shukun Tan wrote: > Hi Dan, > > On 2020/6/2 21:54, Dan Carpenter wrote: > > Originally this code rejected any read less than 256 bytes. There > > is no need for this artificial limit. We should just use the normal > > helper

Re: [PATCH] crypto: DRBG - always try to free Jitter RNG instance

2020-06-03 Thread Dan Carpenter
09 1610 unlock: 1611 mutex_unlock(&drbg->drbg_mutex); 1612 return ret; 1613 1614 free_everything: 1615 mutex_unlock(&drbg->drbg_mutex); 1616 drbg_uninstantiate(drbg); Leading to an Oops. 1617 return ret; 1618 } regards, dan carpenter

[PATCH v2] crypto: hisilicon - allow smaller reads in debugfs

2020-06-02 Thread Dan Carpenter
Originally this code rejected any read less than 256 bytes. There is no need for this artificial limit. We should just use the normal helper functions to read a string from the kernel. Signed-off-by: Dan Carpenter --- v2: Use simple_read_from_buffer(). The v1 was slightly half arsed because I

[PATCH] crypto: hisilicon/qm - allow smaller reads in debugfs

2020-05-28 Thread Dan Carpenter
scnprintf() returns the number of bytes which were actually copied. It doesn't matter here because the strings are very short so they can't go over 256 bytes. Signed-off-by: Dan Carpenter --- drivers/crypto/hisilicon/qm.c | 18 -- 1 file changed, 8 insertions(+), 10 deletion

[PATCH] Crypto/chcr: drop refcount on error path in chcr_aead_op()

2020-05-12 Thread Dan Carpenter
We need to drop inflight counter before returning on this error path. Fixes: d91a3159e8d9 ("Crypto/chcr: fix gcm-aes and rfc4106-gcm failed tests") Signed-off-by: Dan Carpenter --- drivers/crypto/chelsio/chcr_algo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cryp

[PATCH] cxgb4/chcr: Fix a leak in chcr_ktls_dev_add()

2020-05-12 Thread Dan Carpenter
I renamed the labels to say what the gotos do instead of using numbered labels. Fixes: 34aba2c45024 ("cxgb4/chcr : Register to tls add and del callback") Signed-off-by: Dan Carpenter --- Applies on top of Wei Yongjun's patch. drivers/crypto/chelsio/chcr_ktls.c | 18 +++--

[bug report] crypto: dh - Add DH software implementation

2019-10-14 Thread Dan Carpenter
ng 0. 108 */ 109 if (memchr_inv(params->p, 0, params->p_size) == NULL) It would probably/hopefully lead to an Oops in memchr_inv(). 110 return -EINVAL; 111 112 /* It is permissible to not provide Q. */ 113 if (params->q_size == 0) 114 params->q = NULL; 115 116 return 0; 117 } regards, dan carpenter

Re: [PATCH] crypto: qat - Endian bug in interrupt handler

2019-06-24 Thread Dan Carpenter
Never mind. Please ignore this patch. This is Intel hardware so it's little endian. There are a bunch of other test_bit() casts which would be problematic so this wouldn't really fix anything anyway. regards, dan carpenter

[PATCH] crypto: qat - Endian bug in interrupt handler

2019-06-24 Thread Dan Carpenter
The "vf_mask" as a u32 but we were casting it to unsigned long when we do the for_each_set_bit() loop. The problem is that is an out of bounds read on big endian 64 bit systems. Fixes: ed8ccaef52fa ("crypto: qat - Add support for SRIOV") Signed-off-by: Dan Carpenter ---

[bug report] crypto: qat - Intel(R) QAT driver framework

2019-05-28 Thread Dan Carpenter
cfg_add_key_value_param' unterminated user string 'key_val->key' drivers/crypto/qat/qat_common/adf_ctl_drv.c:167 adf_add_key_value_data() warn: 'adf_cfg_add_key_value_param' unterminated user string 'key_val->val' drivers/crypto/qat/qat_common/adf_ctl_drv.c:195 adf_copy_key_value_data() warn: 'adf_cfg_section_add' unterminated user string 'section.name' regards, dan carpenter

potential underfow in crypto/lrw.c setkey() setkey

2019-05-09 Thread Dan Carpenter
mp, i); 102 ctx->mulinc[i] = tmp; 103 gf128mul_64k_bbe(&ctx->mulinc[i], ctx->table); 104 } 105 106 return 0; 107 } regards, dan carpenter

[PATCH] crypto: caam/qi - Change a couple IS_ERR_OR_NULL() checks to IS_ERR()

2019-03-28 Thread Dan Carpenter
create_caam_req_fq() doesn't return NULL pointers so there is no need to check. The NULL checks are problematic because it's hard to say how a NULL return should be handled, so removing the checks is a nice cleanup. Signed-off-by: Dan Carpenter --- drivers/crypto/caam/qi.c | 4 ++

Re: [PATCH -next] hwrng: make symbol 'optee_rng_id_table' static

2019-02-20 Thread Dan Carpenter
7;optee_rng_id_table' was not declared. Should it be static? > > > > I haven't observed this warning during my normal Linux build using > gcc. Is there any specific configuration you are using? > It's from the Sparse tool. regards, dan carpenter

[PATCH] crypto: cavium/nitrox - Use after free in process_response_list()

2019-01-03 Thread Dan Carpenter
We free "sr" and then dereference it on the next line. Fixes: c9613335bf4f ("crypto: cavium/nitrox - Added AEAD cipher support") Signed-off-by: Dan Carpenter --- drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[bug report] crypto: user - Implement a generic crypto statistics

2018-10-11 Thread Dan Carpenter
that 'rhash' doesn't leak information (struct has holes) crypto/crypto_user_stat.c:265 crypto_report_rng() warn: check that 'rrng' doesn't leak information (struct has holes) crypto/crypto_user_stat.c:295 crypto_reportstat_one() warn: check that 'rl' doesn't leak information (struct has holes) regards, dan carpenter

Re: [PATCH 1/2] Fix static checker warning

2018-09-19 Thread Dan Carpenter
Sounds reasonable. The subject needs a subsystem prefix and it might be better to make it more specific. Like so: [PATCH 1/2] crypto: ccp - potential uninitialized variable I don't know if Herbert fixes those things up himself normally? regards, dan carpenter

Re: [PATCH 3/7] vfio: add sdmdev support

2018-09-05 Thread Dan Carpenter
Hi Kenneth, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on cryptodev/master] [also build test WARNING on v4.19-rc2 next-20180905] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0d

[bug report] crypto: chtls - Inline TLS record Tx

2018-08-27 Thread Dan Carpenter
5 if (skb) { 1046 tx_skb_finalize(skb); 1047 push_frames_if_head(sk); 1048 } regards, dan carpenter

[bug report] crypto: omap-aes - Add support for GCM mode

2018-08-27 Thread Dan Carpenter
; i >= 0; i--) { ^ Otherwise the error handling needs a check as well. 1263 aalg = &dd->pdata->aead_algs_info->algs_list[i]; 1264 crypto_unregister_aead(aalg); regards, dan carpenter

[bug report] crypto: hisilicon - SEC security accelerator driver

2018-08-06 Thread Dan Carpenter
splits_out_nents, sec_req->len_out, 860 info->dev); 861 err_unmap_in_sg: 862 sec_unmap_sg_on_err(skreq->src, steps, splits_in, splits_in_nents, 863 sec_req->len_in, info->dev); 864 err_free_split_sizes: 86

[bug report] crypto: ccp - Add DOWNLOAD_FIRMWARE SEV command

2018-07-11 Thread Dan Carpenter
return 1; 400 } 401 402 psp_master->api_major = status->api_major; 403 psp_master->api_minor = status->api_minor; 404 psp_master->build = status->build; 405 406 return 0; 407 } regards, dan carpenter

[bug report] crypto: chtls - Register chtls with net tls

2018-05-25 Thread Dan Carpenter
odd numbered error code instead then we free skb which is pretty subtle so far as APIs are concerned. Looking at it now, I think we probably should be freeing skb on those paths. The current code looks leaky to me. 351 352 return 0; 353 } regards, dan carpenter

Re: [PATCH 2/5] crypto: chtls: wait for memory sendmsg, sendpage

2018-05-14 Thread Dan Carpenter
; > + current_timeo = *timeo_p; > + if (current_timeo != MAX_SCHEDULE_TIMEOUT) { > + current_timeo -= vm_wait; > + if (current_timeo < 0) > + current_timeo = 0; > + } > + vm_wait = 0; > + } > + *timeo_p = current_timeo; > + } > +out: > + remove_wait_queue(sk_sleep(sk), &wait); > + return err; > +do_error: > + err = -EPIPE; > + goto out; > +do_nonblock: > + err = -EAGAIN; > + goto out; > +do_interrupted: > + err = sock_intr_errno(*timeo_p); > + goto out; > +} > + regards, dan carpenter

Re: [PATCH] crypto: chtls - fix a missing-check bug

2018-05-07 Thread Dan Carpenter
Hi Wenwen, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on cryptodev/master] [also build test WARNING on v4.17-rc3 next-20180504] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0da

Re: [PATCH 5/7] chtls: free beyond end of array rspq_skb_cache

2018-04-25 Thread Dan Carpenter
On Thu, Apr 26, 2018 at 09:52:57AM +0300, Dan Carpenter wrote: > On Wed, Apr 25, 2018 at 08:36:22PM +0530, Atul Gupta wrote: > > Reported-by: Dan Carpenter > > Signed-off-by: Atul Gupta > > --- > > drivers/crypto/chelsio/chtls/chtls_main.c | 6 +++--- > > 1

Re: [PATCH 5/7] chtls: free beyond end of array rspq_skb_cache

2018-04-25 Thread Dan Carpenter
On Wed, Apr 25, 2018 at 08:36:22PM +0530, Atul Gupta wrote: > Reported-by: Dan Carpenter > Signed-off-by: Atul Gupta > --- > drivers/crypto/chelsio/chtls/chtls_main.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/crypto/chelsio/ch

Re: [PATCH 4/7] chtls: kbuild warnings

2018-04-25 Thread Dan Carpenter
On Wed, Apr 25, 2018 at 08:35:32PM +0530, Atul Gupta wrote: > - unindented continue > - check for null page > - signed return > > Reported-by: Dan Carpenter > Signed-off-by: Atul Gupta > --- > drivers/crypto/chelsio/chtls/chtls_io.c | 9 ++--- > 1 file changed, 6

[bug report] crypto: chtls - Program the TLS session Key

2018-04-04 Thread Dan Carpenter
w.c:274 chtls_key_info() error: '__memcpy()' 'gcm_ctx->key' too small (16 vs 32) drivers/crypto/chelsio/chtls/chtls_hw.c:277 chtls_key_info() error: '__memset()' 'gcm_ctx->key' too small (16 vs 32) regards, dan carpenter

[bug report] crypto: chtls - Inline TLS record Tx

2018-04-04 Thread Dan Carpenter
gs & ULPCB_FLAG_NO_APPEND) || Check 1157 copy <= 0) { 1158 new_buf: regards, dan carpenter

[bug report] crypto: chtls - Register chtls with net tls

2018-04-04 Thread Dan Carpenter
ul? 449 return 0; 450 } regards, dan carpenter

[bug report] crypto: chtls - Inline TLS record Rx

2018-04-04 Thread Dan Carpenter
if (copied < target) { 1425 release_sock(sk); 1426 lock_sock(sk); 1427 continue; 1428 } 1429 break; 1430 } regards, dan carpenter

[bug report] crypto: chtls - Inline TLS record Tx

2018-04-04 Thread Dan Carpenter
return -EFAULT; This has a signedness bug and the caller doesn't check for errors. 914 return (__force u16)cpu_to_be16(thdr->length); 915 } regards, dan carpenter

[bug report] crypto: chtls - Inline TLS record Tx

2018-04-04 Thread Dan Carpenter
1222 goto out; 1223 1224 out_err: 1225 if (csk_conn_inline(csk)) regards, dan carpenter

[bug report] crypto: omap-aes - Add support for GCM mode

2018-03-16 Thread Dan Carpenter
9 1260 return 0; 1261 err_aead_algs: 1262 for (i = dd->pdata->aead_algs_info->registered - 1; i >= 0; i--) { ^ Unchecked dereference. 1263 aalg = &dd->pdata->aead_algs_info->algs_list[i]; 1264 crypto_unregister_aead(aalg); regards, dan carpenter

[PATCH] crypto: chelsio - Delete stray tabs in create_authenc_wr()

2018-01-22 Thread Dan Carpenter
We removed some if statements but left these statements indented too far. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index a9c894bf9c01..34a02d690548 100644 --- a/drivers/crypto/chelsio/chcr_algo.c +++ b/drivers/crypto

[bug report] crypto: lrw - Convert to skcipher

2018-01-18 Thread Dan Carpenter
)' fs/cifs/connect.c:4238 cifs_construct_tcon() warn: should '(struct smb_vol)->password' be freed with kzfree()' security/apparmor/crypto.c:102 aa_calc_profile_hash() warn: should '(struct aa_profile)->hash' be freed with kzfree()' regards, dan carpenter

[bug report] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2018-01-16 Thread Dan Carpenter
failed to INIT error %#x\n", error); ^ Generally not set on the error paths. 780 goto err; 781 } 782 783 /* Display SEV firmware version */ regards, dan carpenter

[PATCH] staging: ccree: don't break lines unnecessarily

2018-01-11 Thread Dan Carpenter
These lines are less than 80 characters so we don't need to break them up into chunks. Signed-off-by: Dan Carpenter diff --git a/drivers/staging/ccree/cc_aead.c b/drivers/staging/ccree/cc_aead.c index 265adffdab41..b58413172231 100644 --- a/drivers/staging/ccree/cc_aead.c +++ b/drivers/st

Re: Getting the ccree driver out of staging

2018-01-11 Thread Dan Carpenter
stent indenting drivers/staging/ccree/cc_cipher.c 369 dma_sync_single_for_device(dev, ctx_p->user.key_dma_addr, 370 max_key_buf_size, DMA_TO_DEVICE); 371 ctx_p->keylen = keylen; 372 373 dev_dbg(dev, "return safely");

[PATCH] hwrng: exynos - Signedness bug in exynos_trng_do_read()

2018-01-10 Thread Dan Carpenter
"val" needs to be signed for the error handling to work. Fixes: 6cd225cc5d8a ("hwrng: exynos - add Samsung Exynos True RNG driver") Signed-off-by: Dan Carpenter diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c index 34d6f51ecbee.

Re: [PATCH 01/10] staging: ccree: remove inline qualifiers

2017-12-07 Thread Dan Carpenter
On Thu, Dec 07, 2017 at 09:00:11AM +0200, Gilad Ben-Yossef wrote: > On Mon, Dec 4, 2017 at 11:36 AM, Dan Carpenter > wrote: > > On Sun, Dec 03, 2017 at 01:58:12PM +, Gilad Ben-Yossef wrote: > >> The ccree drivers was marking a lot of big functions in C file as > >

[bug report] chcr: Add support for Inline IPSec

2017-12-04 Thread Dan Carpenter
pos = (u8 *)q->q.desc + (key_len - left); But I can't test this. 432 } 433 } 434 /* Copy CPL TX PKT XT */ 435 pos = copy_cpltx_pktxt(skb, dev, pos); regards, dan carpenter

Re: [PATCH 01/10] staging: ccree: remove inline qualifiers

2017-12-04 Thread Dan Carpenter
inline hints... It probably would make single line functions inline anyway. regards, dan carpenter

Re: [PATCH 00/10] staging: ccree: cleanups & fixes

2017-12-04 Thread Dan Carpenter
Looks good. Thanks! regards, dan carpenter

Re: [PATCH 00/24] staging: ccree: more cleanup patches

2017-11-14 Thread Dan Carpenter
On Tue, Nov 14, 2017 at 11:33:20AM +0200, Gilad Ben-Yossef wrote: > On Mon, Nov 13, 2017 at 8:33 PM, Dan Carpenter > wrote: > > These cleanups look nice. Thanks. > > > > I hope you do a mass remove of likely/unlikely in a patch soon. > > Whenever, I see one of thos

Re: [PATCH 00/24] staging: ccree: more cleanup patches

2017-11-13 Thread Dan Carpenter
These cleanups look nice. Thanks. I hope you do a mass remove of likely/unlikely in a patch soon. Whenever, I see one of those in a + line I always have to remind myself that you're planning to do it in a later patch. regards, dan carpenter

[PATCH] crypto: s5p-sss - Remove a stray tab

2017-11-09 Thread Dan Carpenter
This code seems correct, but the goto was indented too far. Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index 142c6020cec7..62830a43d959 100644 --- a/drivers/crypto/s5p-sss.c +++ b/drivers/crypto/s5p-sss.c @@ -1461,7 +1461,7 @@ static void

[PATCH] crypto: chelsio - Fix an error code in chcr_hash_dma_map()

2017-11-09 Thread Dan Carpenter
The dma_map_sg() function returns zero on error and positive values on success. We want to return -ENOMEM on failure here and zero on success. Fixes: 2f47d5804311 ("crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver") Signed-off-by: Dan Carpenter diff --git a/driv

Re: [PATCH v2 00/10] staging: ccree: fixes and cleanups

2017-11-09 Thread Dan Carpenter
Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH 6/8] staging: ccree: simplify pm manager using local var

2017-11-09 Thread Dan Carpenter
On Thu, Nov 09, 2017 at 08:27:28AM +0200, Gilad Ben-Yossef wrote: > On Tue, Nov 7, 2017 at 12:43 PM, Dan Carpenter > wrote: > > On Tue, Nov 07, 2017 at 09:40:02AM +, Gilad Ben-Yossef wrote: > >> --- a/drivers/staging/ccree/ssi_pm.c > >> +++ b/drivers/staging

[bug report] crypto: chelsio - Move DMA un/mapping to chcr from lld cxgb4 driver

2017-11-08 Thread Dan Carpenter
sgmin = min_t(unsigned int, small, CHCR_SRC_SG_SIZE); 564 walk->sgl->len0 = cpu_to_be32(sgmin); regards, dan carpenter

Re: [PATCH 7/8] staging: ccree: remove compare to none zero

2017-11-07 Thread Dan Carpenter
if (unlikely(rc != 0)) > + if (unlikely(rc)) Where-as for these ones "rc" is not a number we can use for math so the != 0 is just a double negative and slightly confusing, so removing it is the right thing. regards, dan carpenter

Re: [PATCH 6/8] staging: ccree: simplify pm manager using local var

2017-11-07 Thread Dan Carpenter
struct ssi_drvdata *drvdata = > + (struct ssi_drvdata *)dev_get_drvdata(dev); No need to cast: struct ssi_drvdata *drvdata = dev_get_drvdata(dev); regards, dan carpenter

Re: [PATCH 5/8] staging: ccree: fold common code into function

2017-11-07 Thread Dan Carpenter
areq_ctx->req_authsize), > -(size_to_skip + req->cryptlen), > - SSI_SG_FROM_BUF); > - } > + cc_copy_mac(dev, req, SSI_SG_FROM_BUF); > } regards, dan carpenter

Re: [PATCH 3/8] staging: ccree: simplify AEAD using local var

2017-11-07 Thread Dan Carpenter
areq_ctx->dst_offset + > - ctx->authsize), > +areq_ctx->dst_sgl, loc, > +(loc + ctx->authsize), > SSI_SG_FROM_BUF); > } regards, dan carpenter

Re: [PATCH 2/8] staging: ccree: use more readable func names

2017-11-07 Thread Dan Carpenter
so that's fine. But otherwise try to be strict about the one thing per patch. > + iv_size_to_authenc, is_last, > + &areq_ctx->assoc.mlli_nents); > areq_ctx->assoc_buff_type = SSI_DMA_BUF_MLLI; > } > regards, dan carpenter

Re: [PATCH 2/3] staging: ccree: handle limiting of DMA masks

2017-11-01 Thread Dan Carpenter
eir own error messages if needed and return directly. If there is no cleanup then there is no need for a goto. Anyway, that's not related to this patch. Just resend it with goto post_clk_err: in the v2. regards, dan carpenter

Re: [PATCH 2/3] staging: ccree: handle limiting of DMA masks

2017-11-01 Thread Dan Carpenter
oherent_mask(&plat_dev->dev, dma_mask); > + if (!rc) > + break; The indenting is messed up. > + } > + dma_mask >>= 1; > + } regards, dan carpenter

Re: [PATCH 1/3] staging: ccree: copy IV to DMAable memory

2017-11-01 Thread Dan Carpenter
ctx->iv, info, ivsize); We need to check if kmalloc() fails. regards, dan carpenter

Re: [PATCH] staging: ccree: Fix indentation in ssi_buffer_mgr.c

2017-10-27 Thread Dan Carpenter
size_to_skip += crypto_aead_ivsize(tfm); > + if (areq_ctx->is_gcm4543) > + size_to_skip += crypto_aead_ivsize(tfm); > > ssi_buffer_mgr_copy_scatterlist_portion( > dev, areq_ctx->backup_mac, req->src, But then ssi_buffer_mgr_copy_scatterlist_portion() is still not indented correctly. regards, dan carpenter

Re: [PATCH] Staging: ccree: Don't use volatile for monitor_lock

2017-09-12 Thread Dan Carpenter
> dma_addr_t dummy_comp_buff_dma; > struct cc_hw_desc monitor_desc; > > - volatile unsigned long monitor_lock; > + unsigned long monitor_lock; The variable seems unused. Try deleting it instead. regards, dan carpenter

Re: [PATCH 7/8] staging: ccree: replace noop macro with inline

2017-09-09 Thread Dan Carpenter
g size) {}; Could you put the {} on the next line? Also there is no need for the semi-colon after the end of a function. This is a style thing, so if you want to do it in a follow on patch that's fine regards, dan carpenter

Re: [PATCH v5] Staging: ccree: Remove unused variable.

2017-09-07 Thread Dan Carpenter
Looks good. Thanks! regards, dan carpenter

Re: [PATCH v3] Staging: ccree: ssi_cipher.c: Remove unused variable.

2017-09-06 Thread Dan Carpenter
atches, it sometimes still stresses me out. It's like you're disagreeing with the original author and the reviewers are disagreeing with you and everyone's trying to be nice about it but patches are fundamentally points of disagreement and that's stress. regards, dan carpenter

Re: [PATCH] Staging: ccree: ssi_cipher.c: Correct spelling mistake.

2017-09-06 Thread Dan Carpenter
t delete the comment. It's obvious. But really just delete the local inflight_counter variable as well because that's never used. regards, dan carpenter

Re: [PATCH 8/8] staging: ccree: remove BUG macro usage

2017-09-06 Thread Dan Carpenter
te those. I've tried to review locking bugs to see if single returns prevent future programmers from introducing new error paths which don't unlock. They don't really help... regards, dan carpenter

Re: [PATCH] staging/ccree: Declare compiled out fuctions static inline

2017-08-22 Thread Dan Carpenter
, dan carpenter

Re: [PATCH] staging/ccree: Declare compiled out fuctions static inline

2017-08-22 Thread Dan Carpenter
Google for how to send a v2 patch. https://www.google.com/search?q=how+to+send+a+v2+patch https://kernelnewbies.org/FirstKernelPatch regards, dan carpenter

[bug report] crypto: stm32 - Support for STM32 HASH module

2017-08-09 Thread Dan Carpenter
86 finish: 1087 /*Finish current request */ 1088 stm32_hash_finish_req(hdev->req, err); ^^^ Never initialized. 1089 1090 return IRQ_HANDLED; 1091 } regards, dan carpenter

Re: [PATCH 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap

2017-07-28 Thread Dan Carpenter
On Fri, Jul 28, 2017 at 09:59:41AM +0530, Suniel Mahesh wrote: > On Friday 28 July 2017 01:18 AM, Dan Carpenter wrote: > > On Thu, Jul 27, 2017 at 05:27:33PM +0300, Gilad Ben-Yossef wrote: > >> + new_drvdata->cc_base = devm_ioremap_re

Re: [PATCH 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap

2017-07-27 Thread Dan Carpenter
that it frees it so you don't have to scroll to the bottom of the function or jump to a different file. regards, dan carpenter

[bug report] crypto: chcr - Select device in Round Robin fashion

2017-07-20 Thread Dan Carpenter
ode? It feels like -EINVAL with a WARN_ON_ONCE() message would be better but I don't really understand this code. 163 u_ctx = ERR_PTR(-ENOMEM); 164 goto out; 165 } 166 u_ctx->lldi = *lld; 167 out: 168 re

[bug report] crypto: atmel-ecc - introduce Microchip / Atmel ECC driver

2017-07-20 Thread Dan Carpenter
l through */ 284 free_work_data: 285 kzfree(work_data); 286 kpp_request_complete(req, status); 287 } regards, dan carpenter

[bug report] crypto: inside-secure - add SafeXcel EIP197 crypto engine driver

2017-07-06 Thread Dan Carpenter
] != le32_to_cpu(ostate.state[i])) { 892 ctx->base.needs_inv = true; 893 break; 894 } 895 } 896 897 return 0; 898 } regards, dan carpenter

Re: [PATCH v2 1/7] staging: ccree: fix hash import/export

2017-06-22 Thread Dan Carpenter
g like: } else { memset(out, 0, HASH_LEN_SIZE); } out += HASH_LEN_SIZE; The ->import() function has a similar snippet. regards, dan carpenter

Re: [PATCH 6/7] staging: ccree: add DT bus coherency detection

2017-06-22 Thread Dan Carpenter
= areq_ctx->mac_buf; [ snip ] > @@ -533,7 +539,7 @@ int cc_clk_on(struct ssi_drvdata *drvdata) > struct clk *clk = drvdata->clk; > > if (IS_ERR(clk)) > - /* No all devices have a clock associated with CCREE */ > + /* Not all devices have a clock associated with CCREE */ This is not related. Do unrelated things in different patches. This typo was introduced in an earlier patch. There are a couple ways in git to edit previous patches. > goto out; > > rc = clk_prepare_enable(clk); regards, dan carpenter

Re: [PATCH 5/7] staging: ccree: add clock management support

2017-06-22 Thread Dan Carpenter
t cc_clk_on(struct ssi_drvdata *drvdata) { struct clk *clk = drvdata->clk; int rc; if (IS_ERR(clk)) { /* Not all devices have a clock associated with CCREE */ return 0; } rc = clk_prepare_enable(clk); if (rc) return rc; return 0; } regards, dan carpenter

Re: [PATCH 0/7] staging: ccree: bug fixes and TODO items for 4.13

2017-06-22 Thread Dan Carpenter
de4a015c7c4844ad3fcf63ad5e2c17b234 so it will conflict with > the coding style clean up patches from Jhin-Ming if you take them. > > If you wish me to merge this patch set on top those just let me know. > Yes. Those are fine and will be merged most likely. It's strictly first in, first out. regards, dan carpenter

Re: [PATCH] staging: ccree: fix coding style error

2017-06-20 Thread Dan Carpenter
On Tue, Jun 20, 2017 at 10:51:58PM +0800, Jhih-Ming Huang wrote: > > Hi, > > This patch fix all coding style error in driver/staging/ccree/ssi_aead.c. Much better. Thanks! regards, dan carpenter

Re: [PATCH 05/11] Fix ERROR: space prohibited after that open parenthesis '('

2017-06-20 Thread Dan Carpenter
d in the series so I see that you do it later, but it should be done here. regards, dan carpenter

Re: [PATCH 02/11] Fix ERROR: spaces required around that

2017-06-20 Thread Dan Carpenter
On Tue, Jun 20, 2017 at 01:20:59PM +0800, Jhih-Ming Huang wrote: > From: Jhih-Ming Hunag > > Fixed 'ERROR: spaces required around that' > You're breaking the patches up in a bad way. This one should be combined with the previous patch. regards, dan carpenter

Re: [PATCH 01/11] Fix coding style of driver/staging/ccree/ssi_aead.c ERROR: space required after that

2017-06-20 Thread Dan Carpenter
_aead.c from 54 errors to 0 error. You could put this into the cover letter. When we put this into the final git log we don't see the series only individual patches. > > The first patch fixed 'ERROR: space required after that'. > This patch fixes ... regards, dan carpenter

[PATCH] crypto: cavium/nitrox - dma_mapping_error() returns bool

2017-06-19 Thread Dan Carpenter
We want to return negative error codes here, but we're accidentally propogating the "true" return from dma_mapping_error(). Fixes: 14fa93cdcd9b ("crypto: cavium - Add support for CNN55XX adapters.") Signed-off-by: Dan Carpenter diff --git a/drivers/crypto/cavium/

[PATCH v2] X.509: Fix error code in x509_cert_parse()

2017-05-29 Thread Dan Carpenter
We forgot to set the error code on this path so it could result in returning NULL which leads to a NULL dereference. Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api") Signed-off-by: Dan Carpenter --- v2: Style change Sorry for the delay, I&

[PATCH] X.509: Fix error code in x509_cert_parse()

2017-05-23 Thread Dan Carpenter
We forgot to set the error code on this path so it could result in returning NULL which leads to a NULL dereference. Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api") Signed-off-by: Dan Carpenter diff --git a/crypto/asymmetric_keys/x509_cer

  1   2   >