2015-01-05 14:02:55

by Gowtham Anandha Babu

[permalink] [raw]
Subject: [PATCH] Bluetooth: Remove dead code

Variable 'controller' is assigned a value that is never used.
Identified by cppcheck tool.

Signed-off-by: Gowtham Anandha Babu <[email protected]>
---
net/bluetooth/cmtp/capi.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
index 1ca8a87..75bd2c4 100644
--- a/net/bluetooth/cmtp/capi.c
+++ b/net/bluetooth/cmtp/capi.c
@@ -253,8 +253,6 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
if (skb->len < CAPI_MSG_BASELEN + 15)
break;

- controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 10);
-
if (!info && ctrl) {
int len = min_t(uint, CAPI_MANUFACTURER_LEN,
skb->data[CAPI_MSG_BASELEN + 14]);
@@ -270,8 +268,6 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
if (skb->len < CAPI_MSG_BASELEN + 32)
break;

- controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12);
-
if (!info && ctrl) {
ctrl->version.majorversion = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 16);
ctrl->version.minorversion = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 20);
@@ -285,8 +281,6 @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
if (skb->len < CAPI_MSG_BASELEN + 17)
break;

- controller = CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 12);
-
if (!info && ctrl) {
int len = min_t(uint, CAPI_SERIAL_LEN,
skb->data[CAPI_MSG_BASELEN + 16]);
--
1.9.1



2015-01-14 09:21:08

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Remove dead code

Hi Gowtham,

On Mon, Jan 05, 2015, Gowtham Anandha Babu wrote:
> Variable 'controller' is assigned a value that is never used.
> Identified by cppcheck tool.
>
> Signed-off-by: Gowtham Anandha Babu <[email protected]>
> ---
> net/bluetooth/cmtp/capi.c | 6 ------
> 1 file changed, 6 deletions(-)

Applied to bluetooth-next. Thanks.

Johan

2015-01-13 06:52:58

by Gowtham Anandha Babu

[permalink] [raw]
Subject: RE: [PATCH] Bluetooth: Remove dead code



Ping.

> -----Original Message-----
> From: [email protected] [mailto:linux-bluetooth-
> [email protected]] On Behalf Of Gowtham Anandha Babu
> Sent: Monday, January 05, 2015 7:33 PM
> To: [email protected]
> Cc: [email protected]; [email protected]; Gowtham Anandha
> Babu
> Subject: [PATCH] Bluetooth: Remove dead code
>
> Variable 'controller' is assigned a value that is never used.
> Identified by cppcheck tool.
>
> Signed-off-by: Gowtham Anandha Babu <[email protected]>
> ---
> net/bluetooth/cmtp/capi.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c index
> 1ca8a87..75bd2c4 100644
> --- a/net/bluetooth/cmtp/capi.c
> +++ b/net/bluetooth/cmtp/capi.c
> @@ -253,8 +253,6 @@ static void cmtp_recv_interopmsg(struct
> cmtp_session *session, struct sk_buff *s
> if (skb->len < CAPI_MSG_BASELEN + 15)
> break;
>
> - controller = CAPIMSG_U32(skb->data,
> CAPI_MSG_BASELEN + 10);
> -
> if (!info && ctrl) {
> int len = min_t(uint,
> CAPI_MANUFACTURER_LEN,
> skb-
> >data[CAPI_MSG_BASELEN + 14]); @@ -270,8 +268,6 @@ static void
> cmtp_recv_interopmsg(struct cmtp_session *session, struct sk_buff *s
> if (skb->len < CAPI_MSG_BASELEN + 32)
> break;
>
> - controller = CAPIMSG_U32(skb->data,
> CAPI_MSG_BASELEN + 12);
> -
> if (!info && ctrl) {
> ctrl->version.majorversion =
> CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 16);
> ctrl->version.minorversion =
> CAPIMSG_U32(skb->data, CAPI_MSG_BASELEN + 20); @@ -285,8 +281,6
> @@ static void cmtp_recv_interopmsg(struct cmtp_session *session, struct
> sk_buff *s
> if (skb->len < CAPI_MSG_BASELEN + 17)
> break;
>
> - controller = CAPIMSG_U32(skb->data,
> CAPI_MSG_BASELEN + 12);
> -
> if (!info && ctrl) {
> int len = min_t(uint, CAPI_SERIAL_LEN,
> skb-
> >data[CAPI_MSG_BASELEN + 16]);
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
in
> the body of a message to [email protected] More majordomo
> info at http://vger.kernel.org/majordomo-info.html