Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5131260yba; Wed, 10 Apr 2019 12:03:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLbPB02OSIn8owiy+msoeGrr8DrVXkvO/PDrXaUio80QaDWFbxR6J58ELNsDmwpqSkXE+o X-Received: by 2002:a17:902:201:: with SMTP id 1mr45783909plc.89.1554922993286; Wed, 10 Apr 2019 12:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554922993; cv=none; d=google.com; s=arc-20160816; b=ZLzWk1BfKv4phVd9JJj27B8EjYEPy3QJiSgSclpPVQXYUMmJLqqpbqYh1p6S7huMd2 nIpqaKNB3SO6K6UjKgmSlblPSKDaleH8FAkLXGPrl7NQFBZzFhKfgGvcBZ8R8kRCTZBN RUbGWQRsSCBy/3XczFSc5tY5mWmNRwq8h7hCHnZd6UiCZNkxFffbgI+nJlvSEKWYkyN7 bujd2KWi6cuPZJEgOeC+VwmJqrD+omlVFUNw532bMNWUCZ4Zp/IQc5eMm5lYmp7SfgbH rlZou/HJsyB5CtqKVJko+17NqzNkclfiwS9sxekvmhcIRn5dsxGYdEr45Z0ROsvl1GKj 4T4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=0KNrWmZwIg8uhlbfEIwCwy0Xzg0nNNcKNV3Rvp8PVzw=; b=eCdgo2EX79vGY02xpYYap76yMDWMj9qbtjmZSj5y2asrpGCszm7bKr8RBFtnH6GIy1 9D3xn0/0LZ6BQqHPE6Y58nWk4uwqQSfNs2M0P723+g6vnIgTEgdGw2zs2y40A6BFz4si 2gPFUeHw2/7ngDdSB29QjV1OBT6o0BvG7XBLL5KbgfSLDSjn2ySYtxXlyIhs1LCYpP/x ymuII0Y39MRcKJ2oPdsJAOPZYPaKLGZokm+LEpVOEBu8xJumERank3WszrcI87aJyMPu 1/HktFuUyIgzf0POMKCqC3kL2uNtOq0Von4wtCeMExqLZ/p2DCQPGFOR3TM5JdyrN2PR L6Yg== ARC-Authentication-Results: i=1; mx.google.com; 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 3si18416117plo.300.2019.04.10.12.02.57; Wed, 10 Apr 2019 12:03:13 -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; 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 S2388088AbfDJQwO (ORCPT + 99 others); Wed, 10 Apr 2019 12:52:14 -0400 Received: from smtprelay0085.hostedemail.com ([216.40.44.85]:43372 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727020AbfDJQwO (ORCPT ); Wed, 10 Apr 2019 12:52:14 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 3B6D6180A8140; Wed, 10 Apr 2019 16:52:12 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:599:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3873:4321:5007:6119:8660:9038:10004:10400:10848:11026:11232:11473:11658:11914:12043:12296:12438:12740:12760:12895:13069:13148:13230:13255:13311:13357:13439:14659:14721:21080:21627:30046:30054:30091,0,RBL:23.242.196.136:@perches.com:.lbl8.mailshell.net-62.8.0.180 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:31,LUA_SUMMARY:none X-HE-Tag: form68_1316c4b4e991e X-Filterd-Recvd-Size: 2021 Received: from XPS-9350 (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA; Wed, 10 Apr 2019 16:52:11 +0000 (UTC) Message-ID: <8d44aaf119c286ac18ead30a2174aecef2dbc7e2.camel@perches.com> Subject: Re: [PATCH 20/22] watchdog: jz4740_wdt: Use 'dev' instead of dereferencing it repeatedly From: Joe Perches To: Guenter Roeck , Wim Van Sebroeck Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 10 Apr 2019 09:52:09 -0700 In-Reply-To: <1554913683-25454-21-git-send-email-linux@roeck-us.net> References: <1554913683-25454-1-git-send-email-linux@roeck-us.net> <1554913683-25454-21-git-send-email-linux@roeck-us.net> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-04-10 at 09:28 -0700, Guenter Roeck wrote: > Introduce local variable 'struct device *dev' and use it instead of > dereferencing it repeatedly. Also, there is no call to dev_get_drvdata() > or platform_get_drvdata() in the driver, so drop the unnecessary > call to platform_set_drvdata(). Dropping platform_set_drvdata seems to me like it should be a separate patch. And are you sure no other function uses a get_drvdata call? Maybe something in watchdog_dev.c? Possibly: #ifdef CONFIG_WATCHDOG_SYSFS static ssize_t nowayout_show(struct device *dev, struct device_attribute *attr, char *buf) { struct watchdog_device *wdd = dev_get_drvdata(dev); return sprintf(buf, "%d\n", !!test_bit(WDOG_NO_WAY_OUT, &wdd->status)); } static DEVICE_ATTR_RO(nowayout); > diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c [] > @@ -189,18 +190,16 @@ static int jz4740_wdt_probe(struct platform_device *pdev) [] > - platform_set_drvdata(pdev, drvdata); > - > return 0; > } >