Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2127204rwd; Fri, 19 May 2023 01:05:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pMifR98p0KG9feLl9T42mXmSm/Uv/Z9k2ZlWRjgHxS8cJ+HT/NX6diHxujKcfV5LhylSs X-Received: by 2002:a05:6a20:5b07:b0:107:35ed:2868 with SMTP id kl7-20020a056a205b0700b0010735ed2868mr1125714pzb.14.1684483529269; Fri, 19 May 2023 01:05:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684483529; cv=pass; d=google.com; s=arc-20160816; b=VJqjm4SH4445GoAGuFAXdZK4KLL/KrH19M9UzV5ID/7ADXLOkJ5t9mozANvYNe70FH 3Whwhq+XB9VgC4lCZHIyPoAMghk68jzCNjOsgd54OLtydcA1wiYjJbhRonNg30UqBGaU 5hPKz0eDt7tFhWE6MkBveS5ylnwGbkWgoGqWRLQx8lQPCHgq/SpbmWhgzU8AXsXEZDRF LK0/ElyKQnB87jkW9B10VT0qIw9NtbEVhpIVytuvnOBGW3YtlQREDNInCPrBHd0TFfz4 TY2M4qZhMifwpKidBXx15EHN+qlJVoR6BwcSpKWIdn33Hz3QLoFeRmAPHAFvHOwB979I RTkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P+78PRBA+UnUJhjaIA4ce5QY+7o099L6LnFA1vCDg1w=; b=ktK8O3BqZGrA7gMMRljvKNkcK/yIP74CsO/KBSzwviS38Psv0WY0kFwIMKy3jBAajD eNdRSXac8ti5oAkT3xdCUdKs22QArIqbG3S+JBYLIEGqS7zsHE75p5Z3CvM46YaKJrjg rPwHZomP0DT/KUIDk2lWozBw0VTbk1ECJzDoILCslhWGH+6sp6t4R0JfDIQHtWenb2wW /Y0Hi6n679apwq3QrZt2VRKB8toIu40+zLFM1JF8Rp+jZANCeZMAukWMvs+MI/F/tx/g D5XSenCvEUH3rNb6NBnWzf0ma07x9KnydH5cmZIdpo88AJiPkCPp6wr660S+qj2n0Pyp xjLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=H7GCJ89K; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); 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=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a63f20a000000b005139edd3958si3225201pgh.6.2023.05.19.01.05.13; Fri, 19 May 2023 01:05:29 -0700 (PDT) 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=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=H7GCJ89K; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.com); 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=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbjESIBr (ORCPT + 99 others); Fri, 19 May 2023 04:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbjESIBm (ORCPT ); Fri, 19 May 2023 04:01:42 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2096.outbound.protection.outlook.com [40.107.237.96]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929F91A5; Fri, 19 May 2023 01:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W3MqnAXq+NxC58L5MNQQGwWJhU5Chixbz+ChNEPGNHTtPESDgShcEx9tiW5Fl1eC+MNTgsteUPqBpFLa9wQtjJ5uO9hKReC0FBAFv9K2EWYyox+8ZQT8kC5qmyR9IK6/Z/1dorb0BKAEWz+OKRLlRfx2evLlwHF4WLzqftBLfjSFSf+ddUle1O3dLbWcCcY3zczygdO53qjoRnhzq0Zwi3FJ8D8Xs/Q1DOPBOl4fDuJDUmfwe/150ijIh3qBW9c+5y4+T8naizq9Jp3omLS6ImYhD8E0oAUN1lCS2J7JXzpmaZkTKCyc/WFogION7Irwav+kRmT5n+OC8DNy89n7ow== 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=P+78PRBA+UnUJhjaIA4ce5QY+7o099L6LnFA1vCDg1w=; b=bPb/fuDvNzzLASAlTpwenBFft+ggcHrPgsyLTXpYRE3Gfmcl6ser9tGjhiVe/smWFx5ahUeqEE7cWgw3W0rHQ9EBcDYLZKB8ZZVGQJnbZHDeOOBc2Q/1exy3qXnsGbGOommoril4otVHV89n7Kc78EQtc4+xn3y3hWEh9A9WvRbqV9WeCfTsbU2BRfE7OASn1U/ZflEp699iKea9neOgGhi3DEKbpmpFfICfUpmsUGw3Tmx3KZu/8PteERxPHej5hw3hYNPFRHwd3tTrFGaBzOC29gnmkbBOkaQqJgvd9HQfsjAS3xPfqytIy4p4nSJsLzoU/TBQWgIbns1F3j+wGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P+78PRBA+UnUJhjaIA4ce5QY+7o099L6LnFA1vCDg1w=; b=H7GCJ89KSLoNYGSjadCGunziSO4Wr9fLFi3HDcf08meyrqV1Y2CZwuykti1y96IFg2UMd+dvZKYzs3oGXCae7vedJHJKXUqVP9z0KLqAYagOWawCMlvza/szuKXjm5P4+soNtox43kcenBds9XW1hhHfOF0XuC5ypTX62HNoNQM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from BY3PR13MB4834.namprd13.prod.outlook.com (2603:10b6:a03:36b::10) by SA1PR13MB4992.namprd13.prod.outlook.com (2603:10b6:806:186::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 08:01:34 +0000 Received: from BY3PR13MB4834.namprd13.prod.outlook.com ([fe80::d98b:da1b:b1f0:d4d7]) by BY3PR13MB4834.namprd13.prod.outlook.com ([fe80::d98b:da1b:b1f0:d4d7%7]) with mapi id 15.20.6411.021; Fri, 19 May 2023 08:01:33 +0000 Date: Fri, 19 May 2023 10:01:26 +0200 From: Simon Horman To: Min-Hua Chen Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: stmmac: use le32_to_cpu for p->des0 and p->des1 Message-ID: References: <20230519002522.3648-1-minhuadotchen@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230519002522.3648-1-minhuadotchen@gmail.com> X-ClientProxiedBy: AM0PR02CA0012.eurprd02.prod.outlook.com (2603:10a6:208:3e::25) To BY3PR13MB4834.namprd13.prod.outlook.com (2603:10b6:a03:36b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY3PR13MB4834:EE_|SA1PR13MB4992:EE_ X-MS-Office365-Filtering-Correlation-Id: 18ec1bc8-a16b-4842-0c68-08db583f4314 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WmJYUxLSt7jREvckRo3GDsCB20E+p1PdBYQs+FNXZCoN3gQcI3BWLO38qtJNflJaQFd3FFPMRVzQkTGTCaFKn/q0SdtrRy45EcKXg/QZ4/nsxsRVaoUpj18gLSXjAj1M/0w9OtOPLGur0BTehIQ044Dv8lfdcSgruUuucMm32gFszjYwE/u9gQtOcb+vgQR2SN+ZdN6RRoRoJDyfcchDH2+Ne1JN++gwShPer9rusx6toS6CO1IsLErSvf1v22eZ+zWp8UsHTqN3puEGuuVQ9HVqe/P2LChL9shgIvMV9qE0Ax5sNgI5qpsBln6VUWx6GrIy65DPQnu7UmeoiH6Dzvo9u8q3kGc7akp42eDlOG9WNdNd32hYoPDXUmaRPGez3FLFMsctAe9hfSCukCTP+sYYPrh/S8MpwifagHDvjh38D/dcCJJPHs5l1I8dncdkJruVw0Ga76CKiTkFd/4T3uF4lbGOB+PqkXWRYPNxmG8tYv6eqBnV5kswD970RXwSwrVlgz9/zmZpPVtdeuIh9+RA72MQjSFtC0Y2tKzrGZQkxmhfT5nogeD6FI19QPDL6VAV14o3WXOBH6sbjP3+CZzkmFxKf9EhHcCrZn8Pt+M= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY3PR13MB4834.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(39830400003)(376002)(136003)(346002)(451199021)(4326008)(6916009)(66946007)(66556008)(66476007)(478600001)(54906003)(316002)(86362001)(36756003)(83380400001)(6512007)(6506007)(2616005)(186003)(41300700001)(5660300002)(8936002)(8676002)(7416002)(44832011)(2906002)(6486002)(6666004)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Lxk0+v2Yc81snj7iF+xDQl25NIeAHxhMEARwgeOlpbZ2+ExfMYOzjX9bHQka?= =?us-ascii?Q?3xWxePMPDPMMcTqOqus950tzVEEg2Ct512C1kcgIT+s6ks71N+doEDmN+xMu?= =?us-ascii?Q?RotjcLShcn2nC+WFfQpaOjytlzUubjHI5xYJ5DjAkcl1u54W2GJRKJwBTAAg?= =?us-ascii?Q?VTQI1Hfi3EHo3AT0jP0ut5oUNQB5o1W46dMIUcAnVMV6J1y8AFIrA+25wz//?= =?us-ascii?Q?wIa8NCxVingOOHgFl9vR5NUtdxOVpDY0apgNpd5/dZ9kWS4nvGT9z+4qONqx?= =?us-ascii?Q?RGlXIOsM6DZRbk7CK9EKUR+vf9e1auZMcpr3uV76d0GHAMFjzjhN1TBYS8IM?= =?us-ascii?Q?uzyl8XxgoZkrKf7kQSuKDTw2UQmuZbJH/T6NR8p7rBVWunqNFVA7QWI+iCqL?= =?us-ascii?Q?GnYcmTFZai9cbKEXPjCpEOityjn+yYU4NvNr6C6XP4h8w0cDIfeY3HEUgd9a?= =?us-ascii?Q?zXbEVRdyQkhFd9xpPH1dyz06Ra/2neTJDwJuNcxGGX/DnCbFfft9V0Flqbg6?= =?us-ascii?Q?JzTIuQH1hbD5C+KGvxCcw1+W2rbW3/BTz6HElmw7sbkyAHfQ4kvO8KWZIJwB?= =?us-ascii?Q?ANqqQE8rimmquRRQM8YQ4BfquDBlliI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pBYBnna/F+vPGWsQQVfgYkKVYySMpwrmAjZw7ZU7BzjYYemnO46gDLsJcGY?= =?us-ascii?Q?uJsZSH8avFnbjpkQqAQyWcM+t2+b7i0kHJFPRWFH47X4SIWv2bQYj0U3vS1V?= =?us-ascii?Q?eWELSqkEaiwejG9HDU+Nkbhb0QQtB8YTwz7asgdxVBGs1iOygsfo7eWYfBvI?= =?us-ascii?Q?W/MSXg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18ec1bc8-a16b-4842-0c68-08db583f4314 X-MS-Exchange-CrossTenant-AuthSource: BY3PR13MB4834.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 08:01:33.8810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CPFZ1lFEewz1zvi56Mk1YQq5k+ZC0MdmYq/cthX6wZShwfLkD2NWiUTim+Bfg6kDaWXPwnt1IG3MAtd3MiurknpYAk8sMFptexqnDeYVYp8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR13MB4992 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Fri, May 19, 2023 at 08:25:21AM +0800, Min-Hua Chen wrote: > Use le32_to_cpu for p->des0 and p->des1 to fix the > following sparse warnings: > > drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c:110:23: sparse: warning: restricted __le32 degrades to integer > drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c:110:50: sparse: warning: restricted __le32 degrades to integer > > Signed-off-by: Min-Hua Chen > --- > drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c > index 13c347ee8be9..3d094d83e975 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c > @@ -107,7 +107,8 @@ static int dwxgmac2_rx_check_timestamp(void *desc) > ts_valid = !(rdes3 & XGMAC_RDES3_TSD) && (rdes3 & XGMAC_RDES3_TSA); > > if (likely(desc_valid && ts_valid)) { > - if ((p->des0 == 0xffffffff) && (p->des1 == 0xffffffff)) > + if ((le32_to_cpu(p->des0) == 0xffffffff) && > + (le32_to_cpu(p->des1) == 0xffffffff)) Hi Min-Hua Chen, I'm not sure if it makes a meaningful difference in practice - and certainly it won't on LE systems. But I wonder if it's nicer to do the conversion on the constant rather than the variable part of the comparison. if ((p->des0 == cpu_to_le32(0xffffffff)) && (p->des1 == cpu_to_le32(0xffffffff))) > return -EINVAL; > return 0; > } > -- > 2.34.1 > >