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:	Wed, 10 Sep 2014 16:16:21 +0200
From:	Tobias Klauser <tklauser@...tanz.ch>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Alexander Shiyan <shc_work@...l.ru>,
	Jim Davis <jim.epost@...il.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next <linux-next@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>, jslaby@...e.cz,
	linux-serial@...r.kernel.org
Subject: Re: [PATCH] tty: serial: serial_mctrl_gpio: Fix build error for
 !GPIOLIB

On 2014-09-10 at 15:57:16 +0200, Greg Kroah-Hartman <gregkh@...uxfoundation.org> wrote:
> On Wed, Sep 10, 2014 at 10:06:58AM +0200, Tobias Klauser wrote:
> > If SERIAL_MCTRL_GPIO is selected but GPIOLIB is not, the noop functions
> > from serial_mctrl_gpio.h are pulled in. However, serial_mctrl_gpio.c is
> > still compiled, leading to function redefinition build errors. Since all
> > drivers that include serial_mctrl_gpio.h also depend on
> > SERIAL_MCTRL_GPIO, let it depend on GPIOLIB as well remove the noop
> > functions alltogether.
> > 
> > Reported-by: Jim Davis <jim.epost@...il.com>
> > Signed-off-by: Tobias Klauser <tklauser@...tanz.ch>
> > ---
> >  drivers/tty/serial/Kconfig             |  1 +
> >  drivers/tty/serial/serial_mctrl_gpio.h | 35 ----------------------------------
> >  2 files changed, 1 insertion(+), 35 deletions(-)
> 
> I fixed this yesterday with commit below from Alexander, which does
> things a bit differently than you.  Any objections to it?

This is nicer in terms of being able to compile the driver without
GPIOLIB. However, it wont fix it for the other user of
SERIAL_MCTRL_GPIO, namely SERIAL_ATMEL. And for any future users of
SERIAL_MCTRL_GPIO, we need to make sure to use the same select
directive. To fix it for atmel_serial, I'd suggest the patch below.

Thanks
Tobias

>From d2435dbee5b3597536deffde4865d25b10548d91 Mon Sep 17 00:00:00 2001
From: Tobias Klauser <tklauser@...tanz.ch>
Date: Wed, 10 Sep 2014 16:08:52 +0200
Subject: [PATCH] serial: atmel_serial: Fix build for target without GPIOLIB

If SERIAL_MCTRL_GPIO is selected but GPIOLIB is not, the noop functions
from serial_mctrl_gpio.h are pulled in. However, serial_mctrl_gpio.c is
still compiled, leading to function redefinition build errors.

Signed-off-by: Tobias Klauser <tklauser@...tanz.ch>
---
 drivers/tty/serial/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 8079f52..8c43d11 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -117,7 +117,7 @@ config SERIAL_ATMEL
 	bool "AT91 / AT32 on-chip serial port support"
 	depends on ARCH_AT91 || AVR32
 	select SERIAL_CORE
-	select SERIAL_MCTRL_GPIO
+	select SERIAL_MCTRL_GPIO if GPIOLIB
 	help
 	  This enables the driver for the on-chip UARTs of the Atmel
 	  AT91 and AT32 processors.
-- 
2.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ