Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6159dd4 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wim Van Sebroeck
Browse files

watchdog: renesas_wdt: avoid (theoretical) type overflow



Because the smallest clock divider we can select is 1, 'clks_per_sec'
must be the same type as 'rate'.

Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 0bade021
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ struct rwdt_priv {
	void __iomem *base;
	struct watchdog_device wdev;
	struct clk *clk;
	unsigned int clks_per_sec;
	unsigned long clks_per_sec;
	u8 cks;
};

@@ -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(&pdev->dev, sizeof(*priv), GFP_KERNEL);