Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2249544pxp; Mon, 21 Mar 2022 14:59:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzETcZ2wVQIrv9eKG45In9R06WzpK1bugrP0IdJDiQA/pMUoxyRyyuyMtFmMFeYRFMmIoAp X-Received: by 2002:a17:90b:4a07:b0:1bf:a189:1524 with SMTP id kk7-20020a17090b4a0700b001bfa1891524mr1310559pjb.230.1647899949020; Mon, 21 Mar 2022 14:59:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1647899949; cv=pass; d=google.com; s=arc-20160816; b=P1bcsfndvLh3qMoz3jVUwi+lMBkIE4E6s1ruXav1OulXyRul3SNvIC5cfNcBeBPCv7 YUVcvGU3HvArjN0DuZLvqBDtL76Wxd25F4HcjLn8ElNRQCmTc1/FlA5sQv+wPZL3KLwE Cmb12Hp8aVJzlf6iozFygbl8lrZ+lsXEEB2Yg7wai1MBTD8mwXtiqnl3e9M9kWopKyU2 RICNbOZqHYqtXSFoKyhGHpz18bjUH8zjfC/V8oz7wi1NK+4EN5lOy+JuFsSxIKhqOvVl FWuiyKziv3Dt/TerxYfaaDXPKph2HzqjCzuxyHPxgNrLxqx3aQ1+MLsh/jtkxaVKoqMw qXlg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=raIMv+jYAUYeAwZAsAfcnEEdMohFzYBNJB1JN8vdqJE=; b=f0g8PyVlKl5qy0C6VRFpMuDNh0mw4CTzc3QOGmIJ9LrM6dJip1ZWvpp+wV2xqq5hD5 T1S/V1svrpw7vCn9ot1vzt9m/cCfOpeKGrlObT55bwesxYAEO1ywD1pycE5FiDcNePYW x2W1F7WJogxJXe0Jd5MPE4ObGcX/aVh2PisYG34GJ4Kn81B8ctDWy6A/8pA90JbMplIU V2NFJAkWq04aZSAxOJrxR15RQG1ddp/pNRW0MNen+evxwFHkZg/3D/DUyVxQdNnsRGMo aPusqmPh2w81Bdv9tD7/vYD79l9cxMLIYCM4n+1s/wAm9EGq8A3JTPDnWh4/WMptE20V l9Tw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=B3CGwk1t; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id b10-20020a170902d88a00b00153b2d164dfsi12206394plz.231.2022.03.21.14.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:59:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=B3CGwk1t; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 89F4C74B15; Mon, 21 Mar 2022 14:24:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351345AbiCUOK4 (ORCPT + 99 others); Mon, 21 Mar 2022 10:10:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349145AbiCUODX (ORCPT ); Mon, 21 Mar 2022 10:03:23 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2135.outbound.protection.outlook.com [40.107.117.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65770175386; Mon, 21 Mar 2022 07:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JWKz1ix3e6CXPnj7SuGMaPuioX85bqygRbGwjVlruINvQqOO+pFm4uuZQpfsLsHCD+k9a2zxQkqlE0FlLakhGBssvsGw57L4xAWYrS3RUuCnH6rKxQWStStBS+Y3q6ibj6/kl8xrh3MJ/w0oPhqBgdk87kaauDlvbUrsjEyEewC6ne8cdg++X4la0v4dh15wqA4cSn0HihWvAPMGJZs/EfZ9N7MrfKUEjVT35CPlHjI8iJ2tHVMc6ZQQAtiNjTjPZDRKD1VrFxLNHjLzvSi6+2MVvXgFeJwuYWLkEe6DQ3H5y1LBkCk+/pcFh+U1sxmHvgMm+mAzNg04kUU1fSwNGQ== 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=raIMv+jYAUYeAwZAsAfcnEEdMohFzYBNJB1JN8vdqJE=; b=jYSjweGbZ1y3MxnDAnBftjtX1cNqfOzlzbxUOhIGbwi5hczXkE2nXIcpJMCuIC8ANT4fAG0WiLe/KcCodkKFxKFxFuHgARkg3PC4nuWhu9sXvU/M+gXx/zZDKyyGH9EZQNaNUaebqqe5MoXzqrHgHXBAi9mHXs4lP6fO4UvQGRJlxxjPVFERVrTq5TFM4GUGpkQLUm4Be9nhh8r7HL0XouleyzqKl59Ov2xqSIiMFTWH7DDNo/T7/NarjuYRVMEgn24/0m90KWLJwmXHeI6AJIadaR99g2CCtcIPYI+0cbBHM5jnM2z1HcItjRBuZwp0lkQFHm5oy/O6IUwDuW0Lcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=raIMv+jYAUYeAwZAsAfcnEEdMohFzYBNJB1JN8vdqJE=; b=B3CGwk1tFX4dELmCGZOM4l3UZ8HrMeZoPFArGC4HXImjf0M0zbPtCVTWr2ZUFdXbsoz/VFmSkRWjsvxQ7+v7n486IcFFpF55HKQHNbd5GiwZGDqBKhmpS0DimSfavByH6pCK3LUUQe7nXup0TFVzuvT6JQLPPkrpvXY8UTo4HdQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB3367.apcprd06.prod.outlook.com (2603:1096:4:78::19) by TY2PR06MB3469.apcprd06.prod.outlook.com (2603:1096:404:ff::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.17; Mon, 21 Mar 2022 14:00:07 +0000 Received: from SG2PR06MB3367.apcprd06.prod.outlook.com ([fe80::9d3f:ff3b:1948:d732]) by SG2PR06MB3367.apcprd06.prod.outlook.com ([fe80::9d3f:ff3b:1948:d732%4]) with mapi id 15.20.5081.017; Mon, 21 Mar 2022 14:00:07 +0000 From: Wan Jiabing To: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: alexandr.lobakin@intel.com, Wan Jiabing Subject: [PATCH v2] ice: use min_t() to make code cleaner in ice_gnss Date: Mon, 21 Mar 2022 21:59:47 +0800 Message-Id: <20220321135947.378250-1-wanjiabing@vivo.com> X-Mailer: git-send-email 2.35.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: HK2P15301CA0005.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::15) To SG2PR06MB3367.apcprd06.prod.outlook.com (2603:1096:4:78::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 101997a1-7d9a-4dd3-10d3-08da0b431a5a X-MS-TrafficTypeDiagnostic: TY2PR06MB3469:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wAP/pZCxM01cEEtGlwN9AD4Cja6+arDYAoZ1LXKO2EW/iZVVsMdlymb+a2Tu/YT9U6Npl3Ho7Esp4Ty7TiejGmzPxXrwGv0kf05tiFsgIROlkBumw33DYUJa7xH8def7dOCIjD8+1SEgv4wyxwfZ8N9iZqBElRJbmxolXlI2POoSi7v738I/XllXV+ol91elkUELBA9psghFvaiWcmUNRa7CIR8EBKU2tmKuoJjXH2dxWk3c2ayZnjY6tDxXpxusYFfiJg4wk27cwiLk7QSh/lys1p7yDOFUrXPfhnOdu34/XCpFQaRSr9NAOyOOiaF5u0oDgMIsTp3OVMOnJ25vrRcy0bRb3r9SOx5J3d9Y2rkPSNPUJcUuySbmg1wmWQo4zFh+vT23EGQNmgNidhbEZ/iWk70llya5xISsfQegN/iM3kQZd54TyEqZ/WI8UWlfYo0MDNB0jVex1K0j2OFKWRbfa8vKXxXNWuYDeboi4/mXUaUlCUn3ctypxN0w6WMXFFF9fv1+gJYKcfrfpTOWQtPiqc1q9135xR6y+pFjINTeIlpZXVGWPwYvscDRh5eNnmPvbLfn8PrMNcAxu2D1zpc9X4Hd+ef/w7eUeZDc/rtGSqClWIZLiCUcwxBVcPAGWWOGPKI7UiRATWe7eOpL4ueAAi8utHD5CgeAkANqMxotqfjXack4+P/xerP66qgkTJjPRq63PXrnLfek3mggng== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR06MB3367.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8936002)(4744005)(5660300002)(38100700002)(38350700002)(52116002)(2616005)(107886003)(6506007)(1076003)(6512007)(186003)(36756003)(26005)(6666004)(508600001)(6486002)(2906002)(66476007)(8676002)(4326008)(86362001)(316002)(110136005)(83380400001)(66556008)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HkLiA3qfNxPd1MiWtYfiuTvBKmpnHEjvpi87Vj2EwgyGrAv8TlBR6VfZw+N9?= =?us-ascii?Q?GpNJV4ZZPT7ctbrLqBse5HZt2Z3tagK7P8KKQLHLUjB3Cbtiq7q8t1g3LwHq?= =?us-ascii?Q?+0PO/Hx7D85UWpb6fUkHad+lkQ8rxmIoGvwiQy8NZj6N2tXGEerF96omFSgd?= =?us-ascii?Q?hQEKilgS8mZ6BUaBAOsmyViPLlx6qIBT8ygZp24rJGAAHGC+z3pX67VnrbaT?= =?us-ascii?Q?54ZBZaDGvQHs2t+gb/KjOX8HT0VRPYDrKCtS7sHnpGFH/Sknuiqwl16muJjI?= =?us-ascii?Q?aQ/iAuUpee1MB9Gj5+olNRnDqkjPMibRnfKdv1i71XluLElfYFQBQOGiOrcP?= =?us-ascii?Q?k19rXyCFEU8YiLXwU4zTsuczGc/rMpG1p7MruDnetLclo6M/9wTBrsq3qDUs?=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ifD4BWmNy+1noV3ZDyjg03jho?= =?us-ascii?Q?7xWQ+PqoJErdAg79hQS4xUDstWBhEQKz6zR/FMmUQgVVr04MmUDWtVO1q3qX?= =?us-ascii?Q?QYGApRWwpGBIniPEOK/kzEaZNRB2dHtC8gJE+LSCVFQn0LUUcq0dioCGkfWc?= =?us-ascii?Q?NEsfQPHr7PVyLL1wADvNfigan3h0Hkw8?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 101997a1-7d9a-4dd3-10d3-08da0b431a5a X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB3367.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2022 14:00:06.9482 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hopYejgsW4P+fycC9kq1IRHSg/ozYnyb9t6gSPQeqLuKMLiOnEOM0dRsD6Hf8mxu/GFpO71P/d4zB7a4qxORWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY2PR06MB3469 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fix the following coccicheck warning: ./drivers/net/ethernet/intel/ice/ice_gnss.c:79:26-27: WARNING opportunity for min() Signed-off-by: Wan Jiabing --- Changelog: v2: - Use typeof(bytes_left) instead of u8. --- drivers/net/ethernet/intel/ice/ice_gnss.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_gnss.c b/drivers/net/ethernet/intel/ice/ice_gnss.c index 35579cf4283f..57586a2e6dec 100644 --- a/drivers/net/ethernet/intel/ice/ice_gnss.c +++ b/drivers/net/ethernet/intel/ice/ice_gnss.c @@ -76,8 +76,7 @@ static void ice_gnss_read(struct kthread_work *work) for (i = 0; i < data_len; i += bytes_read) { u16 bytes_left = data_len - i; - bytes_read = bytes_left < ICE_MAX_I2C_DATA_SIZE ? bytes_left : - ICE_MAX_I2C_DATA_SIZE; + bytes_read = min_t(typeof(bytes_left), bytes_left, ICE_MAX_I2C_DATA_SIZE); err = ice_aq_read_i2c(hw, link_topo, ICE_GNSS_UBX_I2C_BUS_ADDR, cpu_to_le16(ICE_GNSS_UBX_EMPTY_DATA), -- 2.35.1