Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2361546rwd; Fri, 19 May 2023 04:55:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6uDmb0M0RmvsrFkSCQ65S8daomsCcurN3ossDz+LKf8BEt6VjI+xSGxatdI4HSw91MMbfk X-Received: by 2002:a05:6a00:1505:b0:63b:4313:f8c4 with SMTP id q5-20020a056a00150500b0063b4313f8c4mr3210145pfu.9.1684497344211; Fri, 19 May 2023 04:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684497344; cv=none; d=google.com; s=arc-20160816; b=lPWb6s0G6Reelmk4wvcVNVglGji1oPdCM9AMl/AWeHKId0FcyUWgvw1KIWdna+su+A /QeXnzkHFR882AyHefaqdIs6nWEKnPK+JSjtq0T+3n9lirR0ajy5xhZNHWFJCTIrAXBS n8vhXKjoCulmomy1NZiez4Yambmy3geu8DTyhds5RCDRkeJC8OY6ifYtePsABSUvQPF1 /F1mvTzVbvBrGPXqFW58/iPOPcz4s328RQ0T99pFdp/ibCu2paxPhlYjepq4CfVUwpgW lWwi3KofLl+IRaLj0kgNT1KFyLCFXTsJeZR9/IfOEK+zezpMK3OKPp3cT/nr9Jijhqqe BvGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jSGGoVzH3JswzdDl5XE4PxxK2PV3ZgCuC8Lu9xCFt+I=; b=jVve1H/huCcffWwZVXfDo9Fmhv5EZEkSucUORoF2eF3S0RCHeYGEpL8TUPwk9bGK4O m0DPmri5Q2IhwBgCIJIC3dCaZpP9fzmghFFHxP9qxnJSJ/Ko5LyNJr0Hb48nOw+3s/ij qV8YKcm2yqlNbnikbVepi0CvzFuCH48Jgv1eZJXADizd2q5IWBZ95eH6SccbgcGwiJDQ SPDpkBdugFqqymEbD5Zzd00Ghz8AT5F/EqAN9e+rLlto00+TEDVoiogcYlcCLsblGmB8 BMt/AgK837VbK9o8gxPJNX0lvQw+frHMPRAwpOj/66jY6Zc81tPTq+4tM/7+HD0QCOx2 1K/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=hG5hfdst; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020aa796a4000000b006436b625317si2112520pfk.122.2023.05.19.04.55.29; Fri, 19 May 2023 04:55:44 -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=@gmail.com header.s=20221208 header.b=hG5hfdst; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231337AbjESLq7 (ORCPT + 99 others); Fri, 19 May 2023 07:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230395AbjESLq6 (ORCPT ); Fri, 19 May 2023 07:46:58 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB3AE7; Fri, 19 May 2023 04:46:57 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2536e522e47so1269731a91.1; Fri, 19 May 2023 04:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684496817; x=1687088817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jSGGoVzH3JswzdDl5XE4PxxK2PV3ZgCuC8Lu9xCFt+I=; b=hG5hfdsttvTBHK/1SPB5ySPawmWk7IwRjf93Cbet3kH5Z/w+IcDTEOWBw/1oGK8Cpm +F9C/6fC9arjQy62Bk/M9dvXe5qhPLqj+DDlEf8XQ5Ym73dvErhgeX6NjbJCcvcctM/j YQIr0zh+ssZoGSeSLgUHDPonGzRc+j25MXUh+hh5LHgTzH/Jo70gEdx2/K2ub7jcufEZ IYyuz94mJBfnPTorzx+BZrAtO2hmyZzIuY35md5jgZyvQvYVIqW17Y9nolpesMbkJ5fp M4TNEVNiXb5B2a75L2UqWaVYuRZR6xI8nzoET02YHAlECrFb3lTk9Z1Sw6hZ2iYxj9/i QV0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684496817; x=1687088817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jSGGoVzH3JswzdDl5XE4PxxK2PV3ZgCuC8Lu9xCFt+I=; b=Iiwq0AZauzlYvNwurWUxNC0vKKVCKbl7MabAHqISrNpUuxEgvf3ZjsS0bVcCcorx3o 9vuEViANfBdSO1E29xjIZvzj0SjUWBSyBJCjP+KAma4UcNtAjELxMckZOw+JP53OHCgx sOxBnvXGhvIG8s9jqqcPO0aurEUkqZJXcWl4SFJMLMK5TC0Xuc/nezXYMjQEkl8TR0HO KKM4+HYvhMuZIHT4TfyeKn6egHJanlaPkcVnAVCSo+WSRZxZLraxEelsaRoQDHBRXPoV duO4wtOSWz3Im1jNKKUO0gtkxupeXcBlBZGpDktPIC7wiyrUbaGeJu04dZuFzEGwNft4 4Qqw== X-Gm-Message-State: AC+VfDzuf7dI4gQsRVLpbTa4vmJNkR0Kzv+4xVnrslwqJmI52q3P1nsi jFuUVxpoQ+RURZheLnNwnOiqroVDfbl78Q== X-Received: by 2002:a17:902:da90:b0:1ad:d500:19ce with SMTP id j16-20020a170902da9000b001add50019cemr2006451plx.41.1684496817179; Fri, 19 May 2023 04:46:57 -0700 (PDT) Received: from ubuntu777.domain.name (36-228-97-28.dynamic-ip.hinet.net. [36.228.97.28]) by smtp.gmail.com with ESMTPSA id jb15-20020a170903258f00b001ae626d051bsm3268919plb.70.2023.05.19.04.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:46:56 -0700 (PDT) From: Min-Hua Chen To: simon.horman@corigine.com Cc: alexandre.torgue@foss.st.com, davem@davemloft.net, edumazet@google.com, joabreu@synopsys.com, kuba@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, mcoquelin.stm32@gmail.com, minhuadotchen@gmail.com, netdev@vger.kernel.org, pabeni@redhat.com, peppe.cavallaro@st.com Subject: Re: [PATCH v2] net: stmmac: compare p->des0 and p->des1 with __le32 Date: Fri, 19 May 2023 19:46:52 +0800 Message-Id: <20230519114652.70372-1-minhuadotchen@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 07:25:08PM +0800, Min-Hua Chen wrote: >> Use cpu_to_le32 to convert the constants to __le32 type >> before comparing them with p->des0 and p->des1 (they are __le32 type) >> and to fix 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 > >Reviewed-by: Simon Horman > >> --- >> 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..eefbeea04964 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 ((p->des0 == cpu_to_le32(0xffffffff)) && >> + (p->des1 == cpu_to_le32(0xffffffff))) > >nit: Sorry for not noticing this in v1. > There are unnecessary parentheses (both before and after this change). > Thanks, I noticed this before submitting v2 (by checkpath.pl) but I keep the original parentheses. I will do v3 with your Reviewed-by tag. :-) thanks, Min-Hua