Bluetooth: Remove redundant check on hci_conn's device class
authorAlfonso Acosta <fons@spotify.com>
Tue, 7 Oct 2014 08:44:12 +0000 (08:44 +0000)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 25 Oct 2014 05:56:24 +0000 (07:56 +0200)
NULL-checking conn->dev_class is pointless since the variable is
defined as an array, i.e. it will always be non-NULL.

Signed-off-by: Alfonso Acosta <fons@spotify.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/mgmt.c

index 10caab5..3fd88b0 100644 (file)
@@ -6196,8 +6196,7 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
                        eir_len = eir_append_data(ev->eir, 0, EIR_NAME_COMPLETE,
                                                  name, name_len);
 
-               if (conn->dev_class &&
-                   memcmp(conn->dev_class, "\0\0\0", 3) != 0)
+               if (memcmp(conn->dev_class, "\0\0\0", 3) != 0)
                        eir_len = eir_append_data(ev->eir, eir_len,
                                                  EIR_CLASS_OF_DEV,
                                                  conn->dev_class, 3);