From patchwork Thu Jun 27 17:39:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuqian Huang X-Patchwork-Id: 1123536 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b6Gog/uY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OhEd+Upb"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45ZRwS6lHKz9sN6 for ; Fri, 28 Jun 2019 03:39:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=5SJ2o9mXHy/yetcYxB+7dgy2964J8PfdWWv02l0l4Eg=; b=b6G og/uYaZ1PcWsYUs/f8WdzpE2jwOjLXqV5aljEK1cIKMR+NDIZZBvSSloNoiHlj+werxm0pLkM4T84 Vdtwm38jZ+FQUlmLRzveziXoArmBQ5FVFeDH+bohmVLTNRSq92pj7GF9sWmwWRvFSvo4jUgMtp29c cxkyoGPuQSUeJimr3eC1nx0lRkK70y/HMMsdNfF4Xu5OorDkMNSVPaepfc2zkbLMSBVkqg7oOxtSv YdidRdqn1kutrQA3Et+h0bg+Pxx4v8A5NTe1CDbT1dzu0w2h6jVo3S+IcnQ8J9Mvj2l02FFxmOV5U TM+ZcF+MG5MgrAgJshzoiAj4h4cgxKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgYMf-0004Di-Gz; Thu, 27 Jun 2019 17:39:17 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgYMc-0004Cp-BQ for linux-mtd@lists.infradead.org; Thu, 27 Jun 2019 17:39:15 +0000 Received: by mail-pg1-x541.google.com with SMTP id z75so1342905pgz.5 for ; Thu, 27 Jun 2019 10:39:13 -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; bh=cO/EhwNLhEBZIOJaWYP275DFWQtB2l0qegc0KCTXlr4=; b=OhEd+Upb76lWIf0OlxsFw/JBvbBQsZ4lM6cn4tqa3owGLsDTVW+5Se/Uk6sZBSYUQ9 hm5E9vPF1A4sydujUM8mxkGxGEyd5x1n54ziJY+zSHrN9I4mvrr5Zwv3mzKvheBGaHZ1 OZkvw6VQpxk3SLRzAAs+LTHJ0bzmn8WXYzrpedhtgoC2TKe2ErLVAIPZCtiKhKtHeQRD EX79wZjXAEkURAG4UPeaHevFj5OxMI7B2C7GdYmg/YBSm4HxoQrkZCDIMxD5618z4o7W O53GJvcR+PKh/GcyO21HY5FnNdv3Jim3+uXYAQNlQTQleoqxelLOWPwKfLMMc089EboC vB+g== 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; bh=cO/EhwNLhEBZIOJaWYP275DFWQtB2l0qegc0KCTXlr4=; b=o5GIGCITIYXCX93dZ7dlDIwB0CYlzJv9OB0z22jxnhCmB9pf49StVy/7WGJ33Rl9WF alPykPGaYJ6jVwd/dwS5s/Amelpf/9XuVQMwkWzaUkQAl0CyLoso0GtTlxBjaefH5iwy SC1WM02ayCJMmQYcfLOJiWTBAd4JKEGqt5Po+q7g5aDoCrPBv26l4gi6kCr2akalYrjD Ys+ItgJEFvbfgo3j69c/ig7LuNT/6IgXI8pfgoqS8A59EBOH/0Szkx4sE6OIfvZCn4J7 Xid2j5w2UHNNeOoxVtKsWWo18FVxfi/3NIhnykeu6YpPc8gdly8p+Wlw5GkRPh6o/Mkc RXtQ== X-Gm-Message-State: APjAAAUODgETO2Rmv/eKN1wAq+cduzUL7BNUutZiTCO/1tLz5/gF6s1/ bI1JoyhVWidi+ZO1JWmPzUg= X-Google-Smtp-Source: APXvYqx1+lqv+Rv9CYPJbjHJvv96N0Pg00kJiUjVmyPJ/ERoLmFfoLDu+geOyscEfSCTTegdydwoNg== X-Received: by 2002:a17:90a:bb8a:: with SMTP id v10mr7556179pjr.78.1561657153468; Thu, 27 Jun 2019 10:39:13 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id 133sm3450478pfa.92.2019.06.27.10.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 10:39:13 -0700 (PDT) From: Fuqian Huang To: Subject: [PATCH 35/87] mtd: nand: replace kmalloc and memset with kzalloc in nand_bch.c Date: Fri, 28 Jun 2019 01:39:05 +0800 Message-Id: <20190627173906.3675-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_103914_400838_4052B8CA X-CRM114-Status: GOOD ( 13.35 ) X-Spam-Score: 1.3 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [202.120.40.82 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:541 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (huangfq.daxian[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kate Stewart , Vignesh Raghavendra , Boris Brezillon , Richard Weinberger , linux-kernel@vger.kernel.org, Marek Vasut , linux-mtd@lists.infradead.org, Miquel Raynal , Fuqian Huang , Thomas Gleixner , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org kmalloc + memset(0) -> kzalloc Signed-off-by: Fuqian Huang --- drivers/mtd/nand/raw/nand_bch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/nand_bch.c b/drivers/mtd/nand/raw/nand_bch.c index 55aa4c1cd414..17527310c3a1 100644 --- a/drivers/mtd/nand/raw/nand_bch.c +++ b/drivers/mtd/nand/raw/nand_bch.c @@ -170,7 +170,7 @@ struct nand_bch_control *nand_bch_init(struct mtd_info *mtd) goto fail; } - nbc->eccmask = kmalloc(eccbytes, GFP_KERNEL); + nbc->eccmask = kzalloc(eccbytes, GFP_KERNEL); nbc->errloc = kmalloc_array(t, sizeof(*nbc->errloc), GFP_KERNEL); if (!nbc->eccmask || !nbc->errloc) goto fail; @@ -182,7 +182,6 @@ struct nand_bch_control *nand_bch_init(struct mtd_info *mtd) goto fail; memset(erased_page, 0xff, eccsize); - memset(nbc->eccmask, 0, eccbytes); encode_bch(nbc->bch, erased_page, eccsize, nbc->eccmask); kfree(erased_page); From patchwork Thu Jun 27 17:41:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuqian Huang X-Patchwork-Id: 1123542 X-Patchwork-Delegate: richard@nod.at Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="unJdVOMO"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d7D8Qcdg"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45ZRyf43p2z9sCJ for ; Fri, 28 Jun 2019 03:41:14 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=S56AAOmv+NUxFOAvlFjW1g928RtlD7zqWBEeSh0cbtU=; b=unJ dVOMO9NxDTXQ6xEKRnBTczawnl3Kkpca/of4TBGsKe3teiviOlbXgI16rgSCZ6OEIatYvK3MhqP2i kygiEarYjkjCS2dgSPEyKSHrdkf7LsMURBCXd02NhWIZJP55Xt280cgIUJ9SmvWvCSZz7isNdiiUx n6Xtiun/Y9UBf0FX/nZPqdaIvlhMAWsVlfTcPLnYL1cVtud8d7S4cSCXGYXBoHcaX7Y/jC6jU5LPs v20ZnrHufb4HA0fGfevDreOLuLZ1A/iOnXXg8nNlzFJ5De5XkGr+GURCCASCY2Ij7r1D4YGSvPw65 //Kn1BWzghXFqPnYG6sX+hF+DJ68rlg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hgYOV-0005qV-2f; Thu, 27 Jun 2019 17:41:11 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hgYOS-0005pm-NV for linux-mtd@lists.infradead.org; Thu, 27 Jun 2019 17:41:09 +0000 Received: by mail-pl1-x641.google.com with SMTP id b7so1673579pls.6 for ; Thu, 27 Jun 2019 10:41:08 -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; bh=68Sx2VJWJZyxqxxlYRI+Ma3rhm5eQfyCtxzhaZFU+Dc=; b=d7D8QcdgRoYgc0tN0G4Fku9kw65FYsH/JmBJwJZsciYyz2xu3iuMx/0IFSMK9DzhHC YxNH/SgAikOoE+OUuDT/8YVM9NULi++YiWOGjKku+wibg42dmN20IgbRIBOpRTlcieQN DDyZ7J51bVbgnlmBYhquALXYsHMz1O32wCTc1RW5EoHws1Zbh9a5MutEf1F5SvaNGIRf 9iJM4NQNM2sSaSCGNSYsugr/4GC7ollQtVQ1qAG0/PzqOrQ6rupoWxA25zLa9W8dm1vy OeLYIo4r5LoGkFADOdF2zGAljHjeNRatQccUGqlYc4ZYW5vkwjIG3lwrZqwNPa3yeypY Zn6Q== 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; bh=68Sx2VJWJZyxqxxlYRI+Ma3rhm5eQfyCtxzhaZFU+Dc=; b=SK2hJZa4TtngrkHzlwY/FmXErh5nnhWzDut+3ezK0KJRPvyuJ3nakr03ityvpDBolO 2uxkxCvWlErPqCnfGcmRP1rK9nFF90N/DTYKL+4bu/R045NonLSY8Pzi28ygPYNmZQtY 5QyvhzeC57zmryd4ngGiHywilYTpyISH13O/UB8GUvgALOZfIYnVx8utI316xIR2aWjl 0+OgWk7Gf7PNMKSovBn4Ktjx565YXFSz3d7yLfRsdHPg6vEXcOFJ5f8iXvovt4mx17wQ BbPXeo1TnOjOnkfDOScJmszduVusyMof96WAOGwskNA81SKDL3jfKkbZm6V+1tIZSmdz EGiQ== X-Gm-Message-State: APjAAAXzljVk1EfuM94O3wDrR3/Mo77kUvdAy9ftAHQQbjhZdtqp/X1x GoZDyqRTLsGrEd2sfq8wkB5KUAhe/rnRKA== X-Google-Smtp-Source: APXvYqyQ3BRpaofxHGGPmEe5BWvSbpUwsNSCEzGOIMOz8jvllwSuhOM/2XHjuZi3Y/55eGtIfQUYUg== X-Received: by 2002:a17:902:2884:: with SMTP id f4mr5899596plb.286.1561657268332; Thu, 27 Jun 2019 10:41:08 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id s43sm6322406pjb.10.2019.06.27.10.41.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 10:41:08 -0700 (PDT) From: Fuqian Huang To: Subject: [PATCH 44/87] fs: jffs2: replace kmalloc and memset with kzalloc Date: Fri, 28 Jun 2019 01:41:00 +0800 Message-Id: <20190627174101.4291-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190627_104108_786686_1AC9A847 X-CRM114-Status: GOOD ( 10.89 ) X-Spam-Score: 1.3 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [202.120.40.82 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:641 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (huangfq.daxian[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fuqian Huang , Richard Weinberger , David Woodhouse , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org kmalloc + memset(0) -> kzalloc Signed-off-by: Fuqian Huang --- fs/jffs2/erase.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index 83b8f06b4a64..30c4385c6545 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c @@ -43,7 +43,7 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, jffs2_dbg(1, "%s(): erase block %#08x (range %#08x-%#08x)\n", __func__, jeb->offset, jeb->offset, jeb->offset + c->sector_size); - instr = kmalloc(sizeof(struct erase_info), GFP_KERNEL); + instr = kzalloc(sizeof(struct erase_info), GFP_KERNEL); if (!instr) { pr_warn("kmalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n"); mutex_lock(&c->erase_free_sem); @@ -57,8 +57,6 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, return; } - memset(instr, 0, sizeof(*instr)); - instr->addr = jeb->offset; instr->len = c->sector_size;