From nobody Sun Feb 8 14:53:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E240C77B7A for ; Fri, 19 May 2023 11:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231571AbjESLuj (ORCPT ); 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-Google-Smtp-Source: ACHHUZ7pPIhbppvLnQ1vgjftgAajPnjW22pA73/CudJr5YDBYqN2Ag+3yy0FJSQutFhspU/Hkvhegw== 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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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: warnin= g: restricted __le32 degrades to integer drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c:110:50: sparse: warnin= g: 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 =3D !(rdes3 & XGMAC_RDES3_TSD) && (rdes3 & XGMAC_RDES3_TSA); =20 if (likely(desc_valid && ts_valid)) { - if ((p->des0 =3D=3D 0xffffffff) && (p->des1 =3D=3D 0xffffffff)) + if (p->des0 =3D=3D cpu_to_le32(0xffffffff) && + p->des1 =3D=3D cpu_to_le32(0xffffffff)) return -EINVAL; return 0; } --=20 2.34.1