From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30A11C10F00 for ; Fri, 22 Feb 2019 14:37:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 067612075A for ; Fri, 22 Feb 2019 14:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727128AbfBVOhr (ORCPT ); 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.