Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1944801ybi; Thu, 18 Jul 2019 00:48:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpCG7uqPUHOoSGyjfAYGZyPSb2W45cH6WBNGbKsSh3tVP6MhEyq3eEPFgVUCPXrG2OPwAE X-Received: by 2002:a17:90a:2648:: with SMTP id l66mr48725491pje.65.1563436112993; Thu, 18 Jul 2019 00:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563436112; cv=none; d=google.com; s=arc-20160816; b=RVoYNzTzXcmx0WPU8xGVHQQrxFwpEQ9lkiS2yAwB/AZwo9CL82TqG8LIxs6xb49MHN L6feQAFfrl871OFFjSqKJ16VuvqrRE1GGWcZdQZuw7WSVkup9k1qM1olKqejltm3DkXo yMYKSKjS4szxIKIwmDY6KdtzR0QYu2sj2EXR6uT5t+C33cPD3DSOwTfaOqTUQSvb8J36 E9ccIj7XWirQsh+Pqax8PSjgRluqj8gv7N/J594LkO6q9bNMmW9yDk3apkKn5fq+9LO4 GzStfFBgXIyRbHP7UnMveph8GoPjOJRT3lqghBfGn0znf6eOmhOIEOhJ7z3VtCpvKXZZ eCmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=yFxTAg75DiLly5zn9XvgtkjCH+JOZJ6WOJQ/240CnJM=; b=OFBU03JS6qvEmkokLP204Fb2sKTtIhPRTsOj+fi7hcn55NPC2Eat3BhncJ8c2NZa1Y 0jeUwKJ4wCLHZ83DI3/r63akfMJcvL1FQXiiOOT5+MIMKTxb1gykAg/VlcE3exxvS3RM EX+pNKHItJQrCNiIy+EtzQ7o188lsCcE6r4FY76M/Yn3EaHpATqjALhG21ftZy4spn5A HwDxBgymgL5uLDTT0ZOTDpZ5xYsbSNzJbi6G/Z0ry/EL8h/Y6eEYC3nUttZsBE87Wg85 imsaHmV+ak26FcXHbMHVKRhuFUJRhp8OAZYKFlEfknTo8/qQmMufdkn11x8FFzqaOxxf BuKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=iA3UCLHC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si1548744pld.245.2019.07.18.00.48.16; Thu, 18 Jul 2019 00:48:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=iA3UCLHC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389340AbfGRHps (ORCPT + 99 others); Thu, 18 Jul 2019 03:45:48 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:33589 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbfGRHps (ORCPT ); Thu, 18 Jul 2019 03:45:48 -0400 Received: by mail-pl1-f195.google.com with SMTP id c14so13397125plo.0; Thu, 18 Jul 2019 00:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yFxTAg75DiLly5zn9XvgtkjCH+JOZJ6WOJQ/240CnJM=; b=iA3UCLHCBvCdyYdatB0DvKP1H1A/rmz3DyfPw9DZEeJYraSkpZ08/sLQFUfv0uiGzs mBV/17aADRGptUoJ0J/JsY3zNqMRMkC/n2ZEJGwPn4qQu255W1kETvfo1qExxg/S933T fLpjOJB0mJtIejm/weQRBfvVhdrwRMHakgShHkR572Gv/q7E1s/Nhdr/hKzjqnmLnq2e 7ZIJ7KIOckk2+uL/8DcxQg7c1nSpuCBBgHhcvQ1SZ/1mGqJ9InYLJKc9SPEJJNUlawY8 x6TVoAKDYqImfQguvNb+yg10wE1rrvamSFphvf9he+qip4ZnuHJWwQarD5nN9fNOpikg uqsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yFxTAg75DiLly5zn9XvgtkjCH+JOZJ6WOJQ/240CnJM=; b=XK67Ooqg0+p0oJD3U0TVISRwinomSBVTIt2wAtsaMn8Cu/TcnhzyxN6qqfRk8mqroj w3EhJ/Ze/egaurxamytBVEiQMNG2m/PctIRVMB7qKvOITaC23LnymYyJauG5jqLpwYtR myZR3VcOQLxK1ooX6qPI0ragRs5eFmztXcOe6aYGxlEKCAlifHn1+6iecU3wu4VOU9bb Jjngvf1pXSegl8XMshI6vnBmXTM9oJssWz8c6eRVI9BUBhvsk1T9QWYYat3fTkhBTjvB /0EoQg8d37tQtc1MawRwECCM5U6/w53inkAv2dvMsX0FZyBWitbNu2/yCUgxZMCXZa8o Gctw== X-Gm-Message-State: APjAAAWD5djXgYsrV0CdSyp/n0soaI0wWXwhq99n0zAXknmKkAIwhqZu xaugdhcCu4b8WCrj2wBPh88= X-Received: by 2002:a17:902:9897:: with SMTP id s23mr48196033plp.47.1563435947579; Thu, 18 Jul 2019 00:45:47 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.gmail.com with ESMTPSA id b26sm31098317pfo.129.2019.07.18.00.45.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 18 Jul 2019 00:45:47 -0700 (PDT) From: Chuhong Yuan Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH 2/3] liquidio: Replace vmalloc + memset with vzalloc Date: Thu, 18 Jul 2019 15:45:42 +0800 Message-Id: <20190718074542.16329-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use vzalloc and vzalloc_node instead of using vmalloc and vmalloc_node and then zeroing the allocated memory by memset 0. This simplifies the code. Signed-off-by: Chuhong Yuan --- drivers/net/ethernet/cavium/liquidio/request_manager.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cavium/liquidio/request_manager.c b/drivers/net/ethernet/cavium/liquidio/request_manager.c index fcf20a8f92d9..032224178b64 100644 --- a/drivers/net/ethernet/cavium/liquidio/request_manager.c +++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c @@ -218,15 +218,13 @@ int octeon_setup_iq(struct octeon_device *oct, return 0; } oct->instr_queue[iq_no] = - vmalloc_node(sizeof(struct octeon_instr_queue), numa_node); + vzalloc_node(sizeof(struct octeon_instr_queue), numa_node); if (!oct->instr_queue[iq_no]) oct->instr_queue[iq_no] = - vmalloc(sizeof(struct octeon_instr_queue)); + vzalloc(sizeof(struct octeon_instr_queue)); if (!oct->instr_queue[iq_no]) return 1; - memset(oct->instr_queue[iq_no], 0, - sizeof(struct octeon_instr_queue)); oct->instr_queue[iq_no]->q_index = q_index; oct->instr_queue[iq_no]->app_ctx = app_ctx; -- 2.20.1