From patchwork Mon Apr 3 10:52:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13198020 X-Patchwork-Delegate: dsahern@gmail.com 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 E6B9DC761A6 for ; Mon, 3 Apr 2023 10:53:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231998AbjDCKxY (ORCPT ); Mon, 3 Apr 2023 06:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231918AbjDCKxR (ORCPT ); Mon, 3 Apr 2023 06:53:17 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2060.outbound.protection.outlook.com [40.107.22.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AED1711E80 for ; Mon, 3 Apr 2023 03:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kJFbUgbEolsBjX+yzpq3jsCfv14ivZGgWcutyXBFUYbt7O74EnVyx+Bo4diOvbL4xsP/q1MmNng3VY5Hmiqertd84zkxTUINPWi2bilWoLdfWTTOG7Y8LtWuf3M4T9vFQ3PcLLLnF8JRFsIl124ScJmmIJnZ3VLOot4Lz1s7jTl9YaH4lSisheMJMeNPFcSzg7zfeHcOclbB/HLNm5HFT45jlWyZMFNnadOKk2lyrSArwDVrpvWK7rm5GwkM1kCKNB8ZrpVZlDUyCotXbWXRY3x0kdgB5UZX7l/L+GJYxMFQ+YKBN5x2I880kSyBopfENVIed8WLnJl0YdxA+2zkpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=znKIrnQN1WZHub+seDYhYl1zpdGk2QQamJr5UkNYT0g=; b=MGr38/upMSVfN91oEb2r+2AZVKlOmSJD/pJRtwvolaUiVK4afEY6sLExOQDHqH7kMSawfBnKWIh44DTu6mcJypdyhsOLsp4Unnlzn1ueOWGLACdCIt+DaNxq6b0QZk3IW+OaHAAClPP1UZ1ztBNNKJ69+6dKrzPFVyOTtsviOTyWvFd+l7g2AZBvn9WzuahYoXoYx2gB0tGVtCF8WpR21nu9NHB+u/myZLEQKtFUgB6I2vmzWAFH2mGhDj0Nv170RNeEZDY3cDbRce3PRXMPQZbOM4BRLhcV2DJ18MwdOx0Yfy3hUocXti5+t2zMTwpgWNjDpgLPIuPrT57mFbOSGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=znKIrnQN1WZHub+seDYhYl1zpdGk2QQamJr5UkNYT0g=; b=DigGmspdc4HqUZZQSkNB7oR+qi3wt0HsGeIjaDs9xTjR02r18Z5UqPrW4HTDCTc9LcMOw+L0CjUUfnKk5cXGNqh8P19q4CI7mIQZxZBJe/OemUwWdVHE8OXO1l9YEPF3vjJ3UNqaGFn3Yg18H6ZAvDhSbBbk9PR6j7jVF76RbRM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by DB9PR04MB8479.eurprd04.prod.outlook.com (2603:10a6:10:2c5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Mon, 3 Apr 2023 10:53:04 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dfa2:5d65:fad:a2a5]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::dfa2:5d65:fad:a2a5%3]) with mapi id 15.20.6254.026; Mon, 3 Apr 2023 10:53:04 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: David Ahern , Stephen Hemminger Subject: [PATCH iproute2-next 2/9] utils: add max() definition Date: Mon, 3 Apr 2023 13:52:38 +0300 Message-Id: <20230403105245.2902376-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230403105245.2902376-1-vladimir.oltean@nxp.com> References: <20230403105245.2902376-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: FRYP281CA0006.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::16) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DB9PR04MB8479:EE_ X-MS-Office365-Filtering-Correlation-Id: 640f5a6c-08d4-4910-9ed9-08db343199bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aNKuRrwtItpGnMh8XaknCbfg1WLXfrJ3FIqLH38T3owKgwbEyQ3FwVVVn3s2Z1fsPI3noRkbAPfxxhxJvqkgQT3VqXhijtUfyJrQEfOZm80Ydosj6IosGjBq206C+TAXTMH3Av0WQPOisKFPn968YjpL/Sgry/ld4zCE7dB9I5wl+Kbkwoknl6mUMIqnoa0X1XNK517dnSOVm/lrcmf5QWcSNUbjKrEENmcAZsszbxhLIrh+EDo4qPYReZtH0HrFkDHdWG4sLss+A/mVzsb6E4yWY2ITo3FpTCfKkLycBsbWgapolWWSX+ZXUN+GQHRKG3vOoWgZNT1CMLMBI4jeXLBQ8MWxG1KCv0SeJQQPqrnzGXL3CXFfZ8SBFZQEyS6jW31MKjrVZwr26uYuFWsBsi5u0QHHXdABW6Hm878OoMHM7YGUOwxK8mNnAp0+VCe+jG7AkoWgGUVNeiz4sE+tXqbKy0SO9e5IAv4CJdmHYBmuwxsXPEDgRWrwZ6FVSGIuspxOLcNkM8p6ZVSYTqn7Y5dwfxAjhwlmeoMTnvHNRZuM6VSng7LdlSG7W9K8H4NchzdXApBTjoaBrFenvc1LGMm6zVjETbFt32P14gRVAIeFN0TXCCZKJhYFDXqfKlOi X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(39860400002)(376002)(346002)(366004)(451199021)(8676002)(6916009)(66556008)(66476007)(66946007)(54906003)(316002)(478600001)(4744005)(8936002)(44832011)(41300700001)(5660300002)(38100700002)(38350700002)(4326008)(186003)(2616005)(52116002)(6486002)(6666004)(1076003)(26005)(6506007)(6512007)(86362001)(36756003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aOWvkO8KRio0KCDC/BqEZdU0S8ICs4uB23ZVDMFDn3MjaX4yRryE5g3nDouH+cIVXVbuII9wrBFAKA2ZweMQ1ze09+OHJgBP50cSSPCmR6zaCtb4GDJtCUi2BlrL8CCti8EL3rydb23fMrHvx7s9DAwMeiQaBtPK9SW9X25ovZx2NCpIng5Xp1Sa51HW9K8Mc2tMrQmvhTmnYWFtDwBWkYeffb9CYuXHkl4e+jIueT21qrVdCJIYnYpJES7DqZCcgPBE4M3fhZxqtsxr901r4juUs45tIFjVRRaJO9Xtvzdzl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Vy+K+EZiy8Qxnrp8ywcAMM4HcxMDl3pzjWTtlZTkSd/6ztc1PTl4CPsRiY7RacSDfCE7N+RQJQFMnmpbTGvbt2puUmtkdxa+yZiCckuikAoZ3WrXpYFAMm5ZfACUDOfATB6LZS+2CbPNoQHpsJG9TyzLUp5FbcOYO0WDg7XKXolfHSMv/Y5qrkx66+fy6vEzfkUPJC9mK13ztBwSh18FoVrnSK1cv7MoA2GFLZg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 640f5a6c-08d4-4910-9ed9-08db343199bd X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2023 10:53:04.2301 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lXYgfXag7pVv1K0FYdGM8Fdps05lV8fmq7YaXsB5bOecA9Y8ewJFddb9RsTdiOXWXSUKWyjjUEDbhgLmfI/kCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8479 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com There is already a min() definition, add this below it. Signed-off-by: Vladimir Oltean --- include/utils.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/utils.h b/include/utils.h index 2eb80b3e487c..0f1b3bef34d8 100644 --- a/include/utils.h +++ b/include/utils.h @@ -284,6 +284,14 @@ unsigned int print_name_and_link(const char *fmt, _min1 < _min2 ? _min1 : _min2; }) #endif +#ifndef max +# define max(x, y) ({ \ + typeof(x) _max1 = (x); \ + typeof(y) _max2 = (y); \ + (void) (&_max1 == &_max2); \ + _max1 < _max2 ? _max2 : _max1; }) +#endif + #ifndef __check_format_string # define __check_format_string(pos_str, pos_args) \ __attribute__ ((format (printf, (pos_str), (pos_args))))