All of lore.kernel.org
 help / color / mirror / Atom feed
* [Outreachy kernel] [PATCH v2] staging: greybus: Remove unnecessary parentheses
@ 2019-03-29 15:11 Payal Kshirsagar
  2019-03-29 16:20 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Payal Kshirsagar @ 2019-03-29 15:11 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Payal Kshirsagar

Challenge suggested by coccinelle

This patch removes unnecessary parentheses while returning a value using an expression.
Using following semantic patch:

@@ 
expression e;
@@

return
- (
e
- )
;

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
---
Changes in v2:
	-Correction in typo.
diff -u -p a/sdio.c b/sdio.c
--- a/sdio.c
+++ b/sdio.c
@@ -94,7 +94,7 @@ static void _gb_sdio_set_host_caps(struc
 
 static u32 _gb_sdio_get_host_ocr(u32 ocr)
 {
-	return (((ocr & GB_SDIO_VDD_165_195) ? MMC_VDD_165_195 : 0) |
+	return ((ocr & GB_SDIO_VDD_165_195) ? MMC_VDD_165_195 : 0) |
 		((ocr & GB_SDIO_VDD_20_21) ? MMC_VDD_20_21 : 0) |
 		((ocr & GB_SDIO_VDD_21_22) ? MMC_VDD_21_22 : 0) |
 		((ocr & GB_SDIO_VDD_22_23) ? MMC_VDD_22_23 : 0) |
@@ -111,7 +111,7 @@ static u32 _gb_sdio_get_host_ocr(u32 ocr
 		((ocr & GB_SDIO_VDD_33_34) ? MMC_VDD_33_34 : 0) |
 		((ocr & GB_SDIO_VDD_34_35) ? MMC_VDD_34_35 : 0) |
 		((ocr & GB_SDIO_VDD_35_36) ? MMC_VDD_35_36 : 0)
-		);
+		;
 }
 
 static int gb_sdio_get_caps(struct gb_sdio_host *host)
diff -u -p a/power_supply.c b/power_supply.c
--- a/power_supply.c
+++ b/power_supply.c
@@ -337,7 +337,7 @@ static int is_psy_prop_writeable(struct
 
 static int is_prop_valint(enum power_supply_property psp)
 {
-	return ((psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0);
+	return (psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0;
 }
 
 static void next_interval(struct gb_power_supply *gbpsy)
@@ -424,7 +424,7 @@ static void check_changed(struct gb_powe
 static int total_props(struct gb_power_supply *gbpsy)
 {
 	/* this return the intval plus the strval properties */
-	return (gbpsy->properties_count + gbpsy->properties_count_str);
+	return gbpsy->properties_count + gbpsy->properties_count_str;
 }
 
 static void prop_append(struct gb_power_supply *gbpsy,


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH v2] staging: greybus: Remove unnecessary parentheses
  2019-03-29 15:11 [Outreachy kernel] [PATCH v2] staging: greybus: Remove unnecessary parentheses Payal Kshirsagar
@ 2019-03-29 16:20 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-03-29 16:20 UTC (permalink / raw)
  To: Payal Kshirsagar; +Cc: outreachy-kernel

On Fri, Mar 29, 2019 at 08:41:20PM +0530, Payal Kshirsagar wrote:
> Challenge suggested by coccinelle
> 
> This patch removes unnecessary parentheses while returning a value using an expression.
> Using following semantic patch:
> 
> @@ 
> expression e;
> @@
> 
> return
> - (
> e
> - )
> ;
> 
> Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
> ---
> Changes in v2:
> 	-Correction in typo.
> diff -u -p a/sdio.c b/sdio.c
> --- a/sdio.c
> +++ b/sdio.c

Again, wrong patch depth :(


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-29 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29 15:11 [Outreachy kernel] [PATCH v2] staging: greybus: Remove unnecessary parentheses Payal Kshirsagar
2019-03-29 16:20 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.