Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4509004rwd; Tue, 30 May 2023 06:28:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tjFkc/N93Y3/nl/rTFiJQe8UVessVuTR8c0q+BWJprU8AAejcvGGkOQrVVVFbvnamiy4l X-Received: by 2002:a05:6a21:3944:b0:110:2064:edc with SMTP id ac4-20020a056a21394400b0011020640edcmr2207713pzc.13.1685453299099; Tue, 30 May 2023 06:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685453299; cv=none; d=google.com; s=arc-20160816; b=GM6V/ov4DB4PWDfMfB3agha9NrsfmU9eI4xgOnXLxxrbf3CJf67siLPTAFjSNU3Fg6 bAeTY7UGpCkN0XudwS9UUFfWOuDEvstAdaYdwd5UqI/JdKZWFibED776IjwpgUNHn+Y7 ivgikjjDReksshAv+dgQJB/zqaZ0zM/VRCmJ++M+JUU2WMTKjZxqQ55x/VjWSgAiq374 zhxgK+H/Lk0yIxY7I7Gynf/aUjQfRIxTl9gAXCKOu8xnqS09KkH35FDDR3rVywrq4whm S1BKKeKGNT2vSpaUDXmOALFaf5JyDC2peCVbFRx2ci05k4ecn5XP+Rh/Qa/4e5Apcau3 Yg/A== 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=Drw7ZiISMTlYwQlP2tc86Tkb8Zg9w9S5oUOCgiy4lMs=; b=RRozLSEgclBTgE7noMzQY0v681J5+cIge9aWnku4Z6S2W1XanKPbUrrqnMQ6txTJW4 gaxqrYDk0v36NXtrBKLohry51Hzb+LMZoyFHS4hWJm9oK6g+PTGOLja3EetlqIJhkPo+ ToHXsQ5XJm1ef35Wtjf76jahwx18RUuTHfJ1tp/WEsW6i5YCnAZXGuGDcExs1V0Yv65F wOtaC5XguQLLCSqNI4mpntACMU4hHIHEeCgbz7K+lsnuWyE3OtLBr3Vb8wgOgTdIHwC4 5sFj34CVJmdiXa4UCqRZBK1P/lHt6fOtJjUL2TeOQhqVgyHEaXkHhv4DDf9LOloaqAQR oZ+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="SNyvoJ/8"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e21-20020a637455000000b005347d73e09csi11590647pgn.837.2023.05.30.06.28.06; Tue, 30 May 2023 06:28:19 -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=@lunn.ch header.s=20171124 header.b="SNyvoJ/8"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232042AbjE3NLX (ORCPT + 99 others); Tue, 30 May 2023 09:11:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231551AbjE3NLW (ORCPT ); Tue, 30 May 2023 09:11:22 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84CE1A1; Tue, 30 May 2023 06:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Drw7ZiISMTlYwQlP2tc86Tkb8Zg9w9S5oUOCgiy4lMs=; b=SNyvoJ/8K1jd1+68bWFWoiPyt6 WA8Z4aAcHRZn1q6yHDubjJ6w5cT3MPAWm12VIgwjWSkLOm9m6WSWshmfQfASU1HfrWo/qxvqROax5 n2ZRpuVwuQR54K2eK2tz29YXGUtwyfdUdXwvgqfhiqpihwKaQ+1181rHqFHMl0YsL3pg=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1q3z85-00EKRE-69; Tue, 30 May 2023 15:11:13 +0200 Date: Tue, 30 May 2023 15:11:13 +0200 From: Andrew Lunn To: Lu Hongfei Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "open list:ETHERNET PHY LIBRARY" , open list , opensource.kernel@vivo.com Subject: Re: [PATCH] net: Replace the ternary conditional operator with min() Message-ID: <851564e1-1e23-4950-8aab-50c7693b4b8d@lunn.ch> References: <20230530084531.7354-1-luhongfei@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230530084531.7354-1-luhongfei@vivo.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, May 30, 2023 at 04:45:30PM +0800, Lu Hongfei wrote: > It would be better to replace the traditional ternary conditional > operator with min() Hi Lu Adding to the comments from Russell and Heiner, if i remember correctly, the exact same change has been rejected before, for the same reasons. When submitting a patch, please do a search first and see if somebody else has already received a reject. Did you use a static analyser to find this? Please submit a patch to the static analyser to stop it reporting code like this. That will save wasting peoples time having to develop such bad patches, and reviewers having to reject them. Andrew