2014-06-20 09:05:44

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 1/6] thunderbolt: Fix build error in eeprom.c

Fixes the below error:
drivers/thunderbolt/eeprom.c:407:2: error: implicit declaration of function ‘kzalloc’ [-Werror=implicit-function-declaration]
drivers/thunderbolt/eeprom.c:444:2: error: implicit declaration of function ‘kfree’ [-Werror=implicit-function-declaration]

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

diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
index 0d5a80b2d07a..bc0449f581c2 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"

/**
--
1.7.9.5


2014-06-20 09:05:50

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 2/6] thunderbolt: Fix build error in switch.c

Fixes the below error:
drivers/thunderbolt/switch.c:347:2: error: implicit declaration of function ‘kzalloc’ [-Werror=implicit-function-declaration]
drivers/thunderbolt/switch.c:381:2: error: implicit declaration of function ‘kcalloc’ [-Werror=implicit-function-declaration]

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/thunderbolt/switch.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 0d50e7e7b29b..26e76e4aa835 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.7.9.5

2014-06-20 09:05:56

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 4/6] thunderbolt: Use NULL instead of 0 in ctl.c

The function returns a pointer. Hence return NULL instead of 0.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/thunderbolt/ctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index d04fee4acb2e..4c6da92edcb4 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -305,13 +305,13 @@ static struct ctl_pkg *tb_ctl_pkg_alloc(struct tb_ctl *ctl)
{
struct ctl_pkg *pkg = kzalloc(sizeof(*pkg), GFP_KERNEL);
if (!pkg)
- return 0;
+ return NULL;
pkg->ctl = ctl;
pkg->buffer = dma_pool_alloc(ctl->frame_pool, GFP_KERNEL,
&pkg->frame.buffer_phy);
if (!pkg->buffer) {
kfree(pkg);
- return 0;
+ return NULL;
}
return pkg;
}
--
1.7.9.5

2014-06-20 09:05:52

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 3/6] thunderbolt: Use NULL instead of 0 in switch.c

The function returns a pointer. Hence return NULL instead of 0.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/thunderbolt/switch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 26e76e4aa835..aeb982969629 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -260,11 +260,11 @@ struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route)
if (route == 0)
return sw;
if (next_port > sw->config.max_port_number)
- return 0;
+ return NULL;
if (tb_is_upstream_port(&sw->ports[next_port]))
- return 0;
+ return NULL;
if (!sw->ports[next_port].remote)
- return 0;
+ return NULL;
return get_switch_at_route(sw->ports[next_port].remote->sw,
route >> TB_ROUTE_SHIFT);
}
--
1.7.9.5

2014-06-20 09:05:59

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 5/6] thunderbolt: Use NULL instead of 0 in nhi.c

'descriptors' is a pointer. Use NULL isntead of 0.

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

diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 346b41e7d5d1..0fc137af89f5 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -416,7 +416,7 @@ void ring_free(struct tb_ring *ring)
ring->size * sizeof(*ring->descriptors),
ring->descriptors, ring->descriptors_dma);

- ring->descriptors = 0;
+ ring->descriptors = NULL;
ring->descriptors_dma = 0;


--
1.7.9.5

2014-06-20 09:06:06

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 6/6] thunderbolt: Staticize nhi_ids

'nhi_ids' is local to this file.

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

diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 0fc137af89f5..2054fbf8b382 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -632,7 +632,7 @@ static const struct dev_pm_ops nhi_pm_ops = {
.restore_noirq = nhi_resume_noirq,
};

-struct pci_device_id nhi_ids[] = {
+static struct pci_device_id nhi_ids[] = {
/*
* We have to specify class, the TB bridges use the same device and
* vendor (sub)id.
--
1.7.9.5

2014-06-20 14:29:18

by Andreas Noever

[permalink] [raw]
Subject: Re: [PATCH 1/6] thunderbolt: Fix build error in eeprom.c

The series looks good. Thanks a lot for fixing these.

On Fri, Jun 20, 2014 at 11:02 AM, Sachin Kamat <[email protected]> wrote:
> Fixes the below error:
> drivers/thunderbolt/eeprom.c:407:2: error: implicit declaration of function ‘kzalloc’ [-Werror=implicit-function-declaration]
> drivers/thunderbolt/eeprom.c:444:2: error: implicit declaration of function ‘kfree’ [-Werror=implicit-function-declaration]
>
> Signed-off-by: Sachin Kamat <[email protected]>
> ---
> drivers/thunderbolt/eeprom.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c
> index 0d5a80b2d07a..bc0449f581c2 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"
>
> /**
> --
> 1.7.9.5
>