Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15599752rwd; Sun, 25 Jun 2023 21:26:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7t74sb14AfZlNFogLh5URRLwilUnWSBdbgyAgl6uG7GFab9WkZjW3Q+ZYkaDDr3mqwzXDB X-Received: by 2002:a17:906:2e8f:b0:991:d883:3df9 with SMTP id o15-20020a1709062e8f00b00991d8833df9mr500423eji.21.1687753582743; Sun, 25 Jun 2023 21:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687753582; cv=none; d=google.com; s=arc-20160816; b=Yayq9AFCfETN1Iv+GRjDYf7psPQCkwEpLZFFPJAqvmt3ZulbJxCr6V/X4CguA4hH7C nZXh+9Y3cEoaKALh/jI0foqD1hJADvj4AvnB2J7iOUyH354YCSfcde7lBnEV++RBG8RK sTrXrElJkV3+TcxDhldcNaLyLe20zRmbzVAcPJ8+B+vVy9iBBvM0S1/QLE85RzqA+bf5 y28D4rA13YIj8FQ8XlL9+NeIZxulunmYTWNpobVwQN6ZUikFLjezlAovOdTJ4fLj0fKv mQZsexb/IsmHVFLiQJ3gUYNTC42zznXP48b1zJrNxrc8JoprT7tW1QjeC04xOuy5VbIv jHQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MSWMWCd0byTrNHbSK/N1bhf0LnYGkMThKJt+8R8h11A=; fh=cwluaEeye23flsG5i4pBGGVbmZ4pGZCW+qGcLpGyyeE=; b=iY+ijqLTU80PVTK9MMXp5hFq47cVzoWwNrh/+tuheQXY4CMUDDf/p/Vq8jcJy+Xmmf YHy9N4GqnK+E2O6XC97hDQ0kn1M0eA8Hn5/qqykOvqV6q845rkrMG4bMuKPXN72MkSrC PX5O1kujEyE9PpP8ZUeBKqGwIJJgPVCNQvnxPl/FFKOU+XSp6nKamx9mRAHzM7BIIGzk af4MQebB4jnPucBZUHAmHo/pOHgfgcv7NcZLrspLpx69269CeBmyTL5PoROZtlQDHJfQ 6rUryCCGBzj8+HbGWoOOfU6UsiEfwrV3i3FQklRYfH6tu2PC7D1PiB9umYwYtRmchplw Q/5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=U9Solak4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020a170906549000b00988635d8c25si2220918ejo.603.2023.06.25.21.25.57; Sun, 25 Jun 2023 21:26:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=U9Solak4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231477AbjFZD4q (ORCPT + 99 others); Sun, 25 Jun 2023 23:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231288AbjFZD4M (ORCPT ); Sun, 25 Jun 2023 23:56:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D38C1B1; Sun, 25 Jun 2023 20:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MSWMWCd0byTrNHbSK/N1bhf0LnYGkMThKJt+8R8h11A=; b=U9Solak43lH5neqs+YjeuS0nWQ xFg2kNqaF26r7swdIf8Uf6Mou2or9DVmFgjaH3YmhK5Qs4XpDIM1SGKKGK+G45/1dAuiHNzYZDIGH F/tTCGM+t/TSkHzvsP1bAH/NZ2X/EECqiwI77j18/fbhOkrd4OL4VM0WBxsVslLzGgNHND7HP356s m9p9uwD+mHcehKT1Vk9XDicvYNvh69ig1BOQOQtmCzOEdhygjhQCQWt8VMp/Tzjjlpu6YDMuM9wtN ODJwjIt6XOfmNJBBNspQpfFUlRI/HlvHcnBO5jePecRZP5m0TAUZzo9blS/nHx6fkWS41J+SmD9ep D3UQrNAQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qDdJ7-001IpL-NT; Mon, 26 Jun 2023 03:54:29 +0000 Date: Mon, 26 Jun 2023 04:54:29 +0100 From: Matthew Wilcox To: Lu Hongfei Cc: Christoph Hellwig , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com Subject: Re: [PATCH] fs: iomap: replace the ternary conditional operator with max_t() Message-ID: References: <20230626022212.30297-1-luhongfei@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230626022212.30297-1-luhongfei@vivo.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 26, 2023 at 10:22:12AM +0800, Lu Hongfei wrote: > It would be better to replace the traditional ternary conditional > operator with max_t() in iomap_iter No it wouldn't. There are two possible meanings for iter->processed. Either we processed a positive number of bytes, or it's an errno. max_t() doesn't express that. Your patch adds confusion, not reduces it.