Thread (5 messages) flat view 5 messages, 4 authors, 2018-08-14

Re: [PATCH] bluetooth: hci_h5: avoid unused variable warnings

From: Arnd Bergmann <arnd@arndb.de>
Date: 2018-08-14 08:42:51
Also in: lkml

On Tue, Aug 14, 2018 at 9:22 AM Hans de Goede [off-list ref] wrote:
Hi Arnd,

On 14-08-18 00:04, Arnd Bergmann wrote:
quoted
When CONFIG_BT_HCIUART_RTL is disabled, the hci_h5 driver produces a build
warning because of an incorrect set of #ifdef guards:

drivers/bluetooth/hci_h5.c:920:22: error: 'rtl_vnd' defined but not used [-Werror=unused-variable]

Replacing the #ifdef with an IS_ENABLED() check shuts up the error
and simplifies the logic.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Hmm, so now you're counting on dead code elimination to remove
references to unavailable symbols.
Generally depending on dead code elimination is very reliable, as this
is easy for gcc to get right. However, you are right that this is actually
an exception since the MODULE_DEVICE_TABLE() entry will keep
a reference around that prevents the compiler from eliminating it.
I'm not sure I like this and
since Marcel has also indicated the does not like this fix I
believe we need another fix.

I will write another fix for this.
Ok, thanks!

      Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help