Re: [PATCH 1/5] watchdog: renesas_wdt: avoid (theoretical) type overflow

2017-07-18 Thread Guenter Roeck

On 07/18/2017 12:21 AM, Wolfram Sang wrote:

-   unsigned long rate;
-   unsigned int clks_per_sec;
+   unsigned long rate, clks_per_sec;


If you make this change, you should also update rwdt_priv.clks_per_sec
(yes I know it's removed in a later patch in this series).


Right. I will change but also wait a bit for more comments.



I for my part don't have any. Feel free to add

Reviewed-by: Guenter Roeck 

to the series when you resend.

Thanks,
Guenter


Re: [PATCH 1/5] watchdog: renesas_wdt: avoid (theoretical) type overflow

2017-07-18 Thread Wolfram Sang
> > -   unsigned long rate;
> > -   unsigned int clks_per_sec;
> > +   unsigned long rate, clks_per_sec;
> 
> If you make this change, you should also update rwdt_priv.clks_per_sec
> (yes I know it's removed in a later patch in this series).

Right. I will change but also wait a bit for more comments.

Thanks!



signature.asc
Description: PGP signature


Re: [PATCH 1/5] watchdog: renesas_wdt: avoid (theoretical) type overflow

2017-07-18 Thread Geert Uytterhoeven
Hi Wolfram,

On Mon, Jul 17, 2017 at 5:12 PM, Wolfram Sang
 wrote:
> Because the smallest clock divider we can select is 1, 'clks_per_sec'
> must be the same type as 'rate'.
>
> Signed-off-by: Wolfram Sang 

Thanks for your patch!

> --- a/drivers/watchdog/renesas_wdt.c
> +++ b/drivers/watchdog/renesas_wdt.c
> @@ -112,8 +112,7 @@ static int rwdt_probe(struct platform_device *pdev)
>  {
> struct rwdt_priv *priv;
> struct resource *res;
> -   unsigned long rate;
> -   unsigned int clks_per_sec;
> +   unsigned long rate, clks_per_sec;

If you make this change, you should also update rwdt_priv.clks_per_sec
(yes I know it's removed in a later patch in this series).

> int ret, i;
>
> priv = devm_kzalloc(>dev, sizeof(*priv), GFP_KERNEL);

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


[PATCH 1/5] watchdog: renesas_wdt: avoid (theoretical) type overflow

2017-07-17 Thread Wolfram Sang
Because the smallest clock divider we can select is 1, 'clks_per_sec'
must be the same type as 'rate'.

Signed-off-by: Wolfram Sang 
---
 drivers/watchdog/renesas_wdt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index cf61c92f7ecd63..4f8a3563b6aa53 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -112,8 +112,7 @@ static int rwdt_probe(struct platform_device *pdev)
 {
struct rwdt_priv *priv;
struct resource *res;
-   unsigned long rate;
-   unsigned int clks_per_sec;
+   unsigned long rate, clks_per_sec;
int ret, i;
 
priv = devm_kzalloc(>dev, sizeof(*priv), GFP_KERNEL);
-- 
2.11.0