All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8188eu: Replace ternary operator with predefined macro
@ 2015-02-23 16:27 Vatika Harlalka
  2015-02-23 17:12 ` [Outreachy kernel] " Julia Lawall
  2015-02-26 20:54 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Vatika Harlalka @ 2015-02-23 16:27 UTC (permalink / raw)
  To: outreachy-kernel

Replace use of ternary operator with abs() macro to increase
code readability.

Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
 drivers/staging/rtl8188eu/hal/phy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index e7ede44..115d611 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -554,9 +554,7 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
 			thermal_val = (u8)(thermal_avg / thermal_avg_count);
 
 		if (dm_odm->RFCalibrateInfo.bReloadtxpowerindex) {
-			delta = thermal_val > hal_data->EEPROMThermalMeter ?
-				(thermal_val - hal_data->EEPROMThermalMeter) :
-				(hal_data->EEPROMThermalMeter - thermal_val);
+			delta = abs(thermal_val - hal_data->EEPROMThermalMeter);
 			dm_odm->RFCalibrateInfo.bReloadtxpowerindex = false;
 			dm_odm->RFCalibrateInfo.bDoneTxpower = false;
 		} else if (dm_odm->RFCalibrateInfo.bDoneTxpower) {
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Replace ternary operator with predefined macro
  2015-02-23 16:27 [PATCH] Staging: rtl8188eu: Replace ternary operator with predefined macro Vatika Harlalka
@ 2015-02-23 17:12 ` Julia Lawall
  2015-02-26 20:54 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2015-02-23 17:12 UTC (permalink / raw)
  To: Vatika Harlalka; +Cc: outreachy-kernel



On Mon, 23 Feb 2015, Vatika Harlalka wrote:

> Replace use of ternary operator with abs() macro to increase
> code readability.

This is nice.  You could see if you can use Coccinelle to find other
occurrences.

julia


> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
>  drivers/staging/rtl8188eu/hal/phy.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index e7ede44..115d611 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -554,9 +554,7 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
>  			thermal_val = (u8)(thermal_avg / thermal_avg_count);
>
>  		if (dm_odm->RFCalibrateInfo.bReloadtxpowerindex) {
> -			delta = thermal_val > hal_data->EEPROMThermalMeter ?
> -				(thermal_val - hal_data->EEPROMThermalMeter) :
> -				(hal_data->EEPROMThermalMeter - thermal_val);
> +			delta = abs(thermal_val - hal_data->EEPROMThermalMeter);
>  			dm_odm->RFCalibrateInfo.bReloadtxpowerindex = false;
>  			dm_odm->RFCalibrateInfo.bDoneTxpower = false;
>  		} else if (dm_odm->RFCalibrateInfo.bDoneTxpower) {
> --
> 1.9.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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20150223162709.GA16766%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Replace ternary operator with predefined macro
  2015-02-23 16:27 [PATCH] Staging: rtl8188eu: Replace ternary operator with predefined macro Vatika Harlalka
  2015-02-23 17:12 ` [Outreachy kernel] " Julia Lawall
@ 2015-02-26 20:54 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2015-02-26 20:54 UTC (permalink / raw)
  To: Vatika Harlalka; +Cc: outreachy-kernel

On Mon, Feb 23, 2015 at 09:57:09PM +0530, Vatika Harlalka wrote:
> Replace use of ternary operator with abs() macro to increase
> code readability.
> 
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
>  drivers/staging/rtl8188eu/hal/phy.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index e7ede44..115d611 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -554,9 +554,7 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
>  			thermal_val = (u8)(thermal_avg / thermal_avg_count);
>  
>  		if (dm_odm->RFCalibrateInfo.bReloadtxpowerindex) {
> -			delta = thermal_val > hal_data->EEPROMThermalMeter ?
> -				(thermal_val - hal_data->EEPROMThermalMeter) :
> -				(hal_data->EEPROMThermalMeter - thermal_val);
> +			delta = abs(thermal_val - hal_data->EEPROMThermalMeter);
>  			dm_odm->RFCalibrateInfo.bReloadtxpowerindex = false;
>  			dm_odm->RFCalibrateInfo.bDoneTxpower = false;
>  		} else if (dm_odm->RFCalibrateInfo.bDoneTxpower) {

With the other changes you have made in this file, this patch no longer
applies :(

Can you please refresh your tree against my staging-testing branch and
respin this patch and resend it?

thanks,

greg k-h


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

end of thread, other threads:[~2015-02-26 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-23 16:27 [PATCH] Staging: rtl8188eu: Replace ternary operator with predefined macro Vatika Harlalka
2015-02-23 17:12 ` [Outreachy kernel] " Julia Lawall
2015-02-26 20:54 ` 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.