Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2057067rwb; Mon, 7 Nov 2022 08:40:03 -0800 (PST) X-Google-Smtp-Source: AMsMyM411t+aEU16Bce5AKr3rnZuSUxmgMIho9iaMK0Mi20eWrzWo3NI4oERHO8DTKxd39ZczRz1 X-Received: by 2002:a05:6a00:16c8:b0:53b:3b9f:7283 with SMTP id l8-20020a056a0016c800b0053b3b9f7283mr51137439pfc.46.1667839203485; Mon, 07 Nov 2022 08:40:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667839203; cv=none; d=google.com; s=arc-20160816; b=WOZH6TVtpjxmV4X83TuszZd5LYn+U3/3bBlfX4yDJrAXGNWRY311WAGuSqV+ueVCww fthXW0wxrs8/abv9kaEnEb/8xt4yFr9BIoKsPuXCyfMVIXU2YFYV3ZaYLf87aC/S4ykl RRwA8OR1ampW+gAIZ6jkHxaOqTTW0tJULwuvwh5YpW8+jrgt9bEzbSkesQkuo8WYD/RR Eg0a2HrKnHMiH6+Tr8ISUlC8JEmgNK1KboG74xprcEvHdJ+8rg4VsSt6gWCDZ6EDwW+M z4DrrWGsnX+NxIRABAxzGl2hQpKpozTBx+x9XvcSft8TGJA7hV5L0Dh0PqekeRzQyl6U b8/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=Op9wQUamKoOq0nmL+y2FU+gxqZ3eN4PwFpxoPdRN1Lc=; b=MRHWx6wDQY+6Kva1HzSctez6nkzgSDpoaLeyMg5vNbNJtZelnGoCMx2yHg6sJ3GL49 oqbW7khSm84aZcsHdlecRL199fFJqPdvFAwLu9w4jqKcx17kLj2K+YLAQnyxYywGz56D 9ZAM5+cGI2IT7Uvt9f+n0zX4J8XK2bbkJF+813HZbTr41z1blGXonfXlPCUb/AMMpwi/ 1Huxv8o3M+bGgafFIPYTj1btYoNUNZtfyQuqM6NTuwwHfH2bHZl3IIyYMtmsaIYxx7LF oqH/BXU6+sLYL4x/nGcxczC5gGQdO7fsIOGaUbFWtvyUKQ6MI4UJbag2PmeifVVjzIFw gcew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Ad6bDeeR; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a631d09000000b0044fb27b64c7si10364535pgd.326.2022.11.07.08.39.51; Mon, 07 Nov 2022 08:40:03 -0800 (PST) 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=fail header.i=@mailo.com header.s=mailo header.b=Ad6bDeeR; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231635AbiKGQaL (ORCPT + 93 others); Mon, 7 Nov 2022 11:30:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231786AbiKGQ3g (ORCPT ); Mon, 7 Nov 2022 11:29:36 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CFA4233B5; Mon, 7 Nov 2022 08:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1667838451; bh=Mg3Id1/fkypwOfC8wSYIW3Daq138C5v1hZ6ElXptx3w=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=Ad6bDeeRL6UDBnT2widUFcAT8BUumtDjzMOfhEfKqCGnyRWfm4VStTPzWW3SMObHg Ur2sqDex2qZLMoGADvy0GyJxqhiWzio1YrPuHqTzHgTcjTqv5384orlZLPhvSgiZPa HFMoRX3xrdx0HEyA71+gsplF6ix/57i2ayDi4R6U= Received: by b-2.in.mailobj.net [192.168.90.12] with ESMTP via ip-206.mailobj.net [213.182.55.206] Mon, 7 Nov 2022 17:27:26 +0100 (CET) X-EA-Auth: iW97wWXq7wu86/I281m0xgHIxJjEWPKb6RpDVe9GmtL39NqzPnDHdijSL/LFBCfxpHq/8ZVf676fiuiEBW1lz9iA0X4yNR8N Date: Mon, 7 Nov 2022 21:57:21 +0530 From: Deepak R Varma To: Dan Carpenter Cc: Joe Perches , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Greg Kroah-Hartman , linux-iio@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: iio: meter: use min() for comparison and assignment Message-ID: References: <41a43f3865f3c86c6c2d1fbf3d82c42b685c7041.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_NONE,SPF_PASS 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, Nov 07, 2022 at 06:38:35PM +0300, Dan Carpenter wrote: > On Mon, Nov 07, 2022 at 07:22:24AM -0800, Joe Perches wrote: > > > In terms of run time, this patch is fine but in terms of reading the > > > code using min() makes it less readable. > > > > It's not a runtime question, either should compile to the same object > > code. It's definitely a readabiity and standardization issue. > > > > In this case, IMO it'd be better to use the much more common > > > > if (ret < 0) > > return ret; > > > > return 0; > > I also prefer this format. > > But at the same time, I can't advise Deepak to go around changing > existing code where the author like ternaries. Thank you Joe, Dan. Just to conclude, I will leave the line untouched as it is no big advantage and the current format is more readable. ./drv > > regards, > dan carpenter >