]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
greybus: connection: fix duplicating naming in _gb_hd_connection_insert()
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 14 Nov 2014 11:55:04 +0000 (17:25 +0530)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 14 Nov 2014 21:49:04 +0000 (13:49 -0800)
Though this doesn't cause any logical issues as far as the behavior of the
routine is concerned as the local variable would be considered inside the
'while' loop.

But its better not to use the same name for variables at different levels.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/connection.c

index 4515bcd9dac8ba3c2665cb28efb6ea0022590f15..f460df4b4ec85891456a29f4e6f149883a2c9c8e 100644 (file)
@@ -23,13 +23,13 @@ static void _gb_hd_connection_insert(struct greybus_host_device *hd,
        u16 cport_id = connection->hd_cport_id;
 
        while (*link) {
-               struct gb_connection *connection;
+               struct gb_connection *_connection;
 
                above = *link;
-               connection = rb_entry(above, struct gb_connection, hd_node);
-               if (connection->hd_cport_id > cport_id)
+               _connection = rb_entry(above, struct gb_connection, hd_node);
+               if (_connection->hd_cport_id > cport_id)
                        link = &above->rb_left;
-               else if (connection->hd_cport_id < cport_id)
+               else if (_connection->hd_cport_id < cport_id)
                        link = &above->rb_right;
        }
        rb_link_node(node, above, link);