Skip to contentSkip to conversation

staging: erofs: unzip_vle.c: Remove unnecessary parenthesis.

PATCH In review Sanjana Sanikommu 2 participants 3 messages Mar 28, 2019 – Mar 29, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: erofs: unzip_vle.c: Remove unnecessary parenthesis.

Challenge suggested by coccinelle.
Reomove unnecessary parenthesis around the right hand of the assignment using the below script.

@@
local idexpression id;
expression e;
@@

id =
-(
e
-)

---
 drivers/staging/erofs/unzip_vle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/erofs/unzip_vle.c +1 -1
index 8715bc50e09c..03b9c0f256fe 100644
@@ -870,7 +870,7 @@ static inline void z_erofs_vle_read_endio(struct bio *bio)
 		 * If mc has not gotten, it equals NULL,
 		 * however, page->mapping never be NULL if working properly.
 		 */
-		cachemngd = (page->mapping == mc);
+		cachemngd = page->mapping == mc;
 #endif
 
 		if (unlikely(err))
Signature · 1 line
2.17.1
#1 lore raw
Quoted 24 lines · Sanjana Sanikommu

Challenge suggested by coccinelle.
Reomove unnecessary parenthesis around the right hand of the assignment using the below script.

@@
local idexpression id;
expression e;
@@

id =
-(
e
-)

---
 drivers/staging/erofs/unzip_vle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/erofs/unzip_vle.c +0 -0
index 8715bc50e09c..03b9c0f256fe 100644

drivers/staging/erofs/unzip_vle.c static inline void z_erofs_vle_read_endio(struct bio *bio) · line 873

Quoted 5 lines
drivers/staging/erofs/unzip_vle.c +1 -1
@@ -870,7 +870,7 @@ static inline void z_erofs_vle_read_endio(struct bio *bio)
 		 * If mc has not gotten, it equals NULL,
 		 * however, page->mapping never be NULL if working properly.
 		 */
-		cachemngd = (page->mapping == mc);
+		cachemngd = page->mapping == mc;

There is a feeling that it is better to keep the parentheses when the right side of the assignment involved ==, so that it doesn't look like a double assignment.

julia

Quoted 13 lines
drivers/staging/erofs/unzip_vle.c +0 -1
 #endif
 
 		if (unlikely(err))
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190328165508.17702-1-sanjana99reddy99%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 32 lines · On Fri, 29 Mar 2019, 00:21 Julia Lawall, <[email protected]> wrote:
Quoted 14 lines · Sanjana Sanikommu

Challenge suggested by coccinelle.
Reomove unnecessary parenthesis around the right hand of the assignment using the below script.

@@
local idexpression id;
expression e;
@@

id =
-(
e
-)

Review

Quoted 6 lines
---
 drivers/staging/erofs/unzip_vle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/staging/erofs/unzip_vle.c

drivers/staging/erofs/unzip_vle.c static inline void z_erofs_vle_read_endio(struct bio

Quoted 4 lines

index 8715bc50e09c..03b9c0f256fe 100644

drivers/staging/erofs/unzip_vle.c +0 -0
@@ -870,7 +870,7 @@ static inline void z_erofs_vle_read_endio(struct bio

*bio)

drivers/staging/erofs/unzip_vle.c static inline void z_erofs_vle_read_endio(struct bio · line 871

Quoted 2 lines
drivers/staging/erofs/unzip_vle.c +0 -0
               * If mc has not gotten, it equals NULL,
               * however, page->mapping never be NULL if working
Quoted 9 lines

properly.

drivers/staging/erofs/unzip_vle.c static inline void z_erofs_vle_read_endio(struct bio *bio) · line 873

Quoted 3 lines
drivers/staging/erofs/unzip_vle.c +1 -1
               */
-             cachemngd = (page->mapping == mc);
+             cachemngd = page->mapping == mc;

There is a feeling that it is better to keep the parentheses when the right side of the assignment involved ==, so that it doesn't look like a double assignment.

Sure, I would let the parenthesis same as before.

Sanjana

Quoted 32 lines

julia

Quoted 8 lines
drivers/staging/erofs/unzip_vle.c +0 -1
 #endif
 
              if (unlikely(err))
--

2.17.1

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20190328165508.17702-1-sanjana99reddy99%40gmail.com
.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.1903281950280.2760%40hadrien
.
For more options, visit https://groups.google.com/d/optout.