Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2361421rwd; Fri, 19 May 2023 04:55:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Ew1pxa0DhZW3EU/BgUi9IjjIlnP8b8Y79/upCrRrnff9Z9SIZd4UHvXS010BGo47TuoOU X-Received: by 2002:a17:902:e5ce:b0:1ac:528c:e71 with SMTP id u14-20020a170902e5ce00b001ac528c0e71mr3342356plf.18.1684497338236; Fri, 19 May 2023 04:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684497338; cv=none; d=google.com; s=arc-20160816; b=I7k5oS3yu1Oh9qUvyCK5qccMGYhdaXizmTJ72aPr7HaquNnKpIgaM4fzUv1AfMrT4R 4Aue9RKEZmXxanlc3jF6mvYUz9t5lwqxXLBlpHecSBraD0t8p/GqACtUbGb5cRKT605a cqrl6LPLmvrYHOFdbNuApRZQoUg35fw+u226Xqt/PHL8XTgiOMpeCYkYbrbDbOQ4A2iR /8QTu2I/HAVkuChaq+5tuYXxTj9pdc3oOvfQOCwdYBNudVJ32X8wZXxlUbstuMcINzh5 b2ENsxAW/UqicXOhjD3qZn0KP2F0ZR08ApSmJ4Vc7E4V9VG5w5uiE0pnOLgmT5OxeoME Fpmg== 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=hQGAuByaIDxbyojHoKmHrl+Nk6GqKopJ1ZhmVD31Npc=; b=gvuy6vkrTso86aiNnNaBS1ieTIGWl8LWNnqM62/nPlSfcrN2AqtGZ77LjJy+CJB8x7 Qo1R6n8RKQkg8fBR0FAua5g7GZeeoUIiVSGBVjOPe4S043Z/J3ajaOR6zGLM4W42QQI2 Q25uCtLEFJ/NDASdlLTECwfwLSw+a59rgDmI95GzsZM8Z6bug8OA6L3nQgpzkS1wqtkp 7NhnLmKwdFV1F8EmVzLgvGcG2ePcc2WM7mA/i9bN8EPyZwUL8vzcuhNLTXq52t0pQjqS +qzow2HR80xT7Nt9e8i1DBQbAoj2UVimTZDmQpq50WHj3xGxf8M9uwKZJb3H//xOZ3I3 P29Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gunVkUnD; 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 i14-20020a170902c94e00b001ab1fb8cc83si3869891pla.161.2023.05.19.04.55.23; Fri, 19 May 2023 04:55:38 -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=gunVkUnD; 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 S231324AbjESLuj (ORCPT + 99 others); Fri, 19 May 2023 07:50:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbjESLuh (ORCPT ); Fri, 19 May 2023 07:50:37 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4436511F; Fri, 19 May 2023 04:50:36 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2537a79b9acso609935a91.3; Fri, 19 May 2023 04:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684497036; x=1687089036; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hQGAuByaIDxbyojHoKmHrl+Nk6GqKopJ1ZhmVD31Npc=; b=gunVkUnD7D4jkTN/U/zUqKXL2XEJa5twGkfe4HTgztsK/5C89ynhd6QbT3z7m0Iqfm oeqjVPhzJzgc8EamP7G+QEn2+7n+YCbaqDep1azYXCx1SyIpOe27xfSa5xnR96AlLooV PzKMYNCtt31yvvz0xAjrReNxyG/QMkCaQY9z0lJg4GZKYDgYRSWkjjuVtw+489YSZCT3 F8qSGTt7IsVLLjjmjN2LPUcO9kyWDManwqtE79Lk8lXj+ZlchKawFbqlDytge3OCbT+f zT8nJ/REBMfCgIMq86rPkcDq7sLstL/WvIK7pUs3nqAqbWrSqne3MOPAYI7cZgT4Hzt0 /AjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684497036; x=1687089036; 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=hQGAuByaIDxbyojHoKmHrl+Nk6GqKopJ1ZhmVD31Npc=; b=ZuvRDbuKXdptguuKabVnh2HHxZ/Z55Dqllj28eyIkenkfmDhjEXIGBeR4Z+4BXMGpW osIuJLcttkkN3gdeBQU3xwTZZ5e117gqCnwkM9vbSMuQb4GGp/dpYGBUYuMHPXqQf0CZ fqbW1avfkVuwFMQYXhyN/+rWBr+9FesX+W/wy8DmGW2l9TwAEivfZUxtxtWDy6eSd/CE 6KBdSwZmrw4mdIAzaU7ChG0Kloou7igqYWoOnpfOcbCgYzYSMw3EpXPEvTk+BIOhcZAY /1yz4jhB7D6NzlZ5RlcilPN150OchP0mdpnLdEb4daJA1+WlzTEvrJJZaUVpopsoWZY4 fiMA== X-Gm-Message-State: AC+VfDy2HNMyLyLtXDae4j/lx2ltaMkvG3OAhJzbkMDVK2Hw8y4hDwdE Y9k6cBJKs6PXOm8AAikLeeQ= X-Received: by 2002:a17:90a:d513:b0:24d:d377:d1 with SMTP id t19-20020a17090ad51300b0024dd37700d1mr1776498pju.45.1684497035724; Fri, 19 May 2023 04:50:35 -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 z15-20020a17090a468f00b00250334d97dasm1259507pjf.31.2023.05.19.04.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 04:50:35 -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 , Simon Horman , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] net: stmmac: compare p->des0 and p->des1 with __le32 type values Date: Fri, 19 May 2023 19:50:28 +0800 Message-Id: <20230519115030.74493-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 Reviewed-by: Simon Horman Signed-off-by: Min-Hua Chen --- Change since v1: use cpu_to_le32 to the constants Change since v2: remove unnecessary parentheses --- 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..ffe4a41ffcde 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