All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean Delvare <jdelvare@suse.de>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	linux-i2c@vger.kernel.org, Biwen Li <biwen.li@nxp.com>
Subject: Re: [PATCH] i2c: avoid ifdeffery in I2C drivers with optional slave support
Date: Mon, 20 Apr 2020 08:12:58 +0200	[thread overview]
Message-ID: <20200420061258.GA1694@pengutronix.de> (raw)
In-Reply-To: <20200417160014.5604a16a@endymion>

On Fri, Apr 17, 2020 at 04:00:14PM +0200, Jean Delvare wrote:
> One last thing I meant to mention but forgot...
> 
> On Wed, 15 Apr 2020 07:16:19 +0200, Sascha Hauer wrote:
> > static int i2c_imx_reg_slave(struct i2c_client *client)
> > {
> > 	if (!IS_ENABLED(CONFIG_I2C_SLAVE))
> > 		return -ESOMETHING;
> > 	...
> > }
> > 
> > The code is gone without CONFIG_I2C_SLAVE enabled, yet the compile coverage
> > is there.
> 
> Compile coverage is nice but it comes at a cost. With the approach
> above, the code will be built, then discarded. When the code is
> #ifdef'd out, it isn't built at all. This means that your approach,
> although it has advantages, increases the build time.
> 
> And don't tell me "you only build once", we live at the time of
> continuous integration so we keep building kernels. As a support
> engineer, I build kernels daily, and even though I have access to a
> powerful build farm for that purpose, it still takes 30 to 60 minutes
> to get my kernel built each time. Obviously most of that time isn't
> spent on the i2c-imx driver ;-) but if every piece of code does the
> same, build time will inevitably increase.

Well often enough I spend more time building Kernels than actually
running them, so don't tell me.

Yes, build time increases when we do things in C rather than in CPP,
but each #ifdef doubles the number of builds necessary to let the
compiler go though all paths. I've sent and received more than enough
patches that fix #ifdefs for the more unlikely cases which were not
compile tested.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2020-04-20  6:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191204095348.9192-1-s.hauer@pengutronix.de>
2020-04-09 13:40 ` [PATCH] i2c: avoid ifdeffery in I2C drivers with optional slave support Wolfram Sang
2020-04-10  9:29   ` Jean Delvare
2020-04-14 11:56     ` Sascha Hauer
2020-04-14 14:40       ` Jean Delvare
2020-04-15  5:16         ` Sascha Hauer
2020-04-15  9:51           ` Jean Delvare
2020-04-17 14:00           ` Jean Delvare
2020-04-20  6:12             ` Sascha Hauer [this message]

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=20200420061258.GA1694@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=biwen.li@nxp.com \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.