All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bas Peters <baspeters93@gmail.com>
To: gregkh@linuxgoundation.org, stern@rowland.harvard.edu
Cc: dan.j.williams@intel.com, hdegoede@redhat.com,
	sarah.a.sharp@linux.intel.com, peter.chen@freescale.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bas Peters <baspeters93@gmail.com>
Subject: [PATCH 3/7] drivers: isdn: act2000: remove assignments of variables in if conditions
Date: Sat,  7 Feb 2015 22:54:00 +0100	[thread overview]
Message-ID: <1423346058-12995-4-git-send-email-baspeters93@gmail.com> (raw)
In-Reply-To: <1423346058-12995-1-git-send-email-baspeters93@gmail.com>

This patch removes all assignments of if conditions, which is not in
accordance with the CodingStyle.
---
 drivers/isdn/act2000/module.c | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c
index c3a1b06..352916a 100644
--- a/drivers/isdn/act2000/module.c
+++ b/drivers/isdn/act2000/module.c
@@ -289,7 +289,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
 			if (copy_from_user(tmp, arg,
 					   sizeof(tmp)))
 				return -EFAULT;
-			if ((ret = act2000_set_msn(card, tmp)))
+			ret = act2000_set_msn(card, tmp);
+			if (ret)
 				return ret;
 			if (card->flags & ACT2000_FLAGS_RUNNING)
 				return (actcapi_manufacturer_req_msn(card));
@@ -312,7 +313,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
 	case ISDN_CMD_DIAL:
 		if (!(card->flags & ACT2000_FLAGS_RUNNING))
 			return -ENODEV;
-		if (!(chan = find_channel(card, c->arg & 0x0f)))
+		chan = find_channel(card, c->arg & 0x0f);
+		if (!chan)
 			break;
 		spin_lock_irqsave(&card->lock, flags);
 		if (chan->fsm_state != ACT2000_STATE_NULL) {
@@ -341,7 +343,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
 	case ISDN_CMD_ACCEPTD:
 		if (!(card->flags & ACT2000_FLAGS_RUNNING))
 			return -ENODEV;
-		if (!(chan = find_channel(card, c->arg & 0x0f)))
+		chan = find_channel(card, c->arg & 0x0f);
+		if (!chan)
 			break;
 		if (chan->fsm_state == ACT2000_STATE_ICALL)
 			actcapi_select_b2_protocol_req(card, chan);
@@ -353,7 +356,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
 	case ISDN_CMD_HANGUP:
 		if (!(card->flags & ACT2000_FLAGS_RUNNING))
 			return -ENODEV;
-		if (!(chan = find_channel(card, c->arg & 0x0f)))
+		chan = find_channel(card, c->arg & 0x0f);
+		if (!chan)
 			break;
 		switch (chan->fsm_state) {
 		case ACT2000_STATE_ICALL:
@@ -368,7 +372,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
 	case ISDN_CMD_SETEAZ:
 		if (!(card->flags & ACT2000_FLAGS_RUNNING))
 			return -ENODEV;
-		if (!(chan = find_channel(card, c->arg & 0x0f)))
+		chan = find_channel(card, c->arg & 0x0f);
+		if (!chan)
 			break;
 		if (strlen(c->parm.num)) {
 			if (card->ptype == ISDN_PTYPE_EURO) {
@@ -388,7 +393,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
 	case ISDN_CMD_CLREAZ:
 		if (!(card->flags & ACT2000_FLAGS_RUNNING))
 			return -ENODEV;
-		if (!(chan = find_channel(card, c->arg & 0x0f)))
+		chan = find_channel(card, c->arg & 0x0f);
+		if (!chan)
 			break;
 		chan->eazmask = 0;
 		actcapi_listen_req(card);
@@ -396,7 +402,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
 	case ISDN_CMD_SETL2:
 		if (!(card->flags & ACT2000_FLAGS_RUNNING))
 			return -ENODEV;
-		if (!(chan = find_channel(card, c->arg & 0x0f)))
+		chan = find_channel(card, c->arg & 0x0f);
+		if (!chan)
 			break;
 		chan->l2prot = (c->arg >> 8);
 		return 0;
@@ -407,7 +414,8 @@ act2000_command(act2000_card *card, isdn_ctrl *c)
 			printk(KERN_WARNING "L3 protocol unknown\n");
 			return -1;
 		}
-		if (!(chan = find_channel(card, c->arg & 0x0f)))
+		chan = find_channel(card, c->arg & 0x0f);
+		if (!chan)
 			break;
 		chan->l3prot = (c->arg >> 8);
 		return 0;
@@ -424,7 +432,8 @@ act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb)
 	act2000_chan *chan;
 	actcapi_msg *msg;
 
-	if (!(chan = find_channel(card, channel)))
+	chan = find_channel(card, channel);
+	if (!chan)
 		return -1;
 	if (chan->fsm_state != ACT2000_STATE_ACTIVE)
 		return -1;
@@ -573,7 +582,8 @@ act2000_alloccard(int bus, int port, int irq, char *id)
 {
 	int i;
 	act2000_card *card;
-	if (!(card = kzalloc(sizeof(act2000_card), GFP_KERNEL))) {
+	card = kzalloc(sizeof(act2000_card), GFP_KERNEL);
+	if (!card) {
 		printk(KERN_WARNING
 		       "act2000: (%s) Could not allocate card-struct.\n", id);
 		return;
-- 
2.1.0


  parent reply	other threads:[~2015-02-07 21:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-07 21:53 [PATCH V2 0/7] drivers: isdn: act2000: fix checkpatch errors Bas Peters
2015-02-07 21:53 ` [PATCH 1/7] drivers: isdn: act2000: act2000_isa.c: Fix " Bas Peters
2015-02-07 21:56   ` Bas Peters
2015-02-07 21:53 ` [PATCH 2/7] drivers: isdn: act2000: capi.c: fix " Bas Peters
2015-02-07 21:54 ` Bas Peters [this message]
2015-02-07 21:54 ` [PATCH 4/7] drivers: isdn: act2000: module.c: remove NULL-initialization of static variable Bas Peters
2015-02-07 21:54 ` [PATCH 5/7] drivers: isdn: act2000: module.c: remove parenthesres around return values Bas Peters
2015-02-07 21:54 ` [PATCH 6/7] drivers: isdn: act2000: fix wrongly positioned brace Bas Peters
2015-02-07 21:54 ` [PATCH 7/7] drivers: isdn: act2000: capi.c: add macro \ and fix brace Bas Peters
2015-02-07 21:54 ` [PATCH 0/2] drivers: isdn: icn: fix checkpatch errors Bas Peters
2015-02-07 21:54 ` [PATCH 1/2] drivers: isdn: icn: icn.c: clean up all " Bas Peters
2015-02-07 21:54 ` [PATCH 2/2] drivers: isdn: icn: icn.h Clean up trivial " Bas Peters
2015-02-07 21:54 ` [PATCH 0/3] Fix checkpatch errors in drivers/isdn/isdnloop Bas Peters
2015-02-07 21:54 ` [PATCH 1/3] drivers: isdn: isdnloop: isdnloop.c: remove assignment of variables in if conditions, in accordance with the CodingStyle Bas Peters
2015-02-07 21:57   ` Bas Peters
2015-02-07 21:56 ` [PATCH V2 0/7] drivers: isdn: act2000: fix checkpatch errors Bas Peters
  -- strict thread matches above, loose matches on Subject: below --
2015-02-07 19:05 Bas Peters
2015-02-07 19:05 ` [PATCH 3/7] drivers: isdn: act2000: remove assignments of variables in if conditions Bas Peters

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=1423346058-12995-4-git-send-email-baspeters93@gmail.com \
    --to=baspeters93@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxgoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@freescale.com \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.