staging: greybus: Remove unnecessary parentheses
PATCH 1/1 staging: greybus: Remove unnecessary parentheses
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 <[email protected]>
---
sdio.c +2 -2
@@ -94,7 +94,7 @@ static void _gb_sdio_set_host_caps(strucstatic 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)
power_supply.c +2 -2
@@ -337,7 +337,7 @@ static int is_psy_prop_writeable(structstatic 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_powestatic 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,
Quoted 61 lines · 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 <[email protected]>---
diff -u -pa/sdio.cb/sdio.csdio.c +2
-2@@ -94,7 +94,7 @@ static void _gb_sdio_set_host_caps(strucstatic 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.cb/power_supply.cpower_supply.c +2
-2@@ -337,7 +337,7 @@ static int is_psy_prop_writeable(structstatic 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_powestatic 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,