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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74170C77B7A for ; Tue, 30 May 2023 13:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232374AbjE3NLY (ORCPT ); Tue, 30 May 2023 09:11:24 -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> 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