mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tolga Ceylan <tolga.ceylan@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Dilek Uzulmez <dilekuzulmez@gmail.com>,
	Ning Zhou <zhou.ning.gd@gmail.com>,
	Gulsah Kose <gulsah.1004@gmail.com>, Tom Gundersen <teg@jklm.no>,
	Scott Weir <sjw0410@gmail.com>,
	Monam Agarwal <monamagarwal123@gmail.com>,
	Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>,
	Uma Sharma <uma.sharma523@gmail.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Daniel Ngu <daniel.dy.ngu@gmail.com>,
	Robert Nachlinger <robert.nachlinger@gmail.com>,
	Ebru Akagunduz <ebru.akagunduz@gmail.com>,
	Octavian Purdila <octavian.purdila@intel.com>,
	Kiran Padwal <kiran.padwal21@gmail.com>,
	Alexey Khoroshilov <khoroshilov@ispras.ru>,
	Aybuke Ozdemir <aybuke.147@gmail.com>,
	Cihangir Akturk <cakturk@gmail.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Abel Moyo <abelmoyo.ab@gmail.com>,
	Himangi Saraogi <himangi774@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Tolga Ceylan <tolga.ceylan@gmail.com>
Subject: [PATCH 3/5] Staging: gdm724x: code style improvements
Date: Fri, 13 Feb 2015 21:32:22 -0800	[thread overview]
Message-ID: <1423891944-26824-3-git-send-email-tolga.ceylan@gmail.com> (raw)
In-Reply-To: <1423891944-26824-1-git-send-email-tolga.ceylan@gmail.com>

Comparisons such as if (x == NULL) rewritten as if (!x)

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
---
 drivers/staging/gdm724x/gdm_lte.c |  6 +++---
 drivers/staging/gdm724x/gdm_mux.c |  4 ++--
 drivers/staging/gdm724x/gdm_tty.c |  2 +-
 drivers/staging/gdm724x/gdm_usb.c | 14 +++++++-------
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_lte.c b/drivers/staging/gdm724x/gdm_lte.c
index 2c3931b..7a86184 100644
--- a/drivers/staging/gdm724x/gdm_lte.c
+++ b/drivers/staging/gdm724x/gdm_lte.c
@@ -775,7 +775,7 @@ static int gdm_lte_receive_pkt(struct phy_dev *phy_dev, char *buf, int len)
 				   hci->cmd_evt);
 
 	dev = phy_dev->dev[0];
-	if (dev == NULL)
+	if (!dev)
 		return 0;
 
 	switch (cmd_evt) {
@@ -889,7 +889,7 @@ int register_lte_device(struct phy_dev *phy_dev,
 		/* Allocate netdev */
 		net = alloc_netdev(sizeof(struct nic), pdn_dev_name,
 				   NET_NAME_UNKNOWN, ether_setup);
-		if (net == NULL) {
+		if (!net) {
 			pr_err("alloc_netdev failed\n");
 			ret = -ENOMEM;
 			goto err;
@@ -938,7 +938,7 @@ void unregister_lte_device(struct phy_dev *phy_dev)
 
 	for (index = 0; index < MAX_NIC_TYPE; index++) {
 		net = phy_dev->dev[index];
-		if (net == NULL)
+		if (!net)
 			continue;
 
 		unregister_netdev(net);
diff --git a/drivers/staging/gdm724x/gdm_mux.c b/drivers/staging/gdm724x/gdm_mux.c
index 9b5e6b8..b025a49 100644
--- a/drivers/staging/gdm724x/gdm_mux.c
+++ b/drivers/staging/gdm724x/gdm_mux.c
@@ -495,7 +495,7 @@ static int init_usb(struct mux_dev *mux_dev)
 
 	for (i = 0; i < MAX_ISSUE_NUM * 2; i++) {
 		r = alloc_mux_rx();
-		if (r == NULL) {
+		if (!r) {
 			ret = -ENOMEM;
 			break;
 		}
@@ -665,7 +665,7 @@ static int __init gdm_usb_mux_init(void)
 {
 
 	mux_rx_wq = create_workqueue("mux_rx_wq");
-	if (mux_rx_wq == NULL) {
+	if (!mux_rx_wq) {
 		pr_err("work queue create fail\n");
 		return -1;
 	}
diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
index f8c18a9..b593525 100644
--- a/drivers/staging/gdm724x/gdm_tty.c
+++ b/drivers/staging/gdm724x/gdm_tty.c
@@ -88,7 +88,7 @@ static int gdm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
 
 	mutex_lock(&gdm_table_lock);
 	gdm = gdm_table[i][j];
-	if (gdm == NULL) {
+	if (!gdm) {
 		mutex_unlock(&gdm_table_lock);
 		return -ENODEV;
 	}
diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c
index 786c177..36fe1b4 100644
--- a/drivers/staging/gdm724x/gdm_usb.c
+++ b/drivers/staging/gdm724x/gdm_usb.c
@@ -338,7 +338,7 @@ static int init_usb(struct lte_udev *udev)
 
 	for (i = 0; i < MAX_NUM_SDU_BUF; i++) {
 		t_sdu = alloc_tx_sdu_struct();
-		if (t_sdu == NULL) {
+		if (!t_sdu) {
 			ret = -ENOMEM;
 			goto fail;
 		}
@@ -349,7 +349,7 @@ static int init_usb(struct lte_udev *udev)
 
 	for (i = 0; i < MAX_RX_SUBMIT_COUNT * 2; i++) {
 		r = alloc_rx_struct();
-		if (r == NULL) {
+		if (!r) {
 			ret = -ENOMEM;
 			goto fail;
 		}
@@ -681,7 +681,7 @@ static void do_tx(struct work_struct *work)
 		}
 
 		t = alloc_tx_struct(TX_BUF_SIZE);
-		if (t == NULL) {
+		if (!t) {
 			spin_unlock_irqrestore(&tx->lock, flags);
 			return;
 		}
@@ -731,7 +731,7 @@ static int gdm_usb_sdu_send(void *priv_dev, void *data, int len,
 	t_sdu = get_tx_sdu_struct(tx, &no_spc);
 	spin_unlock_irqrestore(&tx->lock, flags);
 
-	if (t_sdu == NULL) {
+	if (!t_sdu) {
 		pr_err("sdu send - free list empty\n");
 		return TX_NO_SPC;
 	}
@@ -781,7 +781,7 @@ static int gdm_usb_hci_send(void *priv_dev, void *data, int len,
 	}
 
 	t = alloc_tx_struct(len);
-	if (t == NULL) {
+	if (!t) {
 		pr_err("hci_send - out of memory\n");
 		return -ENOMEM;
 	}
@@ -1005,11 +1005,11 @@ static int __init gdm_usb_lte_init(void)
 	}
 
 	usb_tx_wq = create_workqueue("usb_tx_wq");
-	if (usb_tx_wq == NULL)
+	if (!usb_tx_wq)
 		return -1;
 
 	usb_rx_wq = create_workqueue("usb_rx_wq");
-	if (usb_rx_wq == NULL)
+	if (!usb_rx_wq)
 		return -1;
 
 	return usb_register(&gdm_usb_lte_driver);
-- 
2.3.0


  parent reply	other threads:[~2015-02-14  5:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-14  5:32 [PATCH 1/5] " Tolga Ceylan
2015-02-14  5:32 ` [PATCH 2/5] " Tolga Ceylan
2015-02-14  5:32 ` Tolga Ceylan [this message]
2015-02-14  5:32 ` [PATCH 4/5] " Tolga Ceylan
2015-02-14  5:32 ` [PATCH 5/5] " Tolga Ceylan
2015-03-07  0:51 ` [PATCH 1/5] " Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423891944-26824-3-git-send-email-tolga.ceylan@gmail.com \
    --to=tolga.ceylan@gmail.com \
    --cc=abelmoyo.ab@gmail.com \
    --cc=aybuke.147@gmail.com \
    --cc=cakturk@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel.dy.ngu@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=dilekuzulmez@gmail.com \
    --cc=ebru.akagunduz@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gulsah.1004@gmail.com \
    --cc=himangi774@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=khoroshilov@ispras.ru \
    --cc=kiran.padwal21@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monamagarwal123@gmail.com \
    --cc=octavian.purdila@intel.com \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=robert.nachlinger@gmail.com \
    --cc=sjw0410@gmail.com \
    --cc=teg@jklm.no \
    --cc=uma.sharma523@gmail.com \
    --cc=zhou.ning.gd@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome