Received: by 10.223.164.202 with SMTP id h10csp261096wrb; Thu, 16 Nov 2017 23:39:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMaMsw+skUVAK2nxh28OQbV7v0vDyNwc9KDSAr7096CgLzUXDPQg7vwbLHYUnfUTXOpbW36k X-Received: by 10.99.167.6 with SMTP id d6mr4249986pgf.100.1510904346286; Thu, 16 Nov 2017 23:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510904346; cv=none; d=google.com; s=arc-20160816; b=upGak00VviKGfD2kwOGGV5hbeuE9v6QRFQe0J/diAz/bud437VS7/nX2sXDG8aeOLO Yua9omrFbNgwa/EenzauPgiou5zBo3Pk8iF9+ANizP2eebZfcUVpaofO4xMcyOo5QChR 876fbOwcfl1srVn65eNm+2E/DM+AzMzUE4dQf6HCPkd2ec3jHqHv8jHSYhFH+ItegwpX vcECSesajAYNVcxr7B5boqtyFxGx4NO/kX0UjrblMX9lefvrqFWYLcdIHFvUPW8ZXt/7 RsnxAT53jCHxtDFiEQo7Zu4hfk2s5yR+C3RH6d6/X9LwkXLKEJAUmvZboBw7T+Q6s6hm DYKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=NwSzOSpQO2jn0narmLdPf7bK2oSqpARcJd+k7yQErTs=; b=akalZXP8OZNTCpaR1UrcKOZx7zMXUJ378G4wXhe7HepYJW3LypD3J6FVZjtJqVhQnH Hx2hjcGTuCK3JmcPNRyJv7XbU9YiVqsqyl9ily4iCk5AsH7kNR/p26fs6v6BLv9NdLCq HkdHpTZmLUySspSEW76eNVMzZIbIqcLjpm0+mkRSQKAIc3+xRlBPOG0kmaB3PPJA6a0C VWeNtm/bjJCxd6gGnnl54UIaQ+/Wzjjbd26U9Qe5s+6ICNeZXnnpNuwX+EJ8ICdbpvbz VFUa333jyy6+wzUNglm8uyzM0ZIpNFHLeOX3N3K/m5Bn5ovA2yJNHusU8cQxCyicR7xh 50RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JdlZeHfu; 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=pass (p=NONE sp=NONE 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 r9si1221662pfe.13.2017.11.16.23.38.52; Thu, 16 Nov 2017 23:39:06 -0800 (PST) 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=pass header.i=@gmail.com header.s=20161025 header.b=JdlZeHfu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964975AbdKPWEl (ORCPT + 92 others); Thu, 16 Nov 2017 17:04:41 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:46326 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964784AbdKPWEe (ORCPT ); Thu, 16 Nov 2017 17:04:34 -0500 Received: by mail-lf0-f68.google.com with SMTP id g35so535887lfi.13; Thu, 16 Nov 2017 14:04:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NwSzOSpQO2jn0narmLdPf7bK2oSqpARcJd+k7yQErTs=; b=JdlZeHfuCQY3UOyWYVPQghK9b9w2KGmtR4sJm+RBV0cr/1X9kFVposRs61O3bnsLL6 GkYv8FIr5BHYlXQn/8s31m1BXhTZPIYXqB8aPXlbgfMGUsVrGJKCNoIRQyoJI16g1M2m f7B4wgx+Fp+cQXi/gTh8917ILsnWhmVS8XdLV3BVNz746yVAnrPbWFWWihpylGjAJAGw SRVpHU+j3Axl1AbnB/8O+YOgg04BLXSm0M1Q5EABixcPIgLWCoYXG/37FxtE4bE7dFyN +AW5ORH0CAJS1vzmFRHuInwjVzqi35OhZ1Prw5VaN3JWLX7Qs88hWDbvGuBb3qQfBP24 1fSQ== 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:in-reply-to :references; bh=NwSzOSpQO2jn0narmLdPf7bK2oSqpARcJd+k7yQErTs=; b=pbzquyonjtqW2nuOiJRRHgL4sKjR+qfoK3jLsfCdLWmalW/OqZQ3DF6sV+hbvsta02 +GNmXf005vzwudWgHnFSob3XQVFfQuhbBo6MD4UgU/TXI/l+UnpM7STAXafBQGnMznem h1ORrezV0MKRIU5nR/JMzllUKwCEVOMhFet+Mu1RwMdGWGa62q+WMBfN7RNO/FlzMMmr IKWvku6U0Dq/a0dZ3b+LvBU4uMW61iICMdcDGvw77/YCfs1LhoUyyTf252baaypU9e/9 zC3YlIFBbsMFLfcNG9uluUFQLUHMPCYCFkoI92LYxAIlO+nWKaHdURLtSn5zvaK5PVJb tefg== X-Gm-Message-State: AJaThX50bvk0RPzQntrZCk41dFfiyGAz6habkRSs3kRGfDUhuN7wWJHA P7cTgOsZA71470Jo6s8SC1c= X-Received: by 10.25.142.5 with SMTP id q5mr98594lfd.19.1510869873226; Thu, 16 Nov 2017 14:04:33 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id i23sm217734lfh.18.2017.11.16.14.04.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Nov 2017 14:04:32 -0800 (PST) From: Vasyl Gomonovych To: davem@davemloft.net Cc: Ariel.Elior@cavium.com, everest-linux-l2@cavium.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vasyl Gomonovych Subject: [PATCH] qed: fix unnecessary call to memset cocci warnings Date: Thu, 16 Nov 2017 23:04:08 +0100 Message-Id: <1510869848-23889-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510775895-16258-1-git-send-email-gomonovych@gmail.com> References: <1510775895-16258-1-git-send-email-gomonovych@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kzalloc rather than kmalloc followed by memset with 0 drivers/net/ethernet/qlogic/qed/qed_dcbx.c:1280:13-20: WARNING: kzalloc should be used for dcbx_info, instead of kmalloc/memset Generated by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci Signed-off-by: Vasyl Gomonovych --- drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c index 8f6ccc0c39e5..cc9e0dfcee48 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c @@ -1277,11 +1277,10 @@ static struct qed_dcbx_get *qed_dcbnl_get_dcbx(struct qed_hwfn *hwfn, { struct qed_dcbx_get *dcbx_info; - dcbx_info = kmalloc(sizeof(*dcbx_info), GFP_ATOMIC); + dcbx_info = kzalloc(sizeof(*dcbx_info), GFP_ATOMIC); if (!dcbx_info) return NULL; - memset(dcbx_info, 0, sizeof(*dcbx_info)); if (qed_dcbx_query_params(hwfn, dcbx_info, type)) { kfree(dcbx_info); return NULL; -- 1.9.1 From 1584293647237006606@xxx Fri Nov 17 06:29:21 +0000 2017 X-GM-THRID: 1584176532244896356 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread