Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5138975yba; Wed, 10 Apr 2019 12:12:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyO1Hyb0ZYi9CWYwawhtVXprCUS9zvH7gPzfRGCsj7/aopTo9QEoM9nvBEmRBLGG+CcPAgR X-Received: by 2002:a17:902:2907:: with SMTP id g7mr10960713plb.238.1554923561599; Wed, 10 Apr 2019 12:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554923561; cv=none; d=google.com; s=arc-20160816; b=sBIMOUWogFm9FrWJsHCMgC6tpjD/F3e3sunmanGuTD045DoLZ2/Ffakz2Dc2jFKLBl ScJXMXNlI5su3U5eGTeIb+jL1APP7Lg/SKQo/B+axIhLSViqs4RB+JcUOdjCu5XMk0hY 5NV+6yqOZlRdLzd2eNHZlOrsxfFlgIMunSJyLvLWOAQT7AeesQOtAwD7VxxsKYJQiJBJ iNPyapSkieHWVDtsyU3zfqKIJloQ9mC64wNXWea/T7CVNK33ErrIaryIjTfAyhQuYOJZ j2ASncAar2vlfEH6Yf/P97Sf83S18XJHfW59FcwkU9kZfrWfV+VztLFf8i9ra1bf4VoU 40zg== 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=ICNIvV10TWVFBw+xAo1sdDQVo9Krw/iZzKAEcC67d+M=; b=Hg17UKy46C11p7cPBlaCBJeRY9h82dy6Jw6vt5oHlIOZc6DMxxg2fVq37vFfLU/o6+ rznMao5dD6tVgmLEnspUgN2TdQsG048/uOjFG8pCSYhQ7urQH+eRuE8iHkuaUSHqVF2o mcv9e8vCAEEARIzV9B98y5c5vUdu5P5wMamERMAC3zEAGarCGMYdG9GZ54BMFPi9d0+T TOKaMO8BHIWKF5HzG6xCZhs5WbPkF5qiiuFlAWqT+6c+IbvlPqw5/nwn4WgDi8aTdSAG W9mVEAmbxThYoCF0pf/k+JVS4PTKX0wPkNcThlSNDQYd0W9016WjElOvT7wMJXRiCe4C 6jtA== 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 l39si33959324plb.143.2019.04.10.12.12.24; Wed, 10 Apr 2019 12:12:41 -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 S1731571AbfDJSqb (ORCPT + 99 others); Wed, 10 Apr 2019 14:46:31 -0400 Received: from smtprelay0250.hostedemail.com ([216.40.44.250]:37730 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728881AbfDJSq2 (ORCPT ); Wed, 10 Apr 2019 14:46:28 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 95AF6182CF668; Wed, 10 Apr 2019 18:46:27 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:599:967:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2559:2564:2682:2685:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:9025:9038:10004:10400:10848:11026:11232:11658:11914:12043:12296:12438:12740:12760:12895:13069:13141:13230:13255:13311:13357:13439:13845:14181:14659:14721:14819:21080:21433:21451:21627:30054:30091,0,RBL:error,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:129,LUA_SUMMARY:none X-HE-Tag: news29_8f85f0d775256 X-Filterd-Recvd-Size: 2047 Received: from XPS-9350.home (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Wed, 10 Apr 2019 18:46:26 +0000 (UTC) Message-ID: Subject: Re: [PATCH 18/22] watchdog: mt7621_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, Matthias Brugger Date: Wed, 10 Apr 2019 11:46:24 -0700 In-Reply-To: <1554913683-25454-19-git-send-email-linux@roeck-us.net> References: <1554913683-25454-1-git-send-email-linux@roeck-us.net> <1554913683-25454-19-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:27 -0700, Guenter Roeck wrote: > 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 Interesting collection. It would be useful to specify which particular script generated or enabled this patch. Just scanning briefly, it might have been this one: https://github.com/groeck/coccinelle-patches/blob/master/common/deref.cocci But it looks like some manual bit might have been required too. And trivially: > diff --git a/drivers/watchdog/mt7621_wdt.c b/drivers/watchdog/mt7621_wdt.c [] > @@ -133,18 +133,19 @@ static struct watchdog_device mt7621_wdt_dev = { [] > watchdog_init_timeout(&mt7621_wdt_dev, mt7621_wdt_dev.max_timeout, > - &pdev->dev); > + dev); This could be on one line.