Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5128691yba; Wed, 10 Apr 2019 12:00:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzHw2KFzhDxpifCmnvqKxH6RWHwakwKniaYhk/k3yRwUU+7aMNhlDEKZoU/r06wg3GjJ20 X-Received: by 2002:aa7:9a89:: with SMTP id w9mr37598246pfi.213.1554922825145; Wed, 10 Apr 2019 12:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554922825; cv=none; d=google.com; s=arc-20160816; b=AhIeDTcOJW2uuO2BAw8SC1uPBSZhwoehUNdMUzA3tfB12yDKT3qqDTxUdST/7ZhuOF Y3KiMUchcEJJVyJU74WOvMHym9AlvMpixVaaW27NJMFnCnOacCt0s1U1sh1mC/Vf7a8q 8otaW5bHaGF7FhSplnS54st8ylGiLAGr5moPhX7Q5WY0iTMBQ0/THtIyj8CYIAYtCG50 NMEM5Tsv1MsJyz/0hNf8OBM1kFGnmUsRS6tllAwTg0jSTahLCXVGAIQaJJ1pCiDoczyn Jig6dFYtNrplfycQqYVEsHovMfESqZD6Z+k328C+FJnWCgMsJjjThTXUBwYWD/PfRz6D Hoag== 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=+OYZTkxC1btQoTo+CXY+tiiGNBQ6X0e0abBF8L5gRR4=; b=p4fjPILnhf4HzkRhEscvq/Xxom540yPgetGl8ybaNrFMxxE0P0LC6LJsHLN/1fMSA0 LybAehywrRIE11E6fmjEjKU9Z5aQqJmACFbBht+rIE820x7livFMNlqlrwd/q0oRdlpr /uCJS0Eh0+u1lbM1klayqwAKrooI7QBto7xd6pTH885Y+gTvM6BwyGCiHZfMIvWTxvO/ CxRzxQ2cT26iuE55kwW51iKTQjfENS+bdHHh6yuSc60mG6eK/qpmos9TaZL/G/wvSNdO 1/OykPLReck8MY8ef8EHP+lFaZKeVq9eeEvyoB3LdaseDQwv+HxB5P/qCQz7rWj1P6pe 6rLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=u3I1vWgI; 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 j187si15895636pfc.181.2019.04.10.12.00.08; Wed, 10 Apr 2019 12:00:25 -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=u3I1vWgI; 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 S2387993AbfDJQ3s (ORCPT + 99 others); Wed, 10 Apr 2019 12:29:48 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:37280 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387855AbfDJQ2V (ORCPT ); Wed, 10 Apr 2019 12:28:21 -0400 Received: by mail-pl1-f195.google.com with SMTP id w23so1736640ply.4; Wed, 10 Apr 2019 09:28:20 -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=+OYZTkxC1btQoTo+CXY+tiiGNBQ6X0e0abBF8L5gRR4=; b=u3I1vWgIYAG1nPvzX26Da5tisPuNKB9cxwqh1pMkGSbCPoBJBp6tZQTS3go9ZrYbyt y2jNQKjFXDsVC9OIiEnrK932Nh2sfkXubCpxzcf/joQrXfSfIzqeYW3z3m2GTFtCwSAI zLFW3D5cNam26XALxRMRsEEbR1BQkSQGHHlj7lA7qCu09iKlMB9Z4HxTLVb3SfHR11ME FMarREPQH8X0YKuuSgnbi3Ecwh0qj0lOc5giip+kBpRZfsij8xCkhXDpNUAbncDApulQ C3c8bRCMN5mxrDBXp2lbIQptjrnGMRx8uAAQq/qmIM8VsNnSJKcfCa62z8VX0nOwDTSS jfkw== 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=+OYZTkxC1btQoTo+CXY+tiiGNBQ6X0e0abBF8L5gRR4=; b=ITTeloJN7g/G5ihv86KB+S255h6+8+mn8rG4Ysr4Nvg7h+suWfc+kynKYp0GN/5XEl /r/vMIuSL5wBD3+io2S1eK1j+f7XZ6lkRDmD9YgXzUzX4HjXSPm0spZMwnEgORHlc3iE c4HOCSug9tx5n0aBpNJXljVtFFhcxNYVBKfQd1i8noGXDubjN+ETSPnWmJiFsZkjLd2B 6dK8fYpwP8YN5pkqcoDebaAL36nvefWD/bMtMU3oszcXvEnx6YIfWr9WG0vMBtspPjC7 7h3LVtvL+jXo/aJ5lhVaU1TsBYgeKpjztnQhnMRpZxACGpHDX3vedtntVj+zxwzm50PP 0Rgw== X-Gm-Message-State: APjAAAWemLFcyD//LuHkfXegcuD4Q0Y9y8wQcbomVVk940krJd668hnS MASSANlteUuJehAH/y4p+D7NHsGt X-Received: by 2002:a17:902:362:: with SMTP id 89mr45258536pld.172.1554913700597; Wed, 10 Apr 2019 09:28:20 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id m2sm59541605pgr.74.2019.04.10.09.28.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 09:28:19 -0700 (PDT) From: Guenter Roeck To: Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH 09/22] watchdog: xen_wdt: Use 'dev' instead of dereferencing it repeatedly Date: Wed, 10 Apr 2019 09:27:50 -0700 Message-Id: <1554913683-25454-10-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/xen_wdt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/watchdog/xen_wdt.c b/drivers/watchdog/xen_wdt.c index f1c016d015b3..6c1ca1f31cbc 100644 --- a/drivers/watchdog/xen_wdt.c +++ b/drivers/watchdog/xen_wdt.c @@ -122,35 +122,35 @@ static struct watchdog_device xen_wdt_dev = { static int xen_wdt_probe(struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct sched_watchdog wd = { .id = ~0 }; int ret = HYPERVISOR_sched_op(SCHEDOP_watchdog, &wd); if (ret == -ENOSYS) { - dev_err(&pdev->dev, "watchdog not supported by hypervisor\n"); + dev_err(dev, "watchdog not supported by hypervisor\n"); return -ENODEV; } if (ret != -EINVAL) { - dev_err(&pdev->dev, "unexpected hypervisor error (%d)\n", ret); + dev_err(dev, "unexpected hypervisor error (%d)\n", ret); return -ENODEV; } if (watchdog_init_timeout(&xen_wdt_dev, timeout, NULL)) - dev_info(&pdev->dev, "timeout value invalid, using %d\n", - xen_wdt_dev.timeout); + dev_info(dev, "timeout value invalid, using %d\n", + xen_wdt_dev.timeout); watchdog_set_nowayout(&xen_wdt_dev, nowayout); watchdog_stop_on_reboot(&xen_wdt_dev); watchdog_stop_on_unregister(&xen_wdt_dev); - ret = devm_watchdog_register_device(&pdev->dev, &xen_wdt_dev); + ret = devm_watchdog_register_device(dev, &xen_wdt_dev); if (ret) { - dev_err(&pdev->dev, "cannot register watchdog device (%d)\n", - ret); + dev_err(dev, "cannot register watchdog device (%d)\n", ret); return ret; } - dev_info(&pdev->dev, "initialized (timeout=%ds, nowayout=%d)\n", - xen_wdt_dev.timeout, nowayout); + dev_info(dev, "initialized (timeout=%ds, nowayout=%d)\n", + xen_wdt_dev.timeout, nowayout); return 0; } -- 2.7.4