Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5135411yba; Wed, 10 Apr 2019 12:08:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYKHzLFFmOEXC22n3gzgVWVWXo8Mk7FTJ4PbeDMv1q5JoTCkGJ1a4COPqGJNs9A1c20nID X-Received: by 2002:a63:750c:: with SMTP id q12mr43378041pgc.133.1554923303154; Wed, 10 Apr 2019 12:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554923303; cv=none; d=google.com; s=arc-20160816; b=bGzIhHiJCv/Gv8J4QgOSD+ggIHkboPypw1/R883Iwq39gp5oVw9MBiOeTJk5R8Q9zE AP/JuM2g92V+wQkiGfeSBzHWW8blDscghg1F8X4oiOT1IYbUqF7Egh2yo45Fj6plvk6w 7v8yuDjmQ+PZUetghoyVZSzQQeuOjA3SWyWi6wFeYED1ii8V6rmDk7fuu6s27E3/PWOw +Clco62euF5BEJF5qG6A/CT6vHGXXs+JnBTeDzP3RjW7M7acALn0VBqc0mW1mgmhkTA9 1yh54u5VUFFr1FN8thBiC4dkmdwAuikhNsK62Oba061bUyHSN+ngX5ynqFZdrBtBV+GV 9jLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=q91V6OmvTc/Auau73Rj+pKcqo7v9MnUkZAtPss1ug4I=; b=u3B47jU6VYXtHVUtX97PNDVDl0daKhlUlS/hDjTgj4Iju8ZYtLK7lxWef06f4fvclH kOq8YhbXOOEkCMfUXWz4OVFlfyLEpTDxMSPNHtDJ7S8vv/5LAwXCfCjcC9dJQcBub35X IUSgb6UT8wYcCwqtS2XSraR+ltK8aXNhXXr+lQBr49fw3qQ4z+kNgPp/frKDESDZ9ONC 1hRd10HWKRpr/SBJ9+6T2jr6O+OKpwDrg2hAIXKZlRsv+MOpznaKXs4nt2XOOxXa3wqH 6nynP72fhe4is060P39qcTti0L+fANOw25cdkd0eeY0BCrpd4iYcbNqkZHfv5UFSu/2o XX1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YB1V+Vju; 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 j17si31610691pgk.114.2019.04.10.12.08.07; Wed, 10 Apr 2019 12:08:23 -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=YB1V+Vju; 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 S1730122AbfDJRru (ORCPT + 99 others); Wed, 10 Apr 2019 13:47:50 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44883 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729867AbfDJRru (ORCPT ); Wed, 10 Apr 2019 13:47:50 -0400 Received: by mail-pf1-f193.google.com with SMTP id y13so1905213pfm.11; Wed, 10 Apr 2019 10:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=q91V6OmvTc/Auau73Rj+pKcqo7v9MnUkZAtPss1ug4I=; b=YB1V+VjuphtRDq7v9hUSJyTgkK+JHhanAS2uy+zLHxwxYuGMOFqyBeMEt7ey8aC93G ok9zrdBo128qpJ0wxvPvclCyUBy/SRPQeknSUpJ6CQzNHqCAPV4LBrTzQH5g6c/Tbpkq jTlXBtJ8Vnw5CLFGNY3uEifZFDI9MQ/3Z+/M24u/ACfXtc/TtDpKkvwx3chMzOgmgcBk uYDxmBAw6AylDG2NWSFqLqaDqTSZK4jO+zZFtf/JnsnGs4410qmGGpyHgh1ltNKUKYYD DQKMo1eH21IaV+/rJrpk6kGcGQg79aIPM8xD0jAgMMnABrQt60JAwduwzUVLBa9BJeRb LgVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=q91V6OmvTc/Auau73Rj+pKcqo7v9MnUkZAtPss1ug4I=; b=OVmlJSFSURk9Xdo/mtE14rOvars6KIJgNADK3qMp/thL+RGJLF+X462SHRT3GyJNqY E7ruZwrtFqmzJw19ziiRMpFIQhKRzYQkBbE26CelURtDZlgAGvpIhcvQ01uCf5HDkkqn fj0maJGof1lMFeutgR7ifOFubeyGjPpYyL/e+uEX84O9h79IiRZVdSZ1iXz+nupIo/gy nA4WOBRablsiT9qixpCQz22hQbHSjEr7PU76+lzjZRzzk9tM8cF6tk3iLgxHlLQvmpj/ BEgQQ5kjub8crLxoQdO2Oh5VeRpeZHEhiFZgC2yOVXydcJ8MlHZpgXffYQ3tig3Ngn9S GrvQ== X-Gm-Message-State: APjAAAUQfoRM1/Gbqzz7CCiRO4XUswUUCW4Ff1etmgiO3vY/mK9tMVDv 2IM7iGI2gY7WK6BuybFGrms= X-Received: by 2002:a62:304:: with SMTP id 4mr44113960pfd.99.1554918469647; Wed, 10 Apr 2019 10:47:49 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id v19sm65644840pfa.138.2019.04.10.10.47.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 10:47:48 -0700 (PDT) Date: Wed, 10 Apr 2019 10:47:46 -0700 From: Guenter Roeck To: Joe Perches Cc: Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 20/22] watchdog: jz4740_wdt: Use 'dev' instead of dereferencing it repeatedly Message-ID: <20190410174746.GA2132@roeck-us.net> References: <1554913683-25454-1-git-send-email-linux@roeck-us.net> <1554913683-25454-21-git-send-email-linux@roeck-us.net> <8d44aaf119c286ac18ead30a2174aecef2dbc7e2.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8d44aaf119c286ac18ead30a2174aecef2dbc7e2.camel@perches.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joe, On Wed, Apr 10, 2019 at 09:52:09AM -0700, Joe Perches wrote: > 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. > Bundling all changes into one patch per driver already resulted in more than 60 patches total in this series. Splitting that into three sets of patches over three days already earned me automated replies telling me that I am now considered to be a spammer. One logical change per patch would have resulted in hundreds of patches. I don't think that would have scaled well. I considered other splits, such as one coccinelle rule per patch, affecting multiple drivers, but that would have had the same result since it would have needed dozens of Cc: lines per patch. Ultimately, I decided to go with one patch per file. > 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); > 'dev' in nowayout_show() points to the watchdog device, not to the platform device. Its drvdata is set in drivers/base/core.c:device_create_groups_vargs(). Not all watchdog drivers are platform drivers, and the watchdog core can not depend on a watchdog device even having a parent device, much less make assumptions about its drvdata. Guenter