From patchwork Fri Jul 25 09:26:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 4622041 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5A6089F36A for ; Fri, 25 Jul 2014 09:26:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90FD7201F4 for ; Fri, 25 Jul 2014 09:26:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1DB6201E4 for ; Fri, 25 Jul 2014 09:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751282AbaGYJ0M (ORCPT ); Fri, 25 Jul 2014 05:26:12 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:55602 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750818AbaGYJ0L (ORCPT ); Fri, 25 Jul 2014 05:26:11 -0400 Received: by mail-lb0-f176.google.com with SMTP id u10so3214265lbd.35 for ; Fri, 25 Jul 2014 02:26:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YaTk2S1YjsQdJr4oFh8IGcYhMfMCJBtiAQKKiZCkEls=; b=DIgh68ynthZR1b+evir3BG6Y8nd0l9Dly+7vmdeB9ylHf2/pA39x1H0EwDgIQwf7uM quefCHMrJGTQMwFLrxKAxerTJz3z8Vnjh9BoQD/g7wA0pfg7DiXizAKZL7R5ut3FBCIs ExdgjIOKPvjBnovdLGrHu1k54jBJDPyG+xPv1Khf0tVqLfE2MQTCx6OcGvy+2KU48iKo YiQFJIlFg+p/LsnpCkwEQSZdtT8ZLCLr2lfrZTwRIFEMmt0A2W7VEp7561lPCOaTql6r X1NI9bAcmIv2pnvS9a/ITG4QoIy46qc3xuvkB9KZ0zcCULAkQq8+/rmqT2P1yPbxpHgW I9Pg== X-Gm-Message-State: ALoCoQm93HPL7v3e4LJgeOE0QP39xBPXJJZGTBTvLL5y6Fse22LKo7emz/d15vITsMUAHuCnh2e6 X-Received: by 10.112.167.103 with SMTP id zn7mr14019042lbb.63.1406280367644; Fri, 25 Jul 2014 02:26:07 -0700 (PDT) Received: from localhost ([109.110.66.237]) by mx.google.com with ESMTPSA id lc3sm6229305lac.19.2014.07.25.02.26.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 25 Jul 2014 02:26:06 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Yan Zheng Subject: [PATCH] ceph: remove redundant memset(0) Date: Fri, 25 Jul 2014 13:26:04 +0400 Message-Id: <1406280364-30198-1-git-send-email-ilya.dryomov@inktank.com> X-Mailer: git-send-email 1.7.10.4 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 xattrs array of pointers is allocated with kcalloc() - no need to memset() it to 0 right after that. Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder --- fs/ceph/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index c9c2b887381e..f89698cdbc41 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -597,7 +597,7 @@ start: err = -ENOMEM; if (!xattrs) goto bad_lock; - memset(xattrs, 0, numattr*sizeof(struct ceph_xattr *)); + for (i = 0; i < numattr; i++) { xattrs[i] = kmalloc(sizeof(struct ceph_inode_xattr), GFP_NOFS);