Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2909478iog; Mon, 27 Jun 2022 05:34:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tc874jJj3FspeOmkuoZauz/2AEnCoPPNpfXBp8Xm+9VcB3ONqg5+xrRN2you9TkITZ15DK X-Received: by 2002:a17:902:e5d0:b0:16a:6f96:ec3 with SMTP id u16-20020a170902e5d000b0016a6f960ec3mr14727433plf.110.1656333250289; Mon, 27 Jun 2022 05:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333250; cv=none; d=google.com; s=arc-20160816; b=vTMPQTJz9e8FoUfy/87srcceSyL50Fd1UXJeXiL7wwI+Aez719irx2FkTXYtPweMqw aEDNncmTCH9lXjq5xVdQS7p74LWFs9DTyKTX77d5T/r/cAl+mYjbwZCE8fgHgzOBChsO lXz/Nb3kt2yT8JRfnv2++IpJ2nGlc6sS7krtUs/qoOtlgo3VYmm7TT7p0qBFGbyvST/A dslkDfdZEQFt11ICpx+bSZgIwXa1VRfKX/CA4EoCNynpvfHWkdrUzVySL8kTyk0Y/BRF jCzRJgNW7hh0JXFjRHYZ/4653cTaitR21Ewh6pemZmEidiDYfSJYmouMmQr1V1ae7LO3 KynQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5Xl9vF88I0l1x6iRqZKVwdiDRgTIUrmB9c17Iw2oT98=; b=m8L++83trBGmUuhxITl5uzUHWhRKyHurSihveqllogrDFjfN8+oXMnRaxOkQqFF/dI u8rGjtlvvInqoUSGEHLuN1myTK97EX+uyH66URHo0KMi/qXYqFhHM1bcdHQiwgv9Rwaq kdIFOzmdKeZLkUjYZp/pf0zcZLeuaH2jgaW4XL15s3qGCV1Tnm4vGkgO3sYTAvr0gecY shjx4bATFjHtjTT7KkqcJvRcLUCCqUrfYH48NAKi/t9xF4/2QKtpQ/I7DIvf8D4kl1eq bRaMRvyrACuPrRguzF27AzHGAEqIbycX4RS/20/+XWQeg7VZXYH0NcGjt+v7f8dGeUQ+ ESrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Re70g5A8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a170902b40a00b00158e93cfafesi13568205plr.132.2022.06.27.05.33.58; Mon, 27 Jun 2022 05:34:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Re70g5A8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234331AbiF0K43 (ORCPT + 99 others); Mon, 27 Jun 2022 06:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233852AbiF0K41 (ORCPT ); Mon, 27 Jun 2022 06:56:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2D83646E for ; Mon, 27 Jun 2022 03:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656327385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5Xl9vF88I0l1x6iRqZKVwdiDRgTIUrmB9c17Iw2oT98=; b=Re70g5A8hsOsMyB1a+dMTZpOlf1LTxPoNPC7ThYiiHNJfGb8FMCrxvpNDzLde+/ghiP0MA oIsjfNu13JW2SwdOp4sVezqBCpcQfn8fbIrwL/YPkW1dwcE+zB32FYTdtkcmeRLfWZb2Hr LIVdV8hCHULRCj7+y5K2CglVQ5d7EwM= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-204-OwrQutDhOdyI0KujDsCHpQ-1; Mon, 27 Jun 2022 06:56:24 -0400 X-MC-Unique: OwrQutDhOdyI0KujDsCHpQ-1 Received: by mail-ed1-f69.google.com with SMTP id x21-20020a05640226d500b00435bd7f9367so6893672edd.8 for ; Mon, 27 Jun 2022 03:56:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5Xl9vF88I0l1x6iRqZKVwdiDRgTIUrmB9c17Iw2oT98=; b=WiZu8tVtbyWZkYkTyDZCewyK2lwgzlBsnUtKt4qtHJKULmy5ZTU44/bIMzlVuEXca8 swPdXLCLfzpOtCRiUxTJnastnwjE1sCpQpadwFkMgaolmRIfXpIZuXEfzxVWr4OtMDP2 vDe8bsg5DRkYkz8BTDn4YKYxFrB0v/ETqeZMwAB/lixaS2ClXO9SxNIqAr6B43YwYTCL lzHBjw+kWtDipiVx3BEQc5dsM78L9Xy1wQw8XECl2ecS0ycOBVFu69NDP1FZdOb5+Drr uDpwibpalBScp65U4OsCeFxEcYmxLu3FfQoYTFCSbe+0E4lqPKN+R03w0sGG/5hOMYNx WqpA== X-Gm-Message-State: AJIora9uvC8kn/UqN+KQeRv+5EoGorDhxMIQTeJxmCtlfHt7kLYcJqwW YV6Qji8qLXZSIwmLF4cqSyncUXGATPFqhiMmHYaOsD+1ST5djkitDKKAly3yioxsMhKJc9mrDQ6 TB/okD0IXeohdMuxEAXHSi3f9a4R2YK9UZMsse7+i X-Received: by 2002:a17:907:72cf:b0:726:9f86:7262 with SMTP id du15-20020a17090772cf00b007269f867262mr5449222ejc.258.1656327383190; Mon, 27 Jun 2022 03:56:23 -0700 (PDT) X-Received: by 2002:a17:907:72cf:b0:726:9f86:7262 with SMTP id du15-20020a17090772cf00b007269f867262mr5449209ejc.258.1656327383024; Mon, 27 Jun 2022 03:56:23 -0700 (PDT) MIME-Version: 1.0 References: <20220627075148.140705-1-code@siddh.me> <9f79f8edfa8f7c5099b842f020782ac2@linux.ibm.com> In-Reply-To: <9f79f8edfa8f7c5099b842f020782ac2@linux.ibm.com> From: Vlad Dronov Date: Mon, 27 Jun 2022 12:56:12 +0200 Message-ID: Subject: Re: [PATCH 1/1] tools/testing/crypto: Use vzalloc instead of vmalloc+memset To: freude@linux.ibm.com, Siddh Raman Pant Cc: Herbert Xu , LKML , Shuah Khan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks, Siddh, This change makes perfect sense. Thanks, Harald, for helping with this! Best regards, Vladis Dronov | Red Hat, Inc. | The Core Kernel | Senior Software Engineer On Mon, Jun 27, 2022 at 11:54 AM Harald Freudenberger wrote: > > On 2022-06-27 09:51, Siddh Raman Pant wrote: > > This fixes the corresponding coccinelle warning. > > > > Signed-off-by: Siddh Raman Pant > > --- > > tools/testing/crypto/chacha20-s390/test-cipher.c | 9 +++------ > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > diff --git a/tools/testing/crypto/chacha20-s390/test-cipher.c > > b/tools/testing/crypto/chacha20-s390/test-cipher.c > > index 34e8b855266f..8141d45df51a 100644 > > --- a/tools/testing/crypto/chacha20-s390/test-cipher.c > > +++ b/tools/testing/crypto/chacha20-s390/test-cipher.c > > @@ -252,29 +252,26 @@ static int __init chacha_s390_test_init(void) > > memset(plain, 'a', data_size); > > get_random_bytes(plain, (data_size > 256 ? 256 : data_size)); > > > > - cipher_generic = vmalloc(data_size); > > + cipher_generic = vzalloc(data_size); > > if (!cipher_generic) { > > pr_info("could not allocate cipher_generic buffer\n"); > > ret = -2; > > goto out; > > } > > - memset(cipher_generic, 0, data_size); > > > > - cipher_s390 = vmalloc(data_size); > > + cipher_s390 = vzalloc(data_size); > > if (!cipher_s390) { > > pr_info("could not allocate cipher_s390 buffer\n"); > > ret = -2; > > goto out; > > } > > - memset(cipher_s390, 0, data_size); > > > > - revert = vmalloc(data_size); > > + revert = vzalloc(data_size); > > if (!revert) { > > pr_info("could not allocate revert buffer\n"); > > ret = -2; > > goto out; > > } > > - memset(revert, 0, data_size); > > > > if (debug) > > print_hex_dump(KERN_INFO, "src: ", DUMP_PREFIX_OFFSET, > > Thanks Siddh > I'll forward this patch into the s390 subsystem and on the next merge > window for the 5.20 kernel then it will appear in the upstream kernel.