mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: stefan.wahren@i2se.com
Cc: robh+dt@kernel.org, mark.rutland@arm.com,
	gregkh@linuxfoundation.org, jslaby@suse.com,
	LinoSanfilippo@gmx.de, kubakici@wp.pl,
	devicetree@vger.kernel.org, netdev@vger.kernel.org,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 net-next 01/17] net: qualcomm: remove unnecessary includes
Date: Wed, 24 May 2017 15:41:11 -0400 (EDT)	[thread overview]
Message-ID: <20170524.154111.404338711401048909.davem@davemloft.net> (raw)
In-Reply-To: <1495545173-22150-2-git-send-email-stefan.wahren@i2se.com>

From: Stefan Wahren <stefan.wahren@i2se.com>
Date: Tue, 23 May 2017 15:12:37 +0200

> Most of the includes in qca_7k.c are unnecessary so we better remove them.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
>  drivers/net/ethernet/qualcomm/qca_7k.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qualcomm/qca_7k.c b/drivers/net/ethernet/qualcomm/qca_7k.c
> index f0066fb..557d53c 100644
> --- a/drivers/net/ethernet/qualcomm/qca_7k.c
> +++ b/drivers/net/ethernet/qualcomm/qca_7k.c
> @@ -23,11 +23,7 @@
>   *   kernel-based SPI device.
>   */
>  
> -#include <linux/init.h>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
>  #include <linux/spi/spi.h>
> -#include <linux/version.h>
>  
>  #include "qca_7k.h"
>  
> -- 
> 2.1.4
> 

Changes like this drive me crazy.

The only reason you can remove those headers is because you are obtaining
things indirectly via qca_7k.h

And if that is indeed the case, you are also getting qca_spi.h which
in turn includes linux/spi/spi.h

So you could have removed that as well.

But seriously, it is so much harder to understand a driver and what
interfaces it needs via header files when you hide _all_ of it behind
these local private header files which just include _everything_
and then _every_ foo.c file in your driver gets _all_ of those kernel
headers whether they need it or not.

So if just one foo.c file needs 20 extra kernel headers than the rest
of the files in the driver, every foo.c file eats that cost of
including them.

I really don't like when drivers move in this direction for that
reason.  And at best, as described at the beginning of my response,
this change is incomplete.

  reply	other threads:[~2017-05-24 19:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 13:12 [PATCH v6 net-next 00/17] net: qualcomm: add QCA7000 UART driver Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 01/17] net: qualcomm: remove unnecessary includes Stefan Wahren
2017-05-24 19:41   ` David Miller [this message]
2017-05-24 20:05     ` Stefan Wahren
2017-05-24 20:42       ` David Miller
2017-05-23 13:12 ` [PATCH v6 net-next 02/17] net: qca_framing: use u16 for frame offset Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 03/17] net: qca_7k: Use BIT macro Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 04/17] net: qca_spi: Use SET_NETDEV_DEV() Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 05/17] net: qualcomm: use net_device_ops instead of direct call Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 06/17] net: qualcomm: Improve readability of length defines Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 07/17] net: qca_spi: remove QCASPI_MTU Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 08/17] net: qualcomm: move qcaspi_tx_cmd to qca_spi.c Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 09/17] net: qca_spi: Clarify MODULE_DESCRIPTION Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 10/17] net: qualcomm: rename qca_framing.c to qca_7k_common.c Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 11/17] net: qualcomm: prepare frame decoding for UART driver Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 12/17] net: qualcomm: make qca_7k_common a separate kernel module Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 13/17] dt-bindings: qca7000-spi: Rework binding Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 14/17] dt-bindings: qca7000: rename binding Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 15/17] dt-bindings: slave-device: add current-speed property Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 16/17] dt-bindings: qca7000: append UART interface to binding Stefan Wahren
2017-05-23 13:12 ` [PATCH v6 net-next 17/17] net: qualcomm: add QCA7000 UART driver Stefan Wahren
2017-05-23 18:16   ` Lino Sanfilippo
2017-05-23 19:38     ` Stefan Wahren
2017-05-23 21:01       ` Lino Sanfilippo
2017-05-24  9:06         ` Stefan Wahren
2017-05-24  9:29           ` [PATCH v7 " Stefan Wahren
2017-05-25 17:13             ` David Miller
2017-05-24  9:32           ` [PATCH RESEND " Stefan Wahren
2017-05-24 14:21             ` Lino Sanfilippo
2017-05-24 14:34               ` Stefan Wahren
2017-05-24 14:19           ` Aw: Re: [PATCH v6 " Lino Sanfilippo

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=20170524.154111.404338711401048909.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=LinoSanfilippo@gmx.de \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=kubakici@wp.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=stefan.wahren@i2se.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

all inboxes | Powered by JetHome®