Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1293826
| From | Wolfram Sang <wsa@the-dreams.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] i2c: allow building emev2 without slave mode again |
| Date | 2015-12-17 13:10 +0100 |
| Message-ID | <qGFxE-7Gb-13@gated-at.bofh.it> (permalink) |
| References | <qEaRj-7yx-3@gated-at.bofh.it> <qFA70-5XO-21@gated-at.bofh.it> <qFBPt-6Uj-23@gated-at.bofh.it> <qFJN1-3NK-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Mon, Dec 14, 2015 at 11:27:22PM +0100, Arnd Bergmann wrote: > On Monday 14 December 2015 14:52:06 Wolfram Sang wrote: > > > > What about not ifdeffing the inline function and keep the build error > > > > whenever someone uses it without I2C_SLAVE being selected? > > > > > > The inline function is only added there for the case that I2C_SLAVE is > > > disabled, so that would be pointless. > > > > > > However, what we could do is move the extern declaration outside of > > > the #ifdef to make it always visible. The if(IS_ENABLED(CONFIG_I2C_SLAVE)) > > > check should then ensure that it never actually gets called, and we > > > get a link error if some driver gets it wrong. > > > > Yes, that's what I meant: move the whole function (as it was before your > > patch) out of the CONFIG_I2C_SLAVE block. We should get a compiler error > > even, because for !I2C_SLAVE, the client struct will not have the > > slave_cb member. > > > > But we don't want a compile-error for randconfig builds, and we don't > want unnecessary #ifdef in the driver. My conclusion for now is: There needs something to be done surely, but currently I don't have the bandwidth to do it or even play around with it. I am not fully happy with your patches as well because __maybe_unused has some kind of "last resort" feeling to me. So, to get the build failures away immediately I'd simply submit a patch for the emev driver to select I2C_SLAVE and postpone the proper fix to later. That being said, thanks a lot for your input. I will surely come back to it. All the best, Wolfram
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH] i2c: allow building emev2 without slave mode again Wolfram Sang <wsa@the-dreams.de> - 2015-12-12 17:30 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Arnd Bergmann <arnd@arndb.de> - 2015-12-12 22:10 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Wolfram Sang <wsa@the-dreams.de> - 2015-12-13 10:20 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Arnd Bergmann <arnd@arndb.de> - 2015-12-14 13:10 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Wolfram Sang <wsa@the-dreams.de> - 2015-12-14 15:00 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Arnd Bergmann <arnd@arndb.de> - 2015-12-14 23:30 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Wolfram Sang <wsa@the-dreams.de> - 2015-12-17 13:10 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Arnd Bergmann <arnd@arndb.de> - 2015-12-17 15:50 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Wolfram Sang <wsa@the-dreams.de> - 2015-12-17 20:50 +0100
Re: [PATCH] i2c: allow building emev2 without slave mode again Arnd Bergmann <arnd@arndb.de> - 2015-12-17 21:00 +0100
csiph-web