lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 12 Dec 2014 17:27:46 +0100
From:	Tobias Klauser <tklauser@...tanz.ch>
To:	David Miller <davem@...emloft.net>
Cc:	tony@...mide.com, nico@...xnic.net, netdev@...r.kernel.org
Subject: Re: [PATCH net v2] net: smc91x: Fix build without gpiolib

On 2014-12-12 at 17:21:19 +0100, David Miller <davem@...emloft.net> wrote:
> From: Tony Lindgren <tony@...mide.com>
> Date: Fri, 12 Dec 2014 08:11:00 -0800
> 
> > * Tobias Klauser <tklauser@...tanz.ch> [141212 08:09]:
> >> If GPIOLIB=n the following build errors occur:
> >> 
> >> drivers/net/ethernet/smsc/smc91x.c: In function 'try_toggle_control_gpio':
> >> drivers/net/ethernet/smsc/smc91x.c:2204:2: error: implicit declaration of function 'devm_gpiod_get_index' [-Werror=implicit-function-declaration]
> >> drivers/net/ethernet/smsc/smc91x.c:2204:7: warning: assignment makes pointer from integer without a cast [enabled by default]
> >> drivers/net/ethernet/smsc/smc91x.c:2213:2: error: implicit declaration of function 'gpiod_direction_output' [-Werror=implicit-function-declaration]
> >> drivers/net/ethernet/smsc/smc91x.c:2216:3: error: implicit declaration of function 'devm_gpiod_put' [-Werror=implicit-function-declaration]
> >> drivers/net/ethernet/smsc/smc91x.c:2222:2: error: implicit declaration of function 'gpiod_set_value_cansleep' [-Werror=implicit-function-declaration]
> >> 
> >> Since the toggling of the GPIOs is an optional feature, define
> >> try_toggle_control_gpio only if GPIOLIB is enabled.
> > 
> > Oops sorry about that, I guess my systems have it all selected so
> > randconfig builds did not expose it.
> > 
> > Would it make sense to add the missing gpio stub into
> > include/linux/gpio/consumer.h instead?
> 
> I really don't like these kinds of things at all.
> 
> If GPIO is required to fully program the hardware properly,
> the smc91x driver should have it as a dependency.

GPIO is not needed in all configurations of the chip, they are optional.
That's why I was going for the ugly #ifdef solution.

It seems that there are stubs for the functions in question in
linux/gpio/consumer.h already as Tony suggested. Thus, adding an
#include <linux/gpio/consumer.h> to the driver should be enough. I'll
send an updated patch.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ