From: Simon Horman <horms@kernel.org>
To: Jeongjun Park <aha310510@gmail.com>
Cc: bh74.an@samsung.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
richardcochran@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: sxgbe: change conditional statement from if to switch
Date: Fri, 17 Jan 2025 10:29:20 +0000 [thread overview]
Message-ID: <20250117102920.GI6206@kernel.org> (raw)
In-Reply-To: <20250116160314.23873-1-aha310510@gmail.com>
On Fri, Jan 17, 2025 at 01:03:14AM +0900, Jeongjun Park wrote:
> Change the if conditional statement in sxgbe_rx_ctxt_wbstatus() to a switch
> conditional statement to improve readability, and also add processing for
> cases where all conditions are not satisfied.
>
> Signed-off-by: Jeongjun Park <aha310510@gmail.com>
> ---
> .../net/ethernet/samsung/sxgbe/sxgbe_desc.c | 43 +++++++++++++------
> 1 file changed, 30 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_desc.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_desc.c
> index b33ebf2dca47..5e69ab8a4b90 100644
> --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_desc.c
> +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_desc.c
> @@ -421,31 +421,48 @@ static void sxgbe_rx_ctxt_wbstatus(struct sxgbe_rx_ctxt_desc *p,
...
> + default:
> + pr_err("Invalid PTP Message type\n");
> + break;
> + }
> }
Hi Jeongjun,
I was wondering if it would be best if the error message above should be
rate limited, or perhaps the callback enhanced to return an error in such
cases. But that depends on where sxgbe_rx_ctxt_wbstatus is called.
And I'm unable to find where the it called.
I see that sxgbe_rx_ctxt_wbstatus is registered as a get_rx_ctxt_tstamp_status
callback. But is the get_rx_ctxt_tstamp_status callback called anywhere?
next prev parent reply other threads:[~2025-01-17 10:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 16:03 [PATCH net-next] net: sxgbe: change conditional statement from if to switch Jeongjun Park
2025-01-17 10:29 ` Simon Horman [this message]
2025-02-19 14:47 ` Jeongjun Park
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=20250117102920.GI6206@kernel.org \
--to=horms@kernel.org \
--cc=aha310510@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=bh74.an@samsung.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.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;
as well as URLs for NNTP newsgroup(s).