{"id":812793,"url":"http://patchwork.ozlabs.org/api/patches/812793/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/1505215162-3917-1-git-send-email-himanshujha199640@gmail.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505215162-3917-1-git-send-email-himanshujha199640@gmail.com>","list_archive_url":null,"date":"2017-09-12T11:19:22","name":"qed: remove unnecessary call to memset","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"0399cd617c0ce13064cad84be7b9167c086b5e5d","submitter":{"id":72201,"url":"http://patchwork.ozlabs.org/api/people/72201/?format=json","name":"Himanshu Jha","email":"himanshujha199640@gmail.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1505215162-3917-1-git-send-email-himanshujha199640@gmail.com/mbox/","series":[{"id":2670,"url":"http://patchwork.ozlabs.org/api/series/2670/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=2670","date":"2017-09-12T11:19:22","name":"qed: remove unnecessary call to memset","version":1,"mbox":"http://patchwork.ozlabs.org/series/2670/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812793/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812793/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"NQxLzkYR\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xs2Q46qwlz9sRg\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 12 Sep 2017 21:19:56 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751422AbdILLTo (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 12 Sep 2017 07:19:44 -0400","from mail-pg0-f66.google.com ([74.125.83.66]:33178 \"EHLO\n\tmail-pg0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751289AbdILLTn (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Tue, 12 Sep 2017 07:19:43 -0400","by mail-pg0-f66.google.com with SMTP id i130so4011221pgc.0;\n\tTue, 12 Sep 2017 04:19:42 -0700 (PDT)","from localhost.localdomain ([103.254.204.108])\n\tby smtp.gmail.com with ESMTPSA id\n\th1sm13156754pgp.37.2017.09.12.04.19.38\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 12 Sep 2017 04:19:41 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id;\n\tbh=TmnCL/6l8F/CcLlRxdh7Atjo54z7oVqwlF0lFmiP8Ks=;\n\tb=NQxLzkYR1i/lyiu3iMzkrFbrOoDnCC1C79lHkLFP/wXKWYG0lqM851bdT+s5SYnkkJ\n\tTe9lZWveXNYrtGRt7WlfpH0yf/f6WaEj/3teRrp/Zr3M/2b8RQKyRsATYFQqYDQv2SBq\n\tp/uCDTtqk643EMKMrwdn/uU2lbtIEvfqgO38fNFjDnozryOw2eGwpmsHs12xWOBXQhUi\n\tWXJHIZ3Gh8lP0hrVHuPQ/E64A4Mpxh8Oeyuy3IJUNmpoYmmYvdOcV9iR4qdHDhc5uMep\n\tMJuhsahUBIrHNg7KZSuwGa5wrCN/58Otd0+voyNGmDVVPVcqsaZkh/QnKznr7UCAQoSs\n\t+jmQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=TmnCL/6l8F/CcLlRxdh7Atjo54z7oVqwlF0lFmiP8Ks=;\n\tb=Gi0FVNs+biWa9zE+8qttbvkMKcwQ0JDrLkG3xf+//FCFykOlVfiieyFomcV8ifzoga\n\tfmDIzPqeubi8uYvS/U/GFJuvruZjhSGWgTHsK+ERAqgazWkPXM1p9x7FtNPazbT7Ppvt\n\tQR0vBcKg2OpobWZ24KXbIxnIPpMsrbfta/9+dkVFMM0fVO/H5duCgrmVBEnHXBtK6nsl\n\tn/9YCLu42NTU/l7EIluOich5mpe9MG0Sro9KRgtT+KDVDmMDNEb7+2xSgPLq09ZNf69l\n\t1B3w94CXrSBuY+gEgPEmgAJ73sjs5BnNtQiFWRancfpQjnUHwJa5zyNhsBVYDG8BEVcA\n\t9Tlw==","X-Gm-Message-State":"AHPjjUhq2NyU/EQ/hvlItUQxqZLJ1h5p1DIXoZFlzt8hn5CvxokD0SUc\n\tEkAlIPU1cfRl0Q==","X-Google-Smtp-Source":"ADKCNb5s8/X4o3Kc2SOhTMiMtxXItPwgogJtuhSxuJbkFt6k+MeJs8GQEq8XRq3YyOsZeI4BdzwjMA==","X-Received":"by 10.84.232.135 with SMTP id i7mr17339299plk.104.1505215182702; \n\tTue, 12 Sep 2017 04:19:42 -0700 (PDT)","From":"Himanshu Jha <himanshujha199640@gmail.com>","To":"Yuval.Mintz@cavium.com","Cc":"Ariel.Elior@cavium.com, everest-linux-l2@cavium.com,\n\tnetdev@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tHimanshu Jha <himanshujha199640@gmail.com>","Subject":"[PATCH] qed: remove unnecessary call to memset","Date":"Tue, 12 Sep 2017 16:49:22 +0530","Message-Id":"<1505215162-3917-1-git-send-email-himanshujha199640@gmail.com>","X-Mailer":"git-send-email 2.7.4","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"call to memset to assign 0 value immediately after allocating\nmemory with kzalloc is unnecesaary as kzalloc allocates the memory\nfilled with 0 value.\n\nSemantic patch used to resolve this issue:\n\n@@\nexpression e,e2; constant c;\nstatement S;\n@@\n\n  e = kzalloc(e2, c);\n  if(e == NULL) S\n- memset(e, 0, e2);\n\nSigned-off-by: Himanshu Jha <himanshujha199640@gmail.com>\n---\n drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 1 -\n 1 file changed, 1 deletion(-)","diff":"diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c\nindex eaca457..8f6ccc0 100644\n--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c\n+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c\n@@ -1244,7 +1244,6 @@ int qed_dcbx_get_config_params(struct qed_hwfn *p_hwfn,\n \tif (!dcbx_info)\n \t\treturn -ENOMEM;\n \n-\tmemset(dcbx_info, 0, sizeof(*dcbx_info));\n \trc = qed_dcbx_query_params(p_hwfn, dcbx_info, QED_DCBX_OPERATIONAL_MIB);\n \tif (rc) {\n \t\tkfree(dcbx_info);\n","prefixes":[]}