linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Vincent Pelletier <plr.vincent@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Support Opensource <support.opensource@diasemi.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Opensource [Steve Twiss]" <stwiss.opensource@diasemi.com>
Subject: Re: [PATCH v3 2/3] hwmon: da9063: HWMON driver
Date: Sat, 10 Jul 2021 22:45:44 -0700	[thread overview]
Message-ID: <3a2f0b72-f790-435b-ebae-6b1afd19f707@roeck-us.net> (raw)
In-Reply-To: <20210711044419.7b1c00f8@gmail.com>

On 7/10/21 9:44 PM, Vincent Pelletier wrote:
> On Sun, 11 Jul 2021 02:55:02 +0000, Vincent Pelletier <plr.vincent@gmail.com> wrote:
>> On Sat, 10 Jul 2021 09:08:13 -0700, Guenter Roeck <linux@roeck-us.net> wrote:
>>> Unnecessary include.
>> [...]
>>> I don't immediately see where this include is needed. Is this a
>>> leftover ?
>> [...]
>>> Same here.
>>
>> Are there ways to systematically tell which includes are useless
>> besides commenting them out all and uncommenting until it compiles ?
>> (if that is even a good idea)
> 
> I tried this, just to get a baseline: the module compiles with just
>    linux/hwmon.h
>    linux/mfd/da9063/core.h
>    linux/module.h
>    linux/platform_device.h
>    linux/regmap.h
> 
> Beyond what you suggested this also gets rid of:
> - seems reasonable:
>    - linux/delay.h
>    - linux/init.h
>    - linux/slab.h

... except that slab.h was probably originally included for kzalloc().
The driver now uses devm_kzalloc() which is defined in linux/device.h,
so you'll need to include that instead.

> - looks suspicious to me:
>    - linux/err.h, which means the error constants are indirectly
>      imported. Removing it feels brittle.

It also defines PTR_ERR_OR_ZERO(), so it is definitely needed.

Guenter

>    - linux/kernel.h, although to my surprise a lot of c files do not
>      include it.
> 
> By default I'll drop the former and keep the latter in the
> next version, please let me know if another combination is preferred.
> 


  parent reply	other threads:[~2021-07-11  5:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 13:25 [PATCH v3 1/3] mfd: da9063: Add HWMON dependencies Vincent Pelletier
2021-07-07 13:25 ` [PATCH v3 2/3] hwmon: da9063: HWMON driver Vincent Pelletier
2021-07-10 16:08   ` Guenter Roeck
2021-07-11  1:15     ` Vincent Pelletier
2021-07-11  2:55     ` Vincent Pelletier
2021-07-11  4:22       ` Guenter Roeck
2021-07-11 11:39         ` Vincent Pelletier
2021-07-11 15:14           ` Guenter Roeck
2021-07-11  4:44       ` Vincent Pelletier
2021-07-11  4:58         ` Randy Dunlap
2021-07-11  5:22           ` Vincent Pelletier
2021-07-11  5:45         ` Guenter Roeck [this message]
2021-07-07 13:25 ` [PATCH v3 3/3] Documentation: hwmon: New information for DA9063 Vincent Pelletier
2021-07-10 16:17   ` Guenter Roeck
2021-08-05 11:40 ` [PATCH v3 1/3] mfd: da9063: Add HWMON dependencies Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a2f0b72-f790-435b-ebae-6b1afd19f707@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=corbet@lwn.net \
    --cc=jdelvare@suse.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plr.vincent@gmail.com \
    --cc=stwiss.opensource@diasemi.com \
    --cc=support.opensource@diasemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).