netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: netdev@vger.kernel.org, Karsten Keil <isdn@linux-pingi.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 5/5] ISDN-CAPI: Delete unnecessary braces
Date: Sun, 25 Sep 2016 13:15:09 +0200	[thread overview]
Message-ID: <06e7637c-f682-bfa2-82b6-47d071bd58c4@users.sourceforge.net> (raw)
In-Reply-To: <be07f84d-fc84-e47d-207e-aedd8c960151@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 25 Sep 2016 12:50:21 +0200

Do not use curly brackets at eight source code places
where a single statement should be sufficient.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/isdn/capi/capidrv.c | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index 83f756d..7f58644 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -470,9 +470,8 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
 	struct ncci_datahandle_queue *n, **pp;
 
 	n = kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
-	if (!n) {
+	if (!n)
 		return -1;
-	}
 	n->next = NULL;
 	n->datahandle = datahandle;
 	n->len = len;
@@ -511,9 +510,8 @@ static void send_message(capidrv_contr *card, _cmsg *cmsg)
 	}
 	len = CAPIMSG_LEN(cmsg->buf);
 	skb = alloc_skb(len, GFP_ATOMIC);
-	if (!skb) {
+	if (!skb)
 		return;
-	}
 	memcpy(skb_put(skb, len), cmsg->buf, len);
 	if (capi20_put_message(&global.ap, skb) != CAPI_NOERROR)
 		kfree_skb(skb);
@@ -976,13 +974,12 @@ static void handle_controller(_cmsg *cmsg)
 		if (debugmode)
 			printk(KERN_DEBUG "capidrv-%d: listenconf Info=0x%4x (%s) cipmask=0x%x\n",
 			       card->contrnr, cmsg->Info, capi_info2str(cmsg->Info), card->cipmask);
-		if (cmsg->Info) {
+		if (cmsg->Info)
 			listen_change_state(card, EV_LISTEN_CONF_ERROR);
-		} else if (card->cipmask == 0) {
+		else if (card->cipmask == 0)
 			listen_change_state(card, EV_LISTEN_CONF_EMPTY);
-		} else {
+		     else
 			listen_change_state(card, EV_LISTEN_CONF_OK);
-		}
 		break;
 
 	case CAPI_MANUFACTURER_IND:	/* Controller */
@@ -1263,11 +1260,10 @@ static void handle_plci(_cmsg *cmsg)
 			goto notfound;
 
 		plcip->plci = cmsg->adr.adrPLCI;
-		if (cmsg->Info) {
+		if (cmsg->Info)
 			plci_change_state(card, plcip, EV_PLCI_CONNECT_CONF_ERROR);
-		} else {
+		else
 			plci_change_state(card, plcip, EV_PLCI_CONNECT_CONF_OK);
-		}
 		break;
 
 	case CAPI_CONNECT_ACTIVE_IND:	/* plci */
@@ -1476,10 +1472,9 @@ static void handle_ncci(_cmsg *cmsg)
 		goto ignored;
 
 	case CAPI_DATA_B3_CONF:	/* ncci */
-		if (cmsg->Info) {
+		if (cmsg->Info)
 			printk(KERN_WARNING "CAPI_DATA_B3_CONF: Info %x - %s\n",
 			       cmsg->Info, capi_info2str(cmsg->Info));
-		}
 		nccip = find_ncci(card, cmsg->adr.adrNCCI);
 		if (!nccip)
 			goto notfound;
@@ -2319,9 +2314,8 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
 	}
 	card->myid = card->interface.channels;
 	memset(card->bchans, 0, sizeof(capidrv_bchan) * card->nbchan);
-	for (i = 0; i < card->nbchan; i++) {
+	for (i = 0; i < card->nbchan; i++)
 		card->bchans[i].contr = card;
-	}
 
 	spin_lock_irqsave(&global_lock, flags);
 	card->next = global.contr_list;
@@ -2354,10 +2348,9 @@ static int capidrv_delcontr(u16 contr)
 	isdn_ctrl cmd;
 
 	spin_lock_irqsave(&global_lock, flags);
-	for (card = global.contr_list; card; card = card->next) {
+	for (card = global.contr_list; card; card = card->next)
 		if (card->contrnr == contr)
 			break;
-	}
 	if (!card) {
 		spin_unlock_irqrestore(&global_lock, flags);
 		printk(KERN_ERR "capidrv: delcontr: no contr %u\n", contr);
@@ -2504,9 +2497,8 @@ static int __init capidrv_init(void)
 
 	global.ap.recv_message = capidrv_recv_message;
 	errcode = capi20_register(&global.ap);
-	if (errcode) {
+	if (errcode)
 		return -EIO;
-	}
 
 	register_capictr_notifier(&capictr_nb);
 
-- 
2.10.0

  parent reply	other threads:[~2016-09-25 11:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-25 11:10 [PATCH 0/5] ISDN-CAPI: Fine-tuning for several function implementations SF Markus Elfring
2016-09-25 11:11 ` [PATCH 1/5] ISDN-CAPI: Use kmalloc_array() in capidrv_addcontr() SF Markus Elfring
2016-09-25 11:12 ` [PATCH 2/5] ISDN-CAPI: Delete error messages for a failed memory allocation in four functions SF Markus Elfring
2016-09-25 11:13 ` [PATCH 3/5] ISDN-CAPI: Adjust 17 function calls together with variable assignments SF Markus Elfring
2016-09-26  9:12   ` Paul Bolle
2016-09-26 12:28     ` SF Markus Elfring
2016-09-25 11:14 ` [PATCH 4/5] ISDN-CAPI: Adjust checks for null pointers in four functions SF Markus Elfring
2016-09-25 11:15 ` SF Markus Elfring [this message]
2016-09-25 11:18   ` [PATCH 5/5] ISDN-CAPI: Delete unnecessary braces Sergei Shtylyov
2016-09-25 12:47     ` SF Markus Elfring
2016-09-26  9:20       ` Paul Bolle
2016-09-26 12:52         ` SF Markus Elfring
2016-09-26 19:55           ` Paul Bolle

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=06e7637c-f682-bfa2-82b6-47d071bd58c4@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=isdn@linux-pingi.de \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).