Linux-RTC Archive on lore.kernel.org
 help / color / 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	[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, back to index

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

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org
	public-inbox-index linux-rtc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git