[3/4] staging: r8188eu: remove {} for single statement blocks

Message ID 478d652b9f467d47685c1af72a876f34dd92710f.1666011479.git.drv@mailo.com
State New
Headers
Series staging: r8188eu: trivial code cleanup patches |

Commit Message

Deepak R Varma Oct. 17, 2022, 1:23 p.m. UTC
  As per the Linux kernel coding-style guidelines, there is no need to
use {} for single statement blocks. Address following checkpatch script
complaint:
	WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 drivers/staging/r8188eu/core/rtw_br_ext.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
2.30.2
  

Comments

Julia Lawall Oct. 17, 2022, 1:57 p.m. UTC | #1
On Mon, 17 Oct 2022, Deepak R Varma wrote:

> As per the Linux kernel coding-style guidelines, there is no need to
> use {} for single statement blocks. Address following checkpatch script
> complaint:
> 	WARNING: braces {} are not necessary for single statement blocks

It's nice to say something like "Problem identified using checkpatch".
But putting the verbatim checkpatch message that says what you just said
doesn't seem necessary.

julia

>
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---
>  drivers/staging/r8188eu/core/rtw_br_ext.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index 427da7e8ba4c..290affe50d0b 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -655,9 +655,8 @@ void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr)
>  	hash = __nat25_network_hash(network_addr);
>  	db = priv->nethash[hash];
>  	while (db) {
> -		if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN)) {
> +		if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN))
>  			return (void *)db;
> -		}
>
>  		db = db->next_hash;
>  	}
> --
> 2.30.2
>
>
>
>
>
  
Deepak R Varma Oct. 17, 2022, 2:13 p.m. UTC | #2
On Mon, Oct 17, 2022 at 03:57:16PM +0200, Julia Lawall wrote:
>
>
> On Mon, 17 Oct 2022, Deepak R Varma wrote:
>
> > As per the Linux kernel coding-style guidelines, there is no need to
> > use {} for single statement blocks. Address following checkpatch script
> > complaint:
> > 	WARNING: braces {} are not necessary for single statement blocks
>
> It's nice to say something like "Problem identified using checkpatch".
> But putting the verbatim checkpatch message that says what you just said
> doesn't seem necessary.

Understood. That sounds better. Thank you Julia. Will include your feedback in
the next revision.

./drv

>
> julia
>
> >
> > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > ---
> >  drivers/staging/r8188eu/core/rtw_br_ext.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> > index 427da7e8ba4c..290affe50d0b 100644
> > --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> > +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> > @@ -655,9 +655,8 @@ void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr)
> >  	hash = __nat25_network_hash(network_addr);
> >  	db = priv->nethash[hash];
> >  	while (db) {
> > -		if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN)) {
> > +		if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN))
> >  			return (void *)db;
> > -		}
> >
> >  		db = db->next_hash;
> >  	}
> > --
> > 2.30.2
> >
> >
> >
> >
> >
  

Patch

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 427da7e8ba4c..290affe50d0b 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -655,9 +655,8 @@  void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr)
 	hash = __nat25_network_hash(network_addr);
 	db = priv->nethash[hash];
 	while (db) {
-		if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN)) {
+		if (!memcmp(db->networkAddr, network_addr, MAX_NETWORK_ADDR_LEN))
 			return (void *)db;
-		}

 		db = db->next_hash;
 	}