From patchwork Fri Nov 25 12:23:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 25969 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3978056wrr; Fri, 25 Nov 2022 04:30:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VUOm/z5s2nkDT+y/7Efu+oyfgj+MWeg44mGv5lur6lDVmqO2gw4O0DuQoOE6exQPm+yus X-Received: by 2002:a17:906:a189:b0:7bb:8d9f:bd2f with SMTP id s9-20020a170906a18900b007bb8d9fbd2fmr5369371ejy.578.1669379408120; Fri, 25 Nov 2022 04:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669379408; cv=none; d=google.com; s=arc-20160816; b=OJkfjHJlT23+F5COPYb2kAjIKAuJmjoqzJIinoLcJGOrYi2JurKlqFMe8Z9+R9BxGP Sau2lCki7jOa85jxWL35Trb8wLGfcWX9PzOVOBU4SS81uASXH663td84MvPSyc5YUP5M ORtukdyTIizrrXKQ8hNN9DHre+FR+csUKa3edxh9T+qGMk8Fz73XNtf6dgKRWb6jiEgg Nzgu4c9IMdZug0V2qw6Ie48t+5j6bsroEFyrZVe2DRz1mb749M3BrW2FyyCHbalO3CMY 8+7fjGCI08veoZtSDQpenX7ev/2tKG5jCkeZ3H+JUiQSKY72LLX9IiZuN0/Pz79IeZ2T neFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=O+C8TgUqxnjF714FzSsABDCQahLAyubk/1XP5y/0qXE=; b=0vkbEXu3qMX3LMTkczfar1PWk8W/YpLsLxazxfLpmbB0n0MXg5/Eh6E5E/Hrg4Q07V zs4CHjE30Rw8oqwt5mPxavDFkNV25C5Tvy3f3fjHpr8vj5XTwQeYKATT7FzafrSsFcpp mv9wN3i+BhLd0xSLJG7C4I3QkbKr1xDL9L+e/XF/2SmRxheQfz3tEcD3pRNbmdEdq+GX IkVYkWILtkSHl6oAsC1IhP/vGHZg7uQGyxq1Us7Kouc8iHAEV1EuZPTfqAJiaJ8U1tOb OvuvZUQD/2zI9bTbeq46yyhbe8H9hsnjxfrjnMNyXZ1p3tO8/+fg81WvNDxpYRP53Gmy Ho/Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd11-20020a170907968b00b0078e11a20640si3128489ejc.2.2022.11.25.04.29.44; Fri, 25 Nov 2022 04:30:08 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229469AbiKYMYN (ORCPT + 99 others); Fri, 25 Nov 2022 07:24:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiKYMYJ (ORCPT ); Fri, 25 Nov 2022 07:24:09 -0500 Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81ED331DD3 for ; Fri, 25 Nov 2022 04:24:08 -0800 (PST) Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id yXkRoPBKkY4XVyXkUoE205; Fri, 25 Nov 2022 13:24:07 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 25 Nov 2022 13:24:07 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH 2/5] octeontx2-af: Slightly simplify rvu_npc_exact_init() Date: Fri, 25 Nov 2022 13:23:58 +0100 Message-Id: <60ea220ccf3b61963f7d5a97e3df2c76a5feb837.1669378798.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750471182237764580?= X-GMAIL-MSGID: =?utf-8?q?1750471182237764580?= Use kzalloc() instead of kmalloc()/memset(). Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 5e6c54577a97..c584680f2d2b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -1870,12 +1870,11 @@ int rvu_npc_exact_init(struct rvu *rvu) /* Set capability to true */ rvu->hw->cap.npc_exact_match_enabled = true; - table = kmalloc(sizeof(*table), GFP_KERNEL); + table = kzalloc(sizeof(*table), GFP_KERNEL); if (!table) return -ENOMEM; dev_dbg(rvu->dev, "%s: Memory allocation for table success\n", __func__); - memset(table, 0, sizeof(*table)); rvu->hw->table = table; /* Read table size, ways and depth */