summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAbhishek Tamboli <abhishektamboli9@gmail.com>2024-08-09 21:26:31 +0530
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2024-09-12 00:36:53 +0200
commit60a06efc56d7d336d13fae58f9e90c8a4e21619e (patch)
tree2e304e5fecf56ed8c2df953f078ad2aa37d292f4 /tools
parent73580e2ee6adfb40276bd420da3bb1abae204e10 (diff)
rtc: m48t59: Remove division condition with direct comparison
Replace 'year / 100' with a direct comparison 'year >= 100' in m48t59_rtc_set_time() function. Improve the code clarity and eliminate division overhead. Fix the following smatch warning: drivers/rtc/rtc-m48t59.c:135 m48t59_rtc_set_time() warn: replace divide condition 'year / 100' with 'year >= 100' Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com> Link: https://lore.kernel.org/r/20240809155631.548044-1-abhishektamboli9@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions
y='diffstat' class='diffstat'>-rw-r--r--drivers/gpio/gpio-bd9571mwv.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/gpio/gpio-bd9571mwv.c b/drivers/gpio/gpio-bd9571mwv.c
index df6102b57734..9a4d55f703bb 100644
--- a/drivers/gpio/gpio-bd9571mwv.c
+++ b/drivers/gpio/gpio-bd9571mwv.c
@@ -97,25 +97,16 @@ static const struct gpio_chip template_chip = {
static int bd9571mwv_gpio_probe(struct platform_device *pdev)
{
struct bd9571mwv_gpio *gpio;
- int ret;
gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
if (!gpio)
return -ENOMEM;
- platform_set_drvdata(pdev, gpio);
-
gpio->regmap = dev_get_regmap(pdev->dev.parent, NULL);
gpio->chip = template_chip;
gpio->chip.parent = pdev->dev.parent;
- ret = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
- if (ret < 0) {
- dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
- return ret;
- }
-
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
}
static const struct platform_device_id bd9571mwv_gpio_id_table[] = {