* [PATCH] Remove unused "scan" variable from main_opts
@ 2011-05-05 20:33 Claudio Takahasi
2011-05-05 20:33 ` [PATCH] Remove unnecessary headers from main.c Claudio Takahasi
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Claudio Takahasi @ 2011-05-05 20:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
src/hcid.h | 1 -
src/main.c | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/src/hcid.h b/src/hcid.h
index 856723b..fcfd45b 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -40,7 +40,6 @@ struct main_opts {
gboolean attrib_server;
gboolean le;
- uint8_t scan;
uint8_t mode;
uint8_t discov_interval;
char deviceid[15]; /* FIXME: */
diff --git a/src/main.c b/src/main.c
index c454327..34d291f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -238,7 +238,6 @@ static void init_defaults(void)
{
/* Default HCId settings */
memset(&main_opts, 0, sizeof(main_opts));
- main_opts.scan = SCAN_PAGE;
main_opts.mode = MODE_CONNECTABLE;
main_opts.name = g_strdup("BlueZ");
main_opts.discovto = DEFAULT_DISCOVERABLE_TIMEOUT;
--
1.7.5.rc3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] Remove unnecessary headers from main.c
2011-05-05 20:33 [PATCH] Remove unused "scan" variable from main_opts Claudio Takahasi
@ 2011-05-05 20:33 ` Claudio Takahasi
2011-05-14 23:21 ` Johan Hedberg
2011-05-05 20:33 ` [PATCH] Remove unneeded list when removing a device driver Claudio Takahasi
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Claudio Takahasi @ 2011-05-05 20:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
src/main.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/src/main.c b/src/main.c
index 34d291f..e451e72 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,10 +33,8 @@
#include <stdlib.h>
#include <string.h>
#include <signal.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/uuid.h>
@@ -53,7 +51,6 @@
#include "sdpd.h"
#include "attrib-server.h"
#include "adapter.h"
-#include "event.h"
#include "dbus-common.h"
#include "agent.h"
#include "manager.h"
--
1.7.5.rc3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] Remove unneeded list when removing a device driver
2011-05-05 20:33 [PATCH] Remove unused "scan" variable from main_opts Claudio Takahasi
2011-05-05 20:33 ` [PATCH] Remove unnecessary headers from main.c Claudio Takahasi
@ 2011-05-05 20:33 ` Claudio Takahasi
2011-05-14 23:24 ` Johan Hedberg
2011-05-05 20:33 ` [PATCH] Fix set but not used variable in attrib code Claudio Takahasi
2011-05-14 23:20 ` [PATCH] Remove unused "scan" variable from main_opts Johan Hedberg
3 siblings, 1 reply; 7+ messages in thread
From: Claudio Takahasi @ 2011-05-05 20:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
src/device.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/device.c b/src/device.c
index b0a6542..694a3df 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1168,7 +1168,7 @@ add_uuids:
static void device_remove_drivers(struct btd_device *device, GSList *uuids)
{
struct btd_adapter *adapter = device_get_adapter(device);
- GSList *list, *next;
+ GSList *list;
char srcaddr[18], dstaddr[18];
bdaddr_t src;
sdp_list_t *records;
@@ -1181,12 +1181,10 @@ static void device_remove_drivers(struct btd_device *device, GSList *uuids)
DBG("Removing drivers for %s", dstaddr);
- for (list = device->drivers; list; list = next) {
+ for (list = device->drivers; list; list = list->next) {
struct btd_device_driver *driver = list->data;
const char **uuid;
- next = list->next;
-
for (uuid = driver->uuids; *uuid; uuid++) {
if (!g_slist_find_custom(uuids, *uuid,
(GCompareFunc) strcasecmp))
--
1.7.5.rc3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] Fix set but not used variable in attrib code
2011-05-05 20:33 [PATCH] Remove unused "scan" variable from main_opts Claudio Takahasi
2011-05-05 20:33 ` [PATCH] Remove unnecessary headers from main.c Claudio Takahasi
2011-05-05 20:33 ` [PATCH] Remove unneeded list when removing a device driver Claudio Takahasi
@ 2011-05-05 20:33 ` Claudio Takahasi
2011-05-14 23:20 ` [PATCH] Remove unused "scan" variable from main_opts Johan Hedberg
3 siblings, 0 replies; 7+ messages in thread
From: Claudio Takahasi @ 2011-05-05 20:33 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
attrib/gatt.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/attrib/gatt.c b/attrib/gatt.c
index 360218b..095b157 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -71,13 +71,11 @@ static guint16 encode_discover_primary(uint16_t start, uint16_t end,
{
bt_uuid_t prim;
guint16 plen;
- uint8_t op;
bt_uuid16_create(&prim, GATT_PRIM_SVC_UUID);
if (uuid == NULL) {
/* Discover all primary services */
- op = ATT_OP_READ_BY_GROUP_REQ;
plen = enc_read_by_grp_req(start, end, &prim, pdu, len);
} else {
uint16_t u16;
@@ -86,8 +84,6 @@ static guint16 encode_discover_primary(uint16_t start, uint16_t end,
int vlen;
/* Discover primary service by service UUID */
- op = ATT_OP_FIND_BY_TYPE_REQ;
-
if (uuid->type == BT_UUID16) {
u16 = htobs(uuid->value.u16);
value = &u16;
--
1.7.5.rc3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Remove unused "scan" variable from main_opts
2011-05-05 20:33 [PATCH] Remove unused "scan" variable from main_opts Claudio Takahasi
` (2 preceding siblings ...)
2011-05-05 20:33 ` [PATCH] Fix set but not used variable in attrib code Claudio Takahasi
@ 2011-05-14 23:20 ` Johan Hedberg
3 siblings, 0 replies; 7+ messages in thread
From: Johan Hedberg @ 2011-05-14 23:20 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Thu, May 05, 2011, Claudio Takahasi wrote:
> ---
> src/hcid.h | 1 -
> src/main.c | 1 -
> 2 files changed, 0 insertions(+), 2 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Remove unnecessary headers from main.c
2011-05-05 20:33 ` [PATCH] Remove unnecessary headers from main.c Claudio Takahasi
@ 2011-05-14 23:21 ` Johan Hedberg
0 siblings, 0 replies; 7+ messages in thread
From: Johan Hedberg @ 2011-05-14 23:21 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Thu, May 05, 2011, Claudio Takahasi wrote:
> ---
> src/main.c | 5 +----
> 1 files changed, 1 insertions(+), 4 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Remove unneeded list when removing a device driver
2011-05-05 20:33 ` [PATCH] Remove unneeded list when removing a device driver Claudio Takahasi
@ 2011-05-14 23:24 ` Johan Hedberg
0 siblings, 0 replies; 7+ messages in thread
From: Johan Hedberg @ 2011-05-14 23:24 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Thu, May 05, 2011, Claudio Takahasi wrote:
> ---
> src/device.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/device.c b/src/device.c
> index b0a6542..694a3df 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -1168,7 +1168,7 @@ add_uuids:
> static void device_remove_drivers(struct btd_device *device, GSList *uuids)
> {
> struct btd_adapter *adapter = device_get_adapter(device);
> - GSList *list, *next;
> + GSList *list;
> char srcaddr[18], dstaddr[18];
> bdaddr_t src;
> sdp_list_t *records;
> @@ -1181,12 +1181,10 @@ static void device_remove_drivers(struct btd_device *device, GSList *uuids)
>
> DBG("Removing drivers for %s", dstaddr);
>
> - for (list = device->drivers; list; list = next) {
> + for (list = device->drivers; list; list = list->next) {
> struct btd_device_driver *driver = list->data;
> const char **uuid;
>
> - next = list->next;
> -
> for (uuid = driver->uuids; *uuid; uuid++) {
> if (!g_slist_find_custom(uuids, *uuid,
> (GCompareFunc) strcasecmp))
I don't think this change is necessarily safe. Since the loop is making
a callback to code that it doesn't control there's a risk that the
callback could end up freeing the current pointer.
Johan
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-14 23:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-05 20:33 [PATCH] Remove unused "scan" variable from main_opts Claudio Takahasi
2011-05-05 20:33 ` [PATCH] Remove unnecessary headers from main.c Claudio Takahasi
2011-05-14 23:21 ` Johan Hedberg
2011-05-05 20:33 ` [PATCH] Remove unneeded list when removing a device driver Claudio Takahasi
2011-05-14 23:24 ` Johan Hedberg
2011-05-05 20:33 ` [PATCH] Fix set but not used variable in attrib code Claudio Takahasi
2011-05-14 23:20 ` [PATCH] Remove unused "scan" variable from main_opts Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).