Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755528AbdC1OR3 convert rfc822-to-8bit (ORCPT ); Tue, 28 Mar 2017 10:17:29 -0400 Received: from smtp-out4.electric.net ([192.162.216.184]:56359 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752531AbdC1OPV (ORCPT ); Tue, 28 Mar 2017 10:15:21 -0400 From: David Laight To: "'simran singhal'" , "pablo@netfilter.org" CC: "outreachy-kernel@googlegroups.com" , Jozsef Kadlecsik , "David S. Miller" , "netfilter-devel@vger.kernel.org" , "coreteam@netfilter.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] netfilter: ipset: Use max macro instead of ternary operator Thread-Topic: [PATCH] netfilter: ipset: Use max macro instead of ternary operator Thread-Index: AQHSp8hVLjkQV5X/tE2PuaUulgoI/6GqSuoQ Date: Tue, 28 Mar 2017 14:13:03 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFC0145@AcuExch.aculab.com> References: <20170328133256.GA24590@singhal-Inspiron-5558> In-Reply-To: <20170328133256.GA24590@singhal-Inspiron-5558> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 374 Lines: 14 From: simran singhal > Sent: 28 March 2017 14:33 > This patch replaces ternary operator with macro max as it shorter and > thus increases code readability. Macro max return the maximum of the two > compared values. ... > /* Convert error codes to nomatch */ > - return (ret < 0 ? 0 : ret); > + return max(0, ret); It might be shorter but it isn't more readable. David