RE: Conding style question regarding configuration

2019-06-03 Thread Pascal Van Leeuwen
> > Well, I got a complaint from someone that my driver updates for adding > PCIE > > support wouldn't compile properly on a platform without a PCI(E) > subsystem. > > So I figure I do have to config out the references to PCI specific > function > > calls to fix that. > > Do you have a link to yo

Re: Conding style question regarding configuration

2019-06-03 Thread Christophe Leroy
Le 30/05/2019 à 12:16, Pascal Van Leeuwen a écrit : Yes. Code and data with static linkage will just be optimized away by the compiler if the CONFIG_xx option is not enabled, so all you need to guard are the actual statements, function calls etc. Ok, makes sense. Then I'll just config out th

Re: Conding style question regarding configuration

2019-05-30 Thread Ard Biesheuvel
On Thu, 30 May 2019 at 12:16, Pascal Van Leeuwen wrote: > > > >> Yes. Code and data with static linkage will just be optimized away by > > >> the compiler if the CONFIG_xx option is not enabled, so all you need > > >> to guard are the actual statements, function calls etc. > > >> > > > Ok, makes s

RE: Conding style question regarding configuration

2019-05-30 Thread Pascal Van Leeuwen
> >> Yes. Code and data with static linkage will just be optimized away by > >> the compiler if the CONFIG_xx option is not enabled, so all you need > >> to guard are the actual statements, function calls etc. > >> > > Ok, makes sense. Then I'll just config out the relevant function bodies > > and

Re: Conding style question regarding configuration

2019-05-29 Thread Christophe Leroy
Pascal Van Leeuwen a écrit : > Quick question regarding how to configure out code depending on a CONFIG_xxx > switch. As far as I understood so far, the proper way to do this is not by > doing an #ifdef but by using a regular if with IS_ENABLED like so: > > if (IS_ENABLED(CONFIG_PCI)) { > } > >

RE: Conding style question regarding configuration

2019-05-28 Thread Pascal Van Leeuwen
> > Quick question regarding how to configure out code depending on a > CONFIG_xxx > > switch. As far as I understood so far, the proper way to do this is > not by > > doing an #ifdef but by using a regular if with IS_ENABLED like so: > > > > if (IS_ENABLED(CONFIG_PCI)) { > > } > > > > Such that th

Re: Conding style question regarding configuration

2019-05-28 Thread Sandy Harris
Pascal Van Leeuwen wrote: > ... the proper way to do this is not by > doing an #ifdef but by using a regular if with IS_ENABLED like so: > > if (IS_ENABLED(CONFIG_PCI)) {} See also: http://doc.cat-v.org/henry_spencer/ifdef_considered_harmful

Re: Conding style question regarding configuration

2019-05-28 Thread Ard Biesheuvel
On Tue, 28 May 2019 at 17:47, Pascal Van Leeuwen wrote: > > Hi, > > Quick question regarding how to configure out code depending on a CONFIG_xxx > switch. As far as I understood so far, the proper way to do this is not by > doing an #ifdef but by using a regular if with IS_ENABLED like so: > > if

Conding style question regarding configuration

2019-05-28 Thread Pascal Van Leeuwen
Hi, Quick question regarding how to configure out code depending on a CONFIG_xxx switch. As far as I understood so far, the proper way to do this is not by doing an #ifdef but by using a regular if with IS_ENABLED like so: if (IS_ENABLED(CONFIG_PCI)) { } Such that the compiler can still check