Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5120417yba; Wed, 10 Apr 2019 11:47:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQfmVbrNA7xQ5VgeCfx4ECeL6diCxqImDxnt1UOcA9SP6H3sFL1UnUxsqI0U91t/72RoHN X-Received: by 2002:a63:614c:: with SMTP id v73mr41974927pgb.395.1554922024907; Wed, 10 Apr 2019 11:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554922024; cv=none; d=google.com; s=arc-20160816; b=nXYP/qYPa36yHGdPLPPZS79a4nDUkLBekFsYoukvdR0Tuo9L6DsbkpLes56YOkgYNl OQ5+isjcNveMps3H/EGAn6BpfoHL6VQpG1pj8z6ElAHgdhPHYeWmfZZsObPOoSoQUI9U tHw1rG7ZTPJmxgYwudhSwVIO70zq6Qpgr99BsI0E3tL9PpNMSVVoH9+KM5U4i+/VHwii +P/kL6WzX1Fl5l00DAoP46Wvof4+jSpnFqH2F6X5MIsgwHttQ8v3ZDu7hpA8ZGKw4JMf jHICh8jDw+GbdQtLt6767q0Jq422eHBmn6chtajmePfOOP/YEO1drTHJnU7yxG+Rw+TY MvIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=jsfm7LCM8d51wy7QbSzyHhCcp61nfHGejXB4g2c1IIg=; b=wdlq+K42EEyiyLYOdKf+Z3hgMgU8RZrr5LneHz7Iint96LMj2LXODeoy2J9znSBWsX Q1r4zfl9MAV5+eutw56SgyyTBUv2/+9DJcQsCOa9b3NFyxnnfQpMgZ3sK+hYE0YxhtGQ xz1o1r8LDESEDXqci2aiqAIsilGSzfiGMoxaVMAHj7UnbsELyvPeU4mANuoAgwAH6P1W 9YVIEYCIp81olHlIkoWt5+SZItvXJ9cyTKQRk34oBegA2YVUqX+R3Xr6rX4o7u5goh6q eOldzqnzqT4Bh5RX2u5nfBDnXCQxzmKnHEVZYU+f8Woz/0l1Vkbg0Sw9Vgk+ApiKF/je I1uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=PAV+KB4V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k73si1479649pfb.195.2019.04.10.11.46.49; Wed, 10 Apr 2019 11:47:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=PAV+KB4V; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387898AbfDJQ22 (ORCPT + 99 others); Wed, 10 Apr 2019 12:28:28 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44681 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387860AbfDJQ2W (ORCPT ); Wed, 10 Apr 2019 12:28:22 -0400 Received: by mail-pg1-f194.google.com with SMTP id i2so1845033pgj.11; Wed, 10 Apr 2019 09:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=jsfm7LCM8d51wy7QbSzyHhCcp61nfHGejXB4g2c1IIg=; b=PAV+KB4V+Qdx5iBwU9mDMigyahZjt2ONZB466UKGbiP1Tps2IgtM6SyRuUfi/LRqAL Kkwtw9mOBIOKkG+n644tALN6WTyGbseCF+L7FYOgVCvKEtCL9LyKAEEKPGw7tGJCoKhu ak5xdwvYMggVsEq4JzD0OoOKm0QNVZ8MIKjwPuO48quSZZht2S/YLa4ZUL91rIn8Sj+W YXoEssAQWpOn1EEDGnGDfeA3NGeTh3GOjfl+nUpMoo7jxEesdmY+AKfXFkF27i9XHcC3 whiUl2dvexLxyVaECrvRBIOB89Ymwrmfb/PfkItHEObZI7uXBCUJpysRElf0IYi8YKhz aCVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=jsfm7LCM8d51wy7QbSzyHhCcp61nfHGejXB4g2c1IIg=; b=gK9o+VEAToxWNHKhx8JswjyItx5MJcLc6RDXBN2j6+WNwrUQJlTXK4uBDSRPXAw6W2 Wq/+lXUCa+WUbPagdivPC89xBLoYIaAWZQjAtSYn56hg+8Gv38i22Rd+HedwK5wo64Ry W74wjyDFnwRNcoOj8lGZlBazAqkS+RBtMT7e77vjRZiRvhC5NtuX8kwrQXqzFh2y5T0o j+jGBQj+qiFxagrq7CBg6NYnHP5acOpnoYd6banfyEcS1eUIWH/i/iEpt3vr3uY9hNUB OouUcNittmsdFX4f7o2mnP2f2trzGOr33QddYcOB81/FVIDxU/nRaIGAgh9pkj7cXJHk +dcA== X-Gm-Message-State: APjAAAUE0w/An/nRYj5J5OCn5RcNHHMSUMzFcO1GBdDimHH0xcaIW6F4 xs76M829/tY/xd3ciSAobHM= X-Received: by 2002:a65:5304:: with SMTP id m4mr41319400pgq.281.1554913702000; Wed, 10 Apr 2019 09:28:22 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d38sm42024691pgd.40.2019.04.10.09.28.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 09:28:21 -0700 (PDT) From: Guenter Roeck To: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Subject: [PATCH 10/22] watchdog: imx_sc_wdt: Use 'dev' instead of dereferencing it repeatedly Date: Wed, 10 Apr 2019 09:27:51 -0700 Message-Id: <1554913683-25454-11-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554913683-25454-1-git-send-email-linux@roeck-us.net> References: <1554913683-25454-1-git-send-email-linux@roeck-us.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce local variable 'struct device *dev' and use it instead of dereferencing it repeatedly. The conversion was done automatically with coccinelle using the following semantic patches. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Guenter Roeck --- drivers/watchdog/imx_sc_wdt.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c index 86c2722f2a09..d154f66e659a 100644 --- a/drivers/watchdog/imx_sc_wdt.c +++ b/drivers/watchdog/imx_sc_wdt.c @@ -101,10 +101,11 @@ static const struct watchdog_info imx_sc_wdt_info = { static int imx_sc_wdt_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct watchdog_device *imx_sc_wdd; int ret; - imx_sc_wdd = devm_kzalloc(&pdev->dev, sizeof(*imx_sc_wdd), GFP_KERNEL); + imx_sc_wdd = devm_kzalloc(dev, sizeof(*imx_sc_wdd), GFP_KERNEL); if (!imx_sc_wdd) return -ENOMEM; @@ -114,19 +115,19 @@ static int imx_sc_wdt_probe(struct platform_device *pdev) imx_sc_wdd->ops = &imx_sc_wdt_ops; imx_sc_wdd->min_timeout = 1; imx_sc_wdd->max_timeout = MAX_TIMEOUT; - imx_sc_wdd->parent = &pdev->dev; + imx_sc_wdd->parent = dev; imx_sc_wdd->timeout = DEFAULT_TIMEOUT; - ret = watchdog_init_timeout(imx_sc_wdd, 0, &pdev->dev); + ret = watchdog_init_timeout(imx_sc_wdd, 0, dev); if (ret) - dev_warn(&pdev->dev, "Failed to set timeout value, using default\n"); + dev_warn(dev, "Failed to set timeout value, using default\n"); watchdog_stop_on_reboot(imx_sc_wdd); watchdog_stop_on_unregister(imx_sc_wdd); - ret = devm_watchdog_register_device(&pdev->dev, imx_sc_wdd); + ret = devm_watchdog_register_device(dev, imx_sc_wdd); if (ret) { - dev_err(&pdev->dev, "Failed to register watchdog device\n"); + dev_err(dev, "Failed to register watchdog device\n"); return ret; } -- 2.7.4