[PATCH BlueZ v1 1/2] attrib: Remove norequests and noresponses variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Passing NULL is fine to g_queue_is_empty(), so removing these
variables makes the code more readable
---
 attrib/gattrib.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index 01c19f9..f95f2fb 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -394,7 +394,6 @@ static gboolean received_data(GIOChannel *io, GIOCondition cond, gpointer data)
 	uint8_t buf[512], status;
 	gsize len;
 	GIOStatus iostat;
-	gboolean norequests, noresponses;
 
 	if (attrib->stale)
 		return FALSE;
@@ -447,11 +446,6 @@ static gboolean received_data(GIOChannel *io, GIOCondition cond, gpointer data)
 	status = 0;
 
 done:
-	norequests = attrib->requests == NULL ||
-			g_queue_is_empty(attrib->requests);
-	noresponses = attrib->responses == NULL ||
-			g_queue_is_empty(attrib->responses);
-
 	if (cmd) {
 		if (cmd->func)
 			cmd->func(status, buf, len, cmd->user_data);
@@ -459,7 +453,8 @@ done:
 		command_destroy(cmd);
 	}
 
-	if (!norequests || !noresponses)
+	if (!g_queue_is_empty(attrib->requests) ||
+					!g_queue_is_empty(attrib->responses))
 		wake_up_sender(attrib);
 
 	return TRUE;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux