Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp1585957imp; Fri, 22 Feb 2019 06:38:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ1njVaf9aaXpwl9Nrt3xJFn1YinJIvnQgWF2ied+iNt0uHGSDFrh5hvMNrVPtUYWnftkSc X-Received: by 2002:a17:902:2ba8:: with SMTP id l37mr4484324plb.243.1550846317510; Fri, 22 Feb 2019 06:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550846317; cv=none; d=google.com; s=arc-20160816; b=Ua3C3gEmzX2WkzADkZWldDZexQoTP2LiVToNeCs7Ab+TIP7/4PfhyYZ9/N1FdJ1BPC PfjulqZz9heponpMNyG0pglrmEFad9qQkdhxlzuCK+zDqmxEsjEauOxrtYPtrDhTX5XQ 31d0BgXCmjyBCXMdTzSQ4GK8HnV5T9yDVnHm6Hsy3SKnwL1vl7fn776cZATojfCrTWzt CVr9zx/wJeg7NDxtTbyCn8Rs6uqyoTx49+jnr11hj/wWnrwh342FrN34+n0D+A0QEhM2 xExdm6vaHkx+R1y4kVPNBM5GymelS8jirFZvxtmXXVJJWL1yjxQV++4WxcgFFJea3yD9 yBUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=1oYKybDPrFcjZ5a1OZ8VA4KqufnW1LVNpwwFpaqcJrU=; b=m5jyc/52ltWuH+QHdaGl3kXYvwyp7SoTSBxi8QZMFDQOp0dnsp7iL2XPnG7CDgAjXg HZQQejCgxRDQkgWVserACnNi8n/sjwehDwS5SFSACKZ71deewT3X2k6U49LcCcb661xN 3Ds05BHRYMrc4ypa8rIB78E7XiVkTx1KdX5Up+cnRutmX+PE2uWwVRx39NGGzy4Sl8E1 Xb3LL7uKmLsvhCV7M+Kakuv9bb5txSGjySouFlA46d2f1KabphMHxrAH+0Q0isRLfD/q JtRvuJL1gZ9Tz89icoxFxe6AUiUkdNhHIqozZGN9frpCwa+poXK2WUQHpBNGF/RGSLdB g22A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71si1456798pga.16.2019.02.22.06.38.21; Fri, 22 Feb 2019 06:38:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727102AbfBVOhr (ORCPT + 99 others); Fri, 22 Feb 2019 09:37:47 -0500 Received: from mx2.suse.de ([195.135.220.15]:55430 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726376AbfBVOhr (ORCPT ); Fri, 22 Feb 2019 09:37:47 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C622FAD05; Fri, 22 Feb 2019 14:37:45 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 0901DDAA56; Fri, 22 Feb 2019 15:39:07 +0100 (CET) Date: Fri, 22 Feb 2019 15:39:07 +0100 From: David Sterba To: YueHaibing Cc: Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Dan Carpenter Subject: Re: [PATCH v2 -next] btrfs: Remove unnecessary casts in btrfs_read_root_item Message-ID: <20190222143907.GD9874@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, YueHaibing , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Dan Carpenter References: <20190220030840.188854-1-yuehaibing@huawei.com> <20190220123202.43256-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190220123202.43256-1-yuehaibing@huawei.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2019 at 12:32:02PM +0000, YueHaibing wrote: > There is a messy cast here: > min_t(int, len, (int)sizeof(*item))); > > min_t() should normally cast to unsigned. It's not possible for > "len" to be negative, but if it were then we definitely > wouldn't want to pass negatives to read_extent_buffer(). Also there > is an extra cast. > > This patch shouldn't affect runtime, it's just a clean up. > > Suggested-by: Dan Carpenter > Signed-off-by: YueHaibing Applied, thanks.