Re: [PATCH] rtc: isl1208: Fix incorrect logic in isl1208_set_xtoscb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu 2023-08-17 17:10:38, Biju Das wrote:
> The XTOSCB bit is not bit 0, but xtosb_val is either 0 or 1. If it is 1,
> test will never succeed. Fix this issue by using double negation.
> 
> While at it, remove unnecessary blank line from probe().

Reviewed-by: Pavel Machek <pavel@xxxxxxx>

Thank you!

Best regards,
								Pavel

> +++ b/drivers/rtc/rtc-isl1208.c
> @@ -188,7 +188,7 @@ isl1208_i2c_validate_client(struct i2c_client *client)
>  static int isl1208_set_xtoscb(struct i2c_client *client, int sr, int xtosb_val)
>  {
>  	/* Do nothing if bit is already set to desired value */
> -	if ((sr & ISL1208_REG_SR_XTOSCB) == xtosb_val)
> +	if (!!(sr & ISL1208_REG_SR_XTOSCB) == xtosb_val)
>  		return 0;
>  
>  	if (xtosb_val)
> @@ -944,7 +944,6 @@ isl1208_probe(struct i2c_client *client)
>  		rc = isl1208_setup_irq(client, client->irq);
>  		if (rc)
>  			return rc;
> -
>  	} else {
>  		clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, isl1208->rtc->features);
>  	}

-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux