From patchwork Thu May 23 18:36:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 2608631 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 979B540077 for ; Thu, 23 May 2013 18:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757987Ab3EWSgt (ORCPT ); Thu, 23 May 2013 14:36:49 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:37961 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757245Ab3EWSgs (ORCPT ); Thu, 23 May 2013 14:36:48 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r4NIahhZ015574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 23 May 2013 18:36:44 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r4NIagcp013036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 23 May 2013 18:36:43 GMT Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r4NIagg6013028; Thu, 23 May 2013 18:36:42 GMT Received: from elgon.mountain (/197.237.137.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 23 May 2013 11:36:41 -0700 Date: Thu, 23 May 2013 21:36:37 +0300 From: Dan Carpenter To: Sage Weil Cc: ceph-devel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] ceph: remove unneeded truncation Message-ID: <20130523183636.GA10316@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org My static checker complains l->stripe_unit could still be zero after we truncate it to 32 bits. I don't see a reason to do the truncation so I have removed it. Both sides are u64 type. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index e0b4ef3..98fe5e7 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c @@ -43,7 +43,7 @@ static long __validate_layout(struct ceph_mds_client *mdsc, if ((l->object_size & ~PAGE_MASK) || (l->stripe_unit & ~PAGE_MASK) || (l->stripe_unit != 0 && - ((unsigned)l->object_size % (unsigned)l->stripe_unit))) + (l->object_size % l->stripe_unit))) return -EINVAL; /* make sure it's a valid data pool */