lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 20 Jul 2022 11:36:22 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Gilad Ben-Yossef <gilad@...yossef.com>
Cc:     Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        Linux kernel mailing list <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
        Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH] crypto: ccree - Remove a useless dma_supported() call

Le 20/07/2022 à 11:24, Gilad Ben-Yossef a écrit :
> Hi Christophe,
> 
> Thank you for the patch!
> 
> 
> On Tue, Jul 19, 2022 at 11:27 PM Christophe JAILLET
> <christophe.jaillet@...adoo.fr> wrote:
>>
>> There is no point in calling dma_supported() before calling
>> dma_set_coherent_mask(). This function already calls dma_supported() and
>> returns an error (-EIO) if it fails.
>>
>> So remove the superfluous dma_supported() call.
>>
>> While at it, fix the name of the function reported in a dev_err().
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> 
> Acked-by: Gilad Ben-Yossef <gilad@...yossef.com>
> 
>> ---
>> I guess that the whole while loop could be removed, but I don't remind the
>> thread with the corresponding explanation, so leave it as-is :(
> 
> I would be happy to ack a patch that does this if you care to write it...

I will send a v2.

Don't bother with this patch.

CJ

> 
> Gilad
> 
>> ---
>>   drivers/crypto/ccree/cc_driver.c | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/cc_driver.c
>> index 7d1bee86d581..99f8bda718fe 100644
>> --- a/drivers/crypto/ccree/cc_driver.c
>> +++ b/drivers/crypto/ccree/cc_driver.c
>> @@ -373,16 +373,16 @@ static int init_cc_resources(struct platform_device *plat_dev)
>>
>>          dma_mask = DMA_BIT_MASK(DMA_BIT_MASK_LEN);
>>          while (dma_mask > 0x7fffffffUL) {
>> -               if (dma_supported(dev, dma_mask)) {
>> -                       rc = dma_set_coherent_mask(dev, dma_mask);
>> -                       if (!rc)
>> -                               break;
>> -               }
>> +               rc = dma_set_coherent_mask(dev, dma_mask);
>> +               if (!rc)
>> +                       break;
>> +
>>                  dma_mask >>= 1;
>>          }
>>
>>          if (rc) {
>> -               dev_err(dev, "Failed in dma_set_mask, mask=%llx\n", dma_mask);
>> +               dev_err(dev, "Failed in dma_set_coherent_mask, mask=%llx\n",
>> +                       dma_mask);
>>                  return rc;
>>          }
>>
>> --
>> 2.34.1
>>
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ