public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Min-Hua Chen <minhuadotchen@gmail.com>
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	[thread overview]
Message-ID: <20230519114652.70372-1-minhuadotchen@gmail.com> (raw)
In-Reply-To: <ZGdgA9jMLJOi1W1+@corigine.com>

>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 <minhuadotchen@gmail.com>
>
>Reviewed-by: Simon Horman <simon.horman@corigine.com>
>
>> ---
>>  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

  reply	other threads:[~2023-05-19 11:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19 11:25 [PATCH v2] net: stmmac: compare p->des0 and p->des1 with __le32 type values Min-Hua Chen
2023-05-19 11:39 ` Simon Horman
2023-05-19 11:46   ` Min-Hua Chen [this message]
2023-05-19 13:17     ` [PATCH v2] net: stmmac: compare p->des0 and p->des1 with __le32 Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230519114652.70372-1-minhuadotchen@gmail.com \
    --to=minhuadotchen@gmail.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=simon.horman@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox