Commit 973dd9c4 authored by Erick Archer's avatar Erick Archer Committed by Luiz Augusto von Dentz

Bluetooth: Use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.
Signed-off-by: default avatarErick Archer <erick.archer@outlook.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent 183469bc
...@@ -811,7 +811,7 @@ static int rtl_download_firmware(struct hci_dev *hdev, ...@@ -811,7 +811,7 @@ static int rtl_download_firmware(struct hci_dev *hdev,
struct sk_buff *skb; struct sk_buff *skb;
struct hci_rp_read_local_version *rp; struct hci_rp_read_local_version *rp;
dl_cmd = kmalloc(sizeof(struct rtl_download_cmd), GFP_KERNEL); dl_cmd = kmalloc(sizeof(*dl_cmd), GFP_KERNEL);
if (!dl_cmd) if (!dl_cmd)
return -ENOMEM; return -ENOMEM;
......
...@@ -488,7 +488,7 @@ static int hci_uart_tty_open(struct tty_struct *tty) ...@@ -488,7 +488,7 @@ static int hci_uart_tty_open(struct tty_struct *tty)
if (tty->ops->write == NULL) if (tty->ops->write == NULL)
return -EOPNOTSUPP; return -EOPNOTSUPP;
hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL); hu = kzalloc(sizeof(*hu), GFP_KERNEL);
if (!hu) { if (!hu) {
BT_ERR("Can't allocate control structure"); BT_ERR("Can't allocate control structure");
return -ENFILE; return -ENFILE;
......
...@@ -569,7 +569,7 @@ static int qca_open(struct hci_uart *hu) ...@@ -569,7 +569,7 @@ static int qca_open(struct hci_uart *hu)
if (!hci_uart_has_flow_control(hu)) if (!hci_uart_has_flow_control(hu))
return -EOPNOTSUPP; return -EOPNOTSUPP;
qca = kzalloc(sizeof(struct qca_data), GFP_KERNEL); qca = kzalloc(sizeof(*qca), GFP_KERNEL);
if (!qca) if (!qca)
return -ENOMEM; return -ENOMEM;
...@@ -1040,8 +1040,7 @@ static void qca_controller_memdump(struct work_struct *work) ...@@ -1040,8 +1040,7 @@ static void qca_controller_memdump(struct work_struct *work)
} }
if (!qca_memdump) { if (!qca_memdump) {
qca_memdump = kzalloc(sizeof(struct qca_memdump_info), qca_memdump = kzalloc(sizeof(*qca_memdump), GFP_ATOMIC);
GFP_ATOMIC);
if (!qca_memdump) { if (!qca_memdump) {
mutex_unlock(&qca->hci_memdump_lock); mutex_unlock(&qca->hci_memdump_lock);
return; return;
......
...@@ -633,7 +633,7 @@ static int vhci_open(struct inode *inode, struct file *file) ...@@ -633,7 +633,7 @@ static int vhci_open(struct inode *inode, struct file *file)
{ {
struct vhci_data *data; struct vhci_data *data;
data = kzalloc(sizeof(struct vhci_data), GFP_KERNEL); data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment