Commit b6f6fd8a authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Greg Kroah-Hartman

stating: gdm724x: remove explicit NULL comparison

This patch converts explicit NULL comparison to its shorter
equivalent form.
Done with coccinelle semantic patch:

@@
expression e;
@@

- e == NULL
+ !e
Signed-off-by: default avatarIoana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a4785ef8
...@@ -775,7 +775,7 @@ static int gdm_lte_receive_pkt(struct phy_dev *phy_dev, char *buf, int len) ...@@ -775,7 +775,7 @@ static int gdm_lte_receive_pkt(struct phy_dev *phy_dev, char *buf, int len)
hci->cmd_evt); hci->cmd_evt);
dev = phy_dev->dev[0]; dev = phy_dev->dev[0];
if (dev == NULL) if (!dev)
return 0; return 0;
switch (cmd_evt) { switch (cmd_evt) {
...@@ -938,7 +938,7 @@ void unregister_lte_device(struct phy_dev *phy_dev) ...@@ -938,7 +938,7 @@ void unregister_lte_device(struct phy_dev *phy_dev)
for (index = 0; index < MAX_NIC_TYPE; index++) { for (index = 0; index < MAX_NIC_TYPE; index++) {
net = phy_dev->dev[index]; net = phy_dev->dev[index];
if (net == NULL) if (!net)
continue; continue;
unregister_netdev(net); unregister_netdev(net);
......
...@@ -492,7 +492,7 @@ static int init_usb(struct mux_dev *mux_dev) ...@@ -492,7 +492,7 @@ static int init_usb(struct mux_dev *mux_dev)
for (i = 0; i < MAX_ISSUE_NUM * 2; i++) { for (i = 0; i < MAX_ISSUE_NUM * 2; i++) {
r = alloc_mux_rx(); r = alloc_mux_rx();
if (r == NULL) { if (!r) {
ret = -ENOMEM; ret = -ENOMEM;
break; break;
} }
...@@ -662,7 +662,7 @@ static int __init gdm_usb_mux_init(void) ...@@ -662,7 +662,7 @@ static int __init gdm_usb_mux_init(void)
{ {
mux_rx_wq = create_workqueue("mux_rx_wq"); mux_rx_wq = create_workqueue("mux_rx_wq");
if (mux_rx_wq == NULL) { if (!mux_rx_wq) {
pr_err("work queue create fail\n"); pr_err("work queue create fail\n");
return -1; return -1;
} }
......
...@@ -88,7 +88,7 @@ static int gdm_tty_install(struct tty_driver *driver, struct tty_struct *tty) ...@@ -88,7 +88,7 @@ static int gdm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
mutex_lock(&gdm_table_lock); mutex_lock(&gdm_table_lock);
gdm = gdm_table[i][j]; gdm = gdm_table[i][j];
if (gdm == NULL) { if (!gdm) {
mutex_unlock(&gdm_table_lock); mutex_unlock(&gdm_table_lock);
return -ENODEV; return -ENODEV;
} }
......
...@@ -338,7 +338,7 @@ static int init_usb(struct lte_udev *udev) ...@@ -338,7 +338,7 @@ static int init_usb(struct lte_udev *udev)
for (i = 0; i < MAX_NUM_SDU_BUF; i++) { for (i = 0; i < MAX_NUM_SDU_BUF; i++) {
t_sdu = alloc_tx_sdu_struct(); t_sdu = alloc_tx_sdu_struct();
if (t_sdu == NULL) { if (!t_sdu) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto fail;
} }
...@@ -349,7 +349,7 @@ static int init_usb(struct lte_udev *udev) ...@@ -349,7 +349,7 @@ static int init_usb(struct lte_udev *udev)
for (i = 0; i < MAX_RX_SUBMIT_COUNT*2; i++) { for (i = 0; i < MAX_RX_SUBMIT_COUNT*2; i++) {
r = alloc_rx_struct(); r = alloc_rx_struct();
if (r == NULL) { if (!r) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto fail;
} }
...@@ -576,7 +576,7 @@ static int send_tx_packet(struct usb_device *usbdev, struct usb_tx *t, u32 len) ...@@ -576,7 +576,7 @@ static int send_tx_packet(struct usb_device *usbdev, struct usb_tx *t, u32 len)
{ {
int ret = 0; int ret = 0;
if (!(len%512)) if (!(len % 512))
len++; len++;
usb_fill_bulk_urb(t->urb, usb_fill_bulk_urb(t->urb,
...@@ -682,7 +682,7 @@ static void do_tx(struct work_struct *work) ...@@ -682,7 +682,7 @@ static void do_tx(struct work_struct *work)
} }
t = alloc_tx_struct(TX_BUF_SIZE); t = alloc_tx_struct(TX_BUF_SIZE);
if (t == NULL) { if (!t) {
spin_unlock_irqrestore(&tx->lock, flags); spin_unlock_irqrestore(&tx->lock, flags);
return; return;
} }
...@@ -732,7 +732,7 @@ static int gdm_usb_sdu_send(void *priv_dev, void *data, int len, ...@@ -732,7 +732,7 @@ static int gdm_usb_sdu_send(void *priv_dev, void *data, int len,
t_sdu = get_tx_sdu_struct(tx, &no_spc); t_sdu = get_tx_sdu_struct(tx, &no_spc);
spin_unlock_irqrestore(&tx->lock, flags); spin_unlock_irqrestore(&tx->lock, flags);
if (t_sdu == NULL) { if (!t_sdu) {
pr_err("sdu send - free list empty\n"); pr_err("sdu send - free list empty\n");
return TX_NO_SPC; return TX_NO_SPC;
} }
...@@ -782,7 +782,7 @@ static int gdm_usb_hci_send(void *priv_dev, void *data, int len, ...@@ -782,7 +782,7 @@ static int gdm_usb_hci_send(void *priv_dev, void *data, int len,
} }
t = alloc_tx_struct(len); t = alloc_tx_struct(len);
if (t == NULL) { if (!t) {
pr_err("hci_send - out of memory\n"); pr_err("hci_send - out of memory\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1006,11 +1006,11 @@ static int __init gdm_usb_lte_init(void) ...@@ -1006,11 +1006,11 @@ static int __init gdm_usb_lte_init(void)
} }
usb_tx_wq = create_workqueue("usb_tx_wq"); usb_tx_wq = create_workqueue("usb_tx_wq");
if (usb_tx_wq == NULL) if (!usb_tx_wq)
return -1; return -1;
usb_rx_wq = create_workqueue("usb_rx_wq"); usb_rx_wq = create_workqueue("usb_rx_wq");
if (usb_rx_wq == NULL) if (!usb_rx_wq)
return -1; return -1;
return usb_register(&gdm_usb_lte_driver); return usb_register(&gdm_usb_lte_driver);
......
...@@ -122,7 +122,7 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) ...@@ -122,7 +122,7 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
if (group > ND_MAX_GROUP) if (group > ND_MAX_GROUP)
return -EINVAL; return -EINVAL;
if (!netlink_has_listeners(sock, group+1)) if (!netlink_has_listeners(sock, group + 1))
return -ESRCH; return -ESRCH;
skb = alloc_skb(NLMSG_SPACE(len), GFP_ATOMIC); skb = alloc_skb(NLMSG_SPACE(len), GFP_ATOMIC);
......
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