From patchwork Tue Sep 29 17:10:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "S. Fricke" X-Patchwork-Id: 7288761 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2CE239F1D5 for ; Tue, 29 Sep 2015 17:11:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69E3220676 for ; Tue, 29 Sep 2015 17:11:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90F0C205C7 for ; Tue, 29 Sep 2015 17:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935097AbbI2RLb (ORCPT ); Tue, 29 Sep 2015 13:11:31 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:32893 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933971AbbI2RLL (ORCPT ); Tue, 29 Sep 2015 13:11:11 -0400 Received: by wiclk2 with SMTP id lk2so161268189wic.0 for ; Tue, 29 Sep 2015 10:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=N8PFYlj94/4xbzPMS9ciVhOWQDGuX/xnamF4Cng9CY4=; b=wk8r2IyZgVAQ5CMjwRAzAJKWRm1yjQdmezCbupwvvZkAcZt/Enj+joJiXLFLxAU66z p96Xr80hARXHV+vM0PDZ3rd64Yta7RmQEZnYV7EAp7DfLIm48feRHNSX6HgM8LbmF0Hj zZV8kj6PCfdCf+agCtmU75l+ZlMWoTzIMDzDFbt08MMgLj5LynaHm4gu0yhd017Sm98W Zw/yIjrB0bTwnToLl+ECYaznULzR82gYWp+P6E1GxnSfdvIFzCmDCTqmbptqGNW4sQvj doVMDKgp27KneOPPD+Yg/s7Ysj0oKJ2h8YUaoV+cZ2Q+xaHgLpQIazv/qRsnZWrEJel1 SQEQ== X-Received: by 10.194.82.198 with SMTP id k6mr29476561wjy.139.1443546670349; Tue, 29 Sep 2015 10:11:10 -0700 (PDT) Received: from zwielicht.lan (ip5f5ba60a.dynamic.kabel-deutschland.de. [95.91.166.10]) by smtp.gmail.com with ESMTPSA id xt1sm24898618wjb.32.2015.09.29.10.11.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Sep 2015 10:11:09 -0700 (PDT) From: Silvio Fricke To: linux-btrfs@vger.kernel.org Cc: Silvio Fricke Subject: [PATCH 09/11] btrfs-progs: use calloc instead of malloc+memset for quick-test.c Date: Tue, 29 Sep 2015 19:10:44 +0200 Message-Id: <760f5635a72bc03eb6ef8188c22a71b20bff81cc.1443546001.git.silvio.fricke@gmail.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch is generated from a coccinelle semantic patch: identifier t; expression e; statement s; @@ -t = malloc(e); +t = calloc(1, e); ( if (!t) s | if (t == NULL) s | ) -memset(t, 0, e); Signed-off-by: Silvio Fricke --- quick-test.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quick-test.c b/quick-test.c index 5dfb2fe..ffde85d 100644 --- a/quick-test.c +++ b/quick-test.c @@ -46,8 +46,7 @@ int main(int ac, char **av) { struct btrfs_root *root; struct btrfs_trans_handle *trans; - buf = malloc(512); - memset(buf, 0, 512); + buf = calloc(1, 512); radix_tree_init();