Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1598723pxb; Tue, 17 Aug 2021 16:14:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0DGEPGq6bTYVZPdDAxQIWYB4tMxPkFs+IIwuvgIAuYFTL6Z/eGevVrgAPGTWkG5t8f74K X-Received: by 2002:aa7:d946:: with SMTP id l6mr6457990eds.81.1629242049349; Tue, 17 Aug 2021 16:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629242049; cv=none; d=google.com; s=arc-20160816; b=Tq7cd9G9KKpQjmOaausO+Ui5yd3Y4h6sYIoj2VW1Mov8FAQrEykaq4/oPs0L5bYZ3b GhGksOyVPKgXtrzxPrLvyNR6/Aqzxvi0lE0Hd/fMf5KdJ0YP3nhqOwvjiDOcSwaPPEof eLsAF0T6LRCP43gyzYM5+xMbZRsZlJluT4UJq2q0VltFrBL0DaJM99nSrPdHBx27dWCG ouACAS8Tk5tPBoqAjRMJBDTdjaJ8Adcthhbvmj1zvkC3iENHurB+vdWHacrzxZlpohJh H7BOQYv3fp26E6e/MVRnBRIsF+7tn0MyalGS50f0fBNZ1aftNKvwm5V+wdIKcp45dwds b7EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version; bh=OFi6YQIlPheeE+m6HTgLGha0nLN0ThYyBRsfa2Krfm4=; b=z2MFPP7J2uYbSp7Nei4BaD7VLeQ/KoSG6g3l7eGJr+DUZwGvwVNc7ZCi/eT5obA7lH 0kE9jN/kXyq54ep2bkuDTFlIydh7HTn4T4mJi/1rDGe6nX/kKJ/9w5pTDedNzp4AF/Kl lxPc7HPCqyuLAMwvsOkzq6aTK6L51DUdGy0KF+BuslPhDcIZ/jcpSlWllv01SwfuISeL ROArUTuZZ9u8bzQ9AewcNh/xQszYds1ybD1402WU7l4fDL4SZ3l+1ZKLNRhXPZtl3M4q mg1R12UDWBc71Ijsg8LIuC3lMvudd4m/h/9XeKyJGgrynkJZGoYNF/l3ly+DgJ06bYV9 hL+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si3871902edy.30.2021.08.17.16.13.45; Tue, 17 Aug 2021 16:14:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235129AbhHQXMo (ORCPT + 99 others); Tue, 17 Aug 2021 19:12:44 -0400 Received: from smtprelay0059.hostedemail.com ([216.40.44.59]:55966 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229466AbhHQXMo (ORCPT ); Tue, 17 Aug 2021 19:12:44 -0400 Received: from omf02.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 9D511837F24A; Tue, 17 Aug 2021 23:12:09 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA id 385B81D42FA; Tue, 17 Aug 2021 23:12:09 +0000 (UTC) MIME-Version: 1.0 Date: Tue, 17 Aug 2021 16:12:08 -0700 From: Joe Perches To: Kari Argillander Cc: Konstantin Komarov , ntfs3@lists.linux.dev, Christoph Hellwig , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] fs/ntfs3: Use kcalloc/kmalloc_array over kzalloc/kmalloc In-Reply-To: <20210817193815.307182-4-kari.argillander@gmail.com> References: <20210817193815.307182-1-kari.argillander@gmail.com> <20210817193815.307182-4-kari.argillander@gmail.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: joe@perches.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.49 X-Stat-Signature: swyfssfb7ah5sa7nde56bws168e185bh X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: 385B81D42FA X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19OIv/oxDy8QFR48+FXAV3FI4jvd0nPIaw= X-HE-Tag: 1629241929-872911 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-08-17 12:38, Kari Argillander wrote: > Use kcalloc/kmalloc_array over kzalloc/kmalloc when we allocate array. > Checkpatch found these after we did not use our own defined allocation > wrappers. [] > diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c [] > @@ -900,7 +900,7 @@ static ssize_t ntfs_compress_write(struct kiocb > *iocb, struct iov_iter *from) > return -EOPNOTSUPP; > } > > - pages = kmalloc(pages_per_frame * sizeof(struct page *), GFP_NOFS); > + pages = kcalloc(pages_per_frame, sizeof(struct page *), GFP_NOFS); This is not an exact transformation. This allocates zeroed memory. Use kmalloc_array here instead.