lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250117102920.GI6206@kernel.org>
Date: Fri, 17 Jan 2025 10:29:20 +0000
From: Simon Horman <horms@...nel.org>
To: Jeongjun Park <aha310510@...il.com>
Cc: bh74.an@...sung.com, andrew+netdev@...n.ch, davem@...emloft.net,
	edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
	richardcochran@...il.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: sxgbe: change conditional statement from
 if to switch

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@...il.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?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ