diff mbox series

rtc: xilinx: Fix calibval variable type

Message ID 20765c4c27aa92c75426b82fd2815ebef6471492.1570544738.git.michal.simek@xilinx.com (mailing list archive)
State Mainlined
Commit d53bf24db3776842876f83a29a7cd8db2aa3c5ab
Headers show
Series rtc: xilinx: Fix calibval variable type | expand

Commit Message

Michal Simek Oct. 8, 2019, 2:25 p.m. UTC
From: Srinivas Goud <srinivas.goud@xilinx.com>

This patch fixes the warnings reported by static code analysis.
Updated calibval variable type to unsigned type from signed.

Signed-off-by: Srinivas Goud <srinivas.goud@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/rtc/rtc-zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexandre Belloni Oct. 8, 2019, 2:31 p.m. UTC | #1
Hi,

On 08/10/2019 16:25:41+0200, Michal Simek wrote:
> From: Srinivas Goud <srinivas.goud@xilinx.com>
> 
> This patch fixes the warnings reported by static code analysis.
> Updated calibval variable type to unsigned type from signed.
> 
> Signed-off-by: Srinivas Goud <srinivas.goud@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
>  drivers/rtc/rtc-zynqmp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
> index 2c762757fb54..da0dbea8def3 100644
> --- a/drivers/rtc/rtc-zynqmp.c
> +++ b/drivers/rtc/rtc-zynqmp.c
> @@ -44,7 +44,7 @@ struct xlnx_rtc_dev {
>  	void __iomem		*reg_base;
>  	int			alarm_irq;
>  	int			sec_irq;
> -	int			calibval;
> +	unsigned int		calibval;

Note that ideally, this varialbe should be removed and replaced by
.read_offset and .set_offset callbacks so userspace can properly
recalibrate the crystal instead of relying on a static value inside the
device tree.
Michal Simek Oct. 11, 2019, 7:10 a.m. UTC | #2
On 08. 10. 19 16:31, Alexandre Belloni wrote:
> Hi,
> 
> On 08/10/2019 16:25:41+0200, Michal Simek wrote:
>> From: Srinivas Goud <srinivas.goud@xilinx.com>
>>
>> This patch fixes the warnings reported by static code analysis.
>> Updated calibval variable type to unsigned type from signed.
>>
>> Signed-off-by: Srinivas Goud <srinivas.goud@xilinx.com>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>>  drivers/rtc/rtc-zynqmp.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
>> index 2c762757fb54..da0dbea8def3 100644
>> --- a/drivers/rtc/rtc-zynqmp.c
>> +++ b/drivers/rtc/rtc-zynqmp.c
>> @@ -44,7 +44,7 @@ struct xlnx_rtc_dev {
>>  	void __iomem		*reg_base;
>>  	int			alarm_irq;
>>  	int			sec_irq;
>> -	int			calibval;
>> +	unsigned int		calibval;
> 
> Note that ideally, this varialbe should be removed and replaced by
> .read_offset and .set_offset callbacks so userspace can properly
> recalibrate the crystal instead of relying on a static value inside the
> device tree.

Thanks for letting me know. We will look at it. It should be patch on
the top anyway.

Thanks,
Michal
Alexandre Belloni Oct. 14, 2019, 3:50 p.m. UTC | #3
On 08/10/2019 16:25:41+0200, Michal Simek wrote:
> From: Srinivas Goud <srinivas.goud@xilinx.com>
> 
> This patch fixes the warnings reported by static code analysis.
> Updated calibval variable type to unsigned type from signed.
> 
> Signed-off-by: Srinivas Goud <srinivas.goud@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
>  drivers/rtc/rtc-zynqmp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-zynqmp.c b/drivers/rtc/rtc-zynqmp.c
index 2c762757fb54..da0dbea8def3 100644
--- a/drivers/rtc/rtc-zynqmp.c
+++ b/drivers/rtc/rtc-zynqmp.c
@@ -44,7 +44,7 @@  struct xlnx_rtc_dev {
 	void __iomem		*reg_base;
 	int			alarm_irq;
 	int			sec_irq;
-	int			calibval;
+	unsigned int		calibval;
 };
 
 static int xlnx_rtc_set_time(struct device *dev, struct rtc_time *tm)