Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp227499rwd; Fri, 19 May 2023 18:56:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ilkIEVtWfJ1WD9Xaxze9POHdf2h5BhOS/TRt0hBjxZmGVz8fXdvZ4npOe5f6oFt0tU8kh X-Received: by 2002:a05:6a20:c88d:b0:104:1016:dd4d with SMTP id hb13-20020a056a20c88d00b001041016dd4dmr3294127pzb.57.1684547809186; Fri, 19 May 2023 18:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684547809; cv=none; d=google.com; s=arc-20160816; b=fFiPQMygsox1sj54E3fQUQZeXCHcAJRywnQ2Aem9hZ3xQpNGROK+8RF7UgWp/YFuMk MN4cM8bPQ0EN4+Umc7NaotvQT4k5ruS531aTfm8g7XgqGAT3gclsEZTHzVlEFrO3ayOl f0rq7WA/HvD4HvMtJQMRaoD84OXy2vDXGTazyZAYj0UQkBwedlhOQGrfIWPEj5GtYlkm DlCCjSZ01R7GnxVpXXeJF66ZrdGIMSPo1u6DVWXmr8aCZwvEGbSFibkS7YPuNPl2IG4q tnrfTxDM/aRAlwnA+p/44vBIPWtDwP2dNHK++Fr6PXXEJnbAtP0lZPduP7zVdP0852FD plHQ== 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=RQLH3Pz0r24f41zJi+Y/rFTpLpmNVDUqO6m0VkTNqZQ=; b=b4WZugRiyrQPR1eDfmr0HNQ93ppTKVZfWYQ8wVpM3HyIk4TI2stdVe+yoCk/UM4QmR J2Tvd7AxEspOB1+c8ZfkJEuQC4822EcIcQe0EHxpO3TglrmYKEIrYSwv1zEkUWpRiq9c +ogrrJ+XD2Z+X6XC8XZ/YfisgsPxTZ6wyeZKB+Cn5L/JtrOrh7yVOQcLVSOP9GqOuavX ysCnzdkRD9RFq+4haOr1tPtOIyExi7YV7zHsmEq5ADiUow/dR2RBIjJ++c15D5yQ6yf6 6kP4SAsprEezUU+2mP6q9N86O6SEVujMz8gls4+fOQSOzU2CVxkImamaMK0HKFtlgjJt GdkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HZqfno5C; 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 s199-20020a632cd0000000b005347c4d09dcsi544655pgs.675.2023.05.19.18.56.31; Fri, 19 May 2023 18:56:49 -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=HZqfno5C; 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 S231513AbjETBzf (ORCPT + 99 others); Fri, 19 May 2023 21:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231494AbjETBzd (ORCPT ); Fri, 19 May 2023 21:55:33 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44EF3128; Fri, 19 May 2023 18:55:32 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-643990c5319so2897664b3a.2; Fri, 19 May 2023 18:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684547731; x=1687139731; 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=RQLH3Pz0r24f41zJi+Y/rFTpLpmNVDUqO6m0VkTNqZQ=; b=HZqfno5CxT3eIpLYVJk6Qs92HXMRmJcpQID4d5EqWTu1iPBXDj3lbDSaKtxe9UGK6m kfk9DL+ze63ayibZZzbRk31D01m1wdzIil2GaAjwwAdZ18QC7guJjNxyE5tSzu/SO8in cDDH0zZuxmTHarIOUI7yBNysayZ6OFgXM49cQYAbeKfLv9EcidMjfEe4cs5ffqhPRfF3 kvMwIfG/V7OAlU2n6LnRjN6beJaESUaVlB9Af+vzJrX/Y1UZxap4M6fgTJwpUYiR6Wju nDK5S3aLnUD9X+b5mBm3tPPT3eB1Cqpdj632VE6DaOfe3vG1IN7aEWkAXsJHABk1lVwX D7fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684547731; x=1687139731; 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=RQLH3Pz0r24f41zJi+Y/rFTpLpmNVDUqO6m0VkTNqZQ=; b=j5QVKJgjt3fx2NzpyySX0rzKWLuO+LwepwGBUHvDr2fExb5o82cX/wpQgBpPWgCtC/ JawGHPf06EMIEz4qNLplAO5Xh6YbeGBRZ4Cg73kh56LXfb6lxjh213LBdTeW7JKIyrZw 60djdKPwhamAim3R37KwPfocGjrQB7RMJVyBpkyd8PfiW7Xwy0DzRxQDoUv0Mzzo+SdH yiR1ncekMFuSh75WIEJMXQ3+gseBRxnmlXUj61sb/dv6Z+f0vFbcWg2TCoWJGXAIoPWw 2xtzyKNIWRB/2jAJKOhxAkWnVbLuIG7Qbhf++CZbfa2Ey7rBydVJkstnwA44j4N+ErAv UhbQ== X-Gm-Message-State: AC+VfDwJh7xSDem3nC0xzlKeyII45jgpLLlNvqIrygf9dzqkBmAMxvXc CzYDoUoWHlxsmzQegtfHpRs= X-Received: by 2002:a17:903:248:b0:1a9:3b64:3747 with SMTP id j8-20020a170903024800b001a93b643747mr5197035plh.17.1684547731671; Fri, 19 May 2023 18:55:31 -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 c9-20020a170903234900b001ac5896e96esm262638plh.207.2023.05.19.18.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 18:55:31 -0700 (PDT) From: Min-Hua Chen To: kuba@kernel.org Cc: alexandre.torgue@foss.st.com, davem@davemloft.net, edumazet@google.com, joabreu@synopsys.com, 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, simon.horman@corigine.com Subject: Re: [PATCH v3] net: stmmac: compare p->des0 and p->des1 with __le32 type values Date: Sat, 20 May 2023 09:55:27 +0800 Message-Id: <20230520015527.215952-1-minhuadotchen@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230519152715.7d1c3a49@kernel.org> References: <20230519152715.7d1c3a49@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Hi Jakub, >On Fri, 19 May 2023 19:50:28 +0800 Min-Hua Chen wrote: >> - if ((p->des0 == 0xffffffff) && (p->des1 == 0xffffffff)) >> + if (p->des0 == cpu_to_le32(0xffffffff) && >> + p->des1 == cpu_to_le32(0xffffffff)) > >Can you try to fix the sparse tool instead? I believe it already >ignores such errors for the constant of 0, maybe it can be taught >to ignore all "isomorphic" values? > I downloaded the source code of sparse and I'm afraid that I cannot make 0xFFFFFFFF ignored easily. I've tried ~0 instead of 0xFFFFFF, but it did not work with current sparse. 0 is a special case mentioned in [1]. """ One small note: the constant integer “0” is special. You can use a constant zero as a bitwise integer type without sparse ever complaining. This is because “bitwise” (as the name implies) was designed for making sure that bitwise types don’t get mixed up (little-endian vs big-endian vs cpu-endian vs whatever), and there the constant “0” really _is_ special. """ For 0xFFFFFFFF, it may look like a false alarm, but we can silence the sparse warning by taking a fix like mine and people can keep working on other sparse warnings easier. (There are around 7000 sparse warning in ARCH=arm64 defconfig build and sometimes it is hard to remember all the false alarm cases) Could you consider taking this patch, please? > >By "isomorphic" I mean that 0xffffffff == cpu_to_le32(0xffffffff) >so there's no point complaining. thanks, Min-Hua [1] https://www.kernel.org/doc/html/v4.12/dev-tools/sparse.html