From: Alfonso Acosta Date: Tue, 7 Oct 2014 08:44:12 +0000 (+0000) Subject: Bluetooth: Remove redundant check on hci_conn's device class X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ddbea5cff7d5e2a9727f72c948e92b676a061fc5;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Bluetooth: Remove redundant check on hci_conn's device class 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 Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 10caab587cca..3fd88b06ed5a 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -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);