Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5119494yba; Wed, 10 Apr 2019 11:45:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7pMt+hgjjNTTUyZb4aB8VlPdhe9Gh77Vz4Ha9FLeNJZsa8pvUFlkNqBp+oEK1QwTKZ8uq X-Received: by 2002:a63:fa46:: with SMTP id g6mr41859032pgk.382.1554921944031; Wed, 10 Apr 2019 11:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554921944; cv=none; d=google.com; s=arc-20160816; b=uUDZt3TZkNvmM1QomQ3xAEp1DsECn/GZ5PSxwi6FwkPJm2SoaJseEtTDdHTuhrqsOV OHQZi5iH7tbl5CEHKaMatFXQ/dy+i2hga5aDYiNi53Mm9FnKxZ+KMNSDh7DQQBjVzY9U ObqegOVEW2x5PyXXlquizHc/VqLAcxh5Rk4Lgc69rnJniamZWMF38PfvQ9qp+AaZG9PX 3c9gm1cRcnQl91b0gaDoyqnhGK7JlDMuw6JAkXCUBuJ3Xb6Ow6R4nNCimL/5KuySJAHN lBr2U1uq/pZxGCEHVymPnElBDs5t1N5nM7KeS3Rkksp1wKVyFgtdc8jM640sveBp9H9L 9CHg== 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=3medKjGV47ZOPN+yjhvR37qQjE3neDO4pCs+uQdUuow=; b=oPtu29pkGU2cC1Xp96Hr4sOazB1EaIDBtejTWE1ENDiIGuWuZqwAMMWdAWti+J+KQ6 xlpJ54ZMzJcT+R1Nk4npnslrOuMCT/zJMGzdUGYmGXluL9KPkwQum5CJzKwLXcAtWdQw U5OfmtEM7GM6kA/eYhPdp31YPg5vO0jfneZmdA/pL06QfaXzL7ADREJPEbcHyD5TK6vX DL91qjV/mPucydi7IIFpgk5cUd6s51iY+f9jOr/RMsC4ej7jtQoD+onma8sSgQJvw/U3 /AH5lAvbR1YUd4bVqNe+GxR07YO2xgEbgfZiSrXrgKStnSlFp1e8lKO1NZ5058m2UDXQ 0qZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=SiLoy+uv; 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 az5si31414782plb.111.2019.04.10.11.45.28; Wed, 10 Apr 2019 11:45:44 -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=SiLoy+uv; 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 S2387873AbfDJQ2Y (ORCPT + 99 others); Wed, 10 Apr 2019 12:28:24 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45066 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387813AbfDJQ2O (ORCPT ); Wed, 10 Apr 2019 12:28:14 -0400 Received: by mail-pg1-f196.google.com with SMTP id y3so1841775pgk.12; Wed, 10 Apr 2019 09:28:13 -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=3medKjGV47ZOPN+yjhvR37qQjE3neDO4pCs+uQdUuow=; b=SiLoy+uv58kts4jBEs48iVumvE/HLvagIxBjXPUYtsQfKZqe5qcnM2+ig+ooKiSkFn E4gpQViNBSDQtQ3aI6Vg3lsVguei+TftF02nCcUy4IaSZxkddkgNWK3cE8B5RxAHiGZW OcmAx99CJ8QpL+kLOikMEi0fGtQmjAwAnjDrg5Jx3Ju1Ui9wOJ/bYaVEplEIwAP1+8/r uI54dkYcR8NQZZY/prbkdhUPq78mEmIm7P+s6jKZl8LtSQCAP7cIwMHyBq+WgZCvVGQ0 AMtmTqXU/jnAiQcDL9vgJzxmHng+xOSEx2h9y0FoYaXvd5u9OFQjP9KSLreNQ389k1ng fBMQ== 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=3medKjGV47ZOPN+yjhvR37qQjE3neDO4pCs+uQdUuow=; b=VEN6hN7Mh5K4kNiLMsusNXgX1qiV3Mzkg0o6yeimR38zBta6g8PM4hJR84gHoQM6q6 S77eWxjKUCvbT0/6/37kYcuRqjEwXoeHisxwM4DEcvDEILHPfo98NUL28PzEfvBL4Zek CzbKm1cQL8XA6GP13y27yUX6UK/foN5IZYnp+KJ32eUSp3U/Ct4IRm12bqkRI5NUT702 a4XdC/w9J4UDLFgD645i8ysKGgcMVYpH92s4F4u0m/3QcoyiY1kWHUNBD9zPFo8HiHn5 JR6WSupG/HmJtQd+sgg+SXhrY0BGvIJoTQUZoSlQ5hXC/QIz/66/6lqWJTkqv+KBLoNa UjEQ== X-Gm-Message-State: APjAAAV/JVnt/tsrcydxkVSpyaOAmhpVxOJRbWCnZGM378C/8fE/5bbJ RBFuSUS5tSclFJkrq5lkAksw1aVW X-Received: by 2002:a63:6849:: with SMTP id d70mr41635996pgc.21.1554913693429; Wed, 10 Apr 2019 09:28:13 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id k124sm61321660pgc.65.2019.04.10.09.28.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 09:28:12 -0700 (PDT) From: Guenter Roeck To: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH 04/22] watchdog: ts72xx_wdt: Use 'dev' instead of dereferencing it repeatedly Date: Wed, 10 Apr 2019 09:27:45 -0700 Message-Id: <1554913683-25454-5-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 Signed-off-by: Guenter Roeck --- drivers/watchdog/ts72xx_wdt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/watchdog/ts72xx_wdt.c b/drivers/watchdog/ts72xx_wdt.c index 3aa11c84dea9..bf918f5fa131 100644 --- a/drivers/watchdog/ts72xx_wdt.c +++ b/drivers/watchdog/ts72xx_wdt.c @@ -122,11 +122,12 @@ static const struct watchdog_ops ts72xx_wdt_ops = { static int ts72xx_wdt_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct ts72xx_wdt_priv *priv; struct watchdog_device *wdd; int ret; - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -143,20 +144,20 @@ static int ts72xx_wdt_probe(struct platform_device *pdev) wdd->ops = &ts72xx_wdt_ops; wdd->min_timeout = 1; wdd->max_hw_heartbeat_ms = 8000; - wdd->parent = &pdev->dev; + wdd->parent = dev; watchdog_set_nowayout(wdd, nowayout); wdd->timeout = TS72XX_WDT_DEFAULT_TIMEOUT; - watchdog_init_timeout(wdd, timeout, &pdev->dev); + watchdog_init_timeout(wdd, timeout, dev); watchdog_set_drvdata(wdd, priv); - ret = devm_watchdog_register_device(&pdev->dev, wdd); + ret = devm_watchdog_register_device(dev, wdd); if (ret) return ret; - dev_info(&pdev->dev, "TS-72xx Watchdog driver\n"); + dev_info(dev, "TS-72xx Watchdog driver\n"); return 0; } -- 2.7.4