2014-06-20 13:52:38

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 1/3] thunderbolt: add PCI dependency

The thunderbolt drivers cannot be built if CONFIG_PCI is disabled,
better add an explicit Kconfig dependency.
The "default no" line is redundant and can be removed at the same
time.

Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/thunderbolt/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/Kconfig b/drivers/thunderbolt/Kconfig
index 3a25529..5aab79b 100644
--- a/drivers/thunderbolt/Kconfig
+++ b/drivers/thunderbolt/Kconfig
@@ -1,6 +1,6 @@
menuconfig THUNDERBOLT
tristate "Thunderbolt support for Apple devices"
- default no
+ depends on PCI
help
Cactus Ridge Thunderbolt Controller driver
This driver is required if you want to hotplug Thunderbolt devices on
--
1.8.3.2


2014-06-20 13:52:31

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 2/3] thunderbolt: include linux/slab.h for kmalloc

The kmalloc/kzalloc/kfree functions are declared in linux/slab.h,
so we have to explicitly include that header to avoid build failures
on ARM and other architectures that don't include these implicitly
through another header.

Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/thunderbolt/eeprom.c | 1 +
drivers/thunderbolt/switch.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 0d5a80b..bc0449f 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -5,6 +5,7 @@
*/

#include <linux/crc32.h>
+#include <linux/slab.h>
#include "tb.h"

/**
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 0d50e7e..26e76e4 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -5,6 +5,7 @@
*/

#include <linux/delay.h>
+#include <linux/slab.h>

#include "tb.h"

--
1.8.3.2

2014-06-20 13:52:29

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 3/3] thunderbolt: fix format string for size_t

The result of "sizeof(struct tb_drom_entry_port)" is a size_t, which
is not necessarily the same as 'long', so we should use the appropriate
%z format string instead of %l.

Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/thunderbolt/eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index bc0449f..b133f3f 100644
--- a/drivers/thunderbolt/eeprom.c
+++ b/drivers/thunderbolt/eeprom.c
@@ -323,7 +323,7 @@ static int tb_drom_parse_entry(struct tb_switch *sw,
struct tb_drom_entry_port *entry = (void *) header;
if (header->len != sizeof(*entry)) {
tb_sw_warn(sw,
- "port entry has size %#x (expected %#lx)\n",
+ "port entry has size %#x (expected %#zx)\n",
header->len, sizeof(struct tb_drom_entry_port));
return -EIO;
}
--
1.8.3.2

2014-06-20 14:44:34

by Andreas Noever

[permalink] [raw]
Subject: Re: [PATCH 1/3] thunderbolt: add PCI dependency

Thanks for the series.

Patch 2 is equivalent to patches 1 and 2 from Sachin Kamat's series.

@Greg: This series together with Sachin's patches should fix all build
errors. I'll send patches for the remaining warnings later.

Andreas

On Fri, Jun 20, 2014 at 3:52 PM, Arnd Bergmann <[email protected]> wrote:
> The thunderbolt drivers cannot be built if CONFIG_PCI is disabled,
> better add an explicit Kconfig dependency.
> The "default no" line is redundant and can be removed at the same
> time.
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> drivers/thunderbolt/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thunderbolt/Kconfig b/drivers/thunderbolt/Kconfig
> index 3a25529..5aab79b 100644
> --- a/drivers/thunderbolt/Kconfig
> +++ b/drivers/thunderbolt/Kconfig
> @@ -1,6 +1,6 @@
> menuconfig THUNDERBOLT
> tristate "Thunderbolt support for Apple devices"
> - default no
> + depends on PCI
> help
> Cactus Ridge Thunderbolt Controller driver
> This driver is required if you want to hotplug Thunderbolt devices on
> --
> 1.8.3.2
>

2014-06-20 16:42:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/3] thunderbolt: add PCI dependency

On Fri, Jun 20, 2014 at 04:44:05PM +0200, Andreas Noever wrote:
> Thanks for the series.
>
> Patch 2 is equivalent to patches 1 and 2 from Sachin Kamat's series.
>
> @Greg: This series together with Sachin's patches should fix all build
> errors. I'll send patches for the remaining warnings later.

Thanks, I'll apply patches 1 and 3 here.

greg k-h