linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: xilinx: Fix calibval variable type
@ 2019-10-08 14:25 Michal Simek
  2019-10-08 14:31 ` Alexandre Belloni
  2019-10-14 15:50 ` Alexandre Belloni
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Simek @ 2019-10-08 14:25 UTC (permalink / raw)
  To: linux-kernel, monstr, michal.simek, git
  Cc: Srinivas Goud, Alessandro Zummo, Alexandre Belloni,
	linux-arm-kernel, linux-rtc

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;
 };
 
 static int xlnx_rtc_set_time(struct device *dev, struct rtc_time *tm)
-- 
2.17.1


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

* Re: [PATCH] rtc: xilinx: Fix calibval variable type
  2019-10-08 14:25 [PATCH] rtc: xilinx: Fix calibval variable type Michal Simek
@ 2019-10-08 14:31 ` Alexandre Belloni
  2019-10-11  7:10   ` Michal Simek
  2019-10-14 15:50 ` Alexandre Belloni
  1 sibling, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2019-10-08 14:31 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-kernel, monstr, git, Srinivas Goud, Alessandro Zummo,
	linux-arm-kernel, linux-rtc

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.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] rtc: xilinx: Fix calibval variable type
  2019-10-08 14:31 ` Alexandre Belloni
@ 2019-10-11  7:10   ` Michal Simek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2019-10-11  7:10 UTC (permalink / raw)
  To: Alexandre Belloni, Michal Simek
  Cc: linux-kernel, monstr, git, Srinivas Goud, Alessandro Zummo,
	linux-arm-kernel, linux-rtc

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



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

* Re: [PATCH] rtc: xilinx: Fix calibval variable type
  2019-10-08 14:25 [PATCH] rtc: xilinx: Fix calibval variable type Michal Simek
  2019-10-08 14:31 ` Alexandre Belloni
@ 2019-10-14 15:50 ` Alexandre Belloni
  1 sibling, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2019-10-14 15:50 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-kernel, monstr, git, Srinivas Goud, Alessandro Zummo,
	linux-arm-kernel, linux-rtc

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.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2019-10-14 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08 14:25 [PATCH] rtc: xilinx: Fix calibval variable type Michal Simek
2019-10-08 14:31 ` Alexandre Belloni
2019-10-11  7:10   ` Michal Simek
2019-10-14 15:50 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).