> +static inline bool mv88e6xxx_has_lag(struct mv88e6xxx_chip *chip) > +{ > +#if (defined(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2)) > + return chip->info->global2_addr != 0; > +#else > + return false; > +#endif
Given Vladimirs comments, this is just FYI: You should not use #if like this. Use if (IS_ENABLED(CONFIG_NET_DSA_MV88E6XXX_GLOBAL2)) return chip->info->global2_addr != 0; return false; The advantage of this is it all gets compiled, so syntax errors in the mostly unused leg get found quickly. The generated code should still be optimal, since at build time it can evaluate the if and completely remove it. Andrew