[v1] ethdev: beautify the Rx desc number check indent

Message ID 20220215070402.265481-1-haiyue.wang@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers
Series [v1] ethdev: beautify the Rx desc number check indent |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Wang, Haiyue Feb. 15, 2022, 7:04 a.m. UTC
  Align to Tx desc number check indent, which may help to understand Rx
descriptor limits member in the alignment comparison view. And remove
the extra empty line.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 lib/ethdev/rte_ethdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Ferruh Yigit Feb. 15, 2022, 9:19 a.m. UTC | #1
On 2/15/2022 7:04 AM, Haiyue Wang wrote:
> Align to Tx desc number check indent, which may help to understand Rx
> descriptor limits member in the alignment comparison view. And remove
> the extra empty line.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
>   lib/ethdev/rte_ethdev.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 70c850a2f1..54f1e14c6b 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -1799,9 +1799,8 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
>   	}
>   
>   	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
> -			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> -			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
> -
> +	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> +	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
>   		RTE_ETHDEV_LOG(ERR,
>   			"Invalid value for nb_rx_desc(=%hu), should be: <= %hu, >= %hu, and a product of %hu\n",
>   			nb_rx_desc, dev_info.rx_desc_lim.nb_max,

Hi Haiyue,

Initial code matches to DPDK coding convention, updated code doesn't:
https://doc.dpdk.org/guides/contributing/coding_style.html

And I don't think syntax only updates are good idea,
it corrupts the git history with minimal gain, instead
better to fix them while doing a functional changes in
those lines.
  
Wang, Haiyue Feb. 15, 2022, 11:41 a.m. UTC | #2
> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Tuesday, February 15, 2022 17:20
> To: Wang, Haiyue <haiyue.wang@intel.com>; dev@dpdk.org
> Cc: Thomas Monjalon <thomas@monjalon.net>; Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Subject: Re: [PATCH v1] ethdev: beautify the Rx desc number check indent
> 
> On 2/15/2022 7:04 AM, Haiyue Wang wrote:
> > Align to Tx desc number check indent, which may help to understand Rx
> > descriptor limits member in the alignment comparison view. And remove
> > the extra empty line.
> >
> > Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> > ---
> >   lib/ethdev/rte_ethdev.c | 5 ++---
> >   1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> > index 70c850a2f1..54f1e14c6b 100644
> > --- a/lib/ethdev/rte_ethdev.c
> > +++ b/lib/ethdev/rte_ethdev.c
> > @@ -1799,9 +1799,8 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
> >   	}
> >
> >   	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
> > -			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> > -			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
> > -
> > +	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
> > +	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
> >   		RTE_ETHDEV_LOG(ERR,
> >   			"Invalid value for nb_rx_desc(=%hu), should be: <= %hu, >= %hu, and a product
> of %hu\n",
> >   			nb_rx_desc, dev_info.rx_desc_lim.nb_max,
> 
> Hi Haiyue,
> 
> Initial code matches to DPDK coding convention, updated code doesn't:
> https://doc.dpdk.org/guides/contributing/coding_style.html

I just read that 'rte_eth_tx_queue_setup' does it as above. ;-)

> 
> And I don't think syntax only updates are good idea,
> it corrupts the git history with minimal gain, instead
> better to fix them while doing a functional changes in
> those lines.

Got it.
  

Patch

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 70c850a2f1..54f1e14c6b 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1799,9 +1799,8 @@  rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 	}
 
 	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
-			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
-			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
-
+	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
+	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
 		RTE_ETHDEV_LOG(ERR,
 			"Invalid value for nb_rx_desc(=%hu), should be: <= %hu, >= %hu, and a product of %hu\n",
 			nb_rx_desc, dev_info.rx_desc_lim.nb_max,