Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2346317rwd; Fri, 19 May 2023 04:40:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5eds7jqb0Iti92bxv4/N966f/tiTVBjSS6MgTyoh6gN0w65cUedtJVHUbhGA0t98OCa7mX X-Received: by 2002:a05:6a21:3387:b0:100:aa15:f425 with SMTP id yy7-20020a056a21338700b00100aa15f425mr2120561pzb.20.1684496458425; Fri, 19 May 2023 04:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684496458; cv=none; d=google.com; s=arc-20160816; b=Mdijj7lCN3U3nA0CJ9308ieBLGY6mDfIygu+Jz22fVU963VnlrLjYXP35xedov4/A3 6nqAmArnsULCuAzcxc41uBEioSO07WO1O4E9ZPaBRbO6XYp2wbTmaDzsrpVnUF+3Ysrn 3JzwoO9W00FsgGRkuoU/02i+Cy1++VYHG20MOGuclxFE+XghRhkCf+9Faw/Wwhxzr+FZ SzvFPJ+mgwajG0oWpWul25at+YUBUzWDvmi2wQiiRm+89UItS7QfMw9V0HlgIhcNsGjB pdpD4wepC0UD+j/Al6Dqygul9nsoG4qc6ZlVKmaDXCuRSsmyvEGK6s/gJNeenTaYoP9q 7L2g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=6BlLLSb4t/MYbESNdbnlmX8aWP0pTO6ZrGYiXtEq3JU=; b=JCysA/rHT9j0wwdRAS5oErcjMABW6Sau22DxVzV3gKh68Mpi5CRDs8QACp8buMA59k cZUX/p79+td45MEo+GP1W+fTM5ACgPEN8tXYRTZDsLtGxwqKPLv9Ac8ome3JtBxR1+2L qfZojchTy4e7PWwskEX7P6pQFeYg1RYqZNRPYNwZBVEiW6GwJASybpwqu4qGBlF1Hd6W uOHH3Md7OZqDtoPtL4JvCCRRGs20QPoTsW6tsyoKgsdNDEOF6sbDud4jYH0wFCL9cz9C y4gtS3ZRf61YEGiokWFr7AqZwg7TfF3Lr7IKlDuMudW2U96c0Zowrs+7skc/5iP4wPLE /5HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=AdTJK5Yy; 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 l27-20020a63701b000000b0053079f84a1esi3631219pgc.743.2023.05.19.04.40.45; Fri, 19 May 2023 04:40:58 -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=AdTJK5Yy; 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 S231572AbjESLZV (ORCPT + 99 others); Fri, 19 May 2023 07:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231739AbjESLZR (ORCPT ); Fri, 19 May 2023 07:25:17 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03B9910C6; Fri, 19 May 2023 04:25:15 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1ae3ed1b0d6so22939965ad.3; Fri, 19 May 2023 04:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684495514; x=1687087514; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6BlLLSb4t/MYbESNdbnlmX8aWP0pTO6ZrGYiXtEq3JU=; b=AdTJK5Yy8ERyK+67dFz4QkLtifLll3Mh81VfJnwH6n2WmKtkscqtfrb18kd61SrlMk rEYjInP3g6CL/QzhLYXKtHy2rqbRnLySMQrx4d9+Fa4+g4V0YPPWaFM9nUOoh/LumoFy OZUIYQAtJn04uQJu4aXzlS8VovVRqEy9YvQFR2hJL2P2Wkum21BlJljtPLghAKEiQrGn B8CT2s+owWDQYOnyySWTIjmu0ZDxrz/bD5FNvUxlZvffgK9XHjUI/Mt84CyrqHvcomQj z7kWdqKBUw5VLgIxiSL4YkDb+E6Qc7SWy8cMy4oV3arBSAFbRqVN9I21cxzZ56OkPKbp qdUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684495514; x=1687087514; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6BlLLSb4t/MYbESNdbnlmX8aWP0pTO6ZrGYiXtEq3JU=; b=EUn/bFIty/0Pw4ObYols6O/T02bqFszEi3hqzywGNB647lxdfOTZj9fySIIF5M8DHr Onuj8X5jDkQsEmo5OXmT2rS5XIpoWAgnZlfe37vcsv31AuTx5NKWTvIojnHKGI7c0yPM 5OTmUf7745r5bf4zXLn7uZZ7qjrj+jEUQHktg+R6WQcr/24E7wmgrdpS4HmRRF1U7z3C vNmihkIdsIs+JYoSSoVJehKBnUdCVS03bk4mkmYpa6y2ngKHrVyW4EXgmjIyBK63XMih 5ybivHfPdZ0Nj61QC254+YWyFVmUdC/U2rqEZK12YDdi+DpjeNihszsZYhIs/PjsW6vS emVA== X-Gm-Message-State: AC+VfDyq4xQuJ+uEA29SHd4bXYDFFxaS5I3MAMP5ZbapDCeqKTJu6ITu QMlCFKet6diMMNuaIzbcI3c= X-Received: by 2002:a17:903:2343:b0:1a9:9a18:3458 with SMTP id c3-20020a170903234300b001a99a183458mr2800765plh.31.1684495514183; Fri, 19 May 2023 04:25:14 -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 a7-20020a170902ecc700b001ac95be5081sm3170111plh.307.2023.05.19.04.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:25:13 -0700 (PDT) From: Min-Hua Chen To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin Cc: Min-Hua Chen , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] net: stmmac: compare p->des0 and p->des1 with __le32 type values Date: Fri, 19 May 2023 19:25:08 +0800 Message-Id: <20230519112509.40973-1-minhuadotchen@gmail.com> X-Mailer: git-send-email 2.34.1 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 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 --- 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))) return -EINVAL; return 0; } -- 2.34.1