mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chihau Chau <chihau@gmail.com>
To: gregkh@suse.de
Cc: pavel@ucw.cz, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, Chihau Chau <chihau@gmail.com>
Subject: [PATCH] Staging: dream: smd: smd_qmi: fix code style issues
Date: Thu, 15 Apr 2010 17:01:37 -0400	[thread overview]
Message-ID: <1271365297-26805-1-git-send-email-chihau@gmail.com> (raw)

From: Chihau Chau <chihau@gmail.com>

This fixes some code style issues detected with the checkpatch.pl
script, like not necessary braces {} in some if and else statements and
include a KERN_INFO facility level in a printk() function.

Signed-off-by: Chihau Chau <chihau@gmail.com>
---
 drivers/staging/dream/smd/smd_qmi.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/dream/smd/smd_qmi.c b/drivers/staging/dream/smd/smd_qmi.c
index 9e9067f..76fce51 100644
--- a/drivers/staging/dream/smd/smd_qmi.c
+++ b/drivers/staging/dream/smd/smd_qmi.c
@@ -211,11 +211,10 @@ static int qmi_send(struct qmi_ctxt *ctxt, struct qmi_msg *msg)
 
 	qmi_dump_msg(msg, "send");
 
-	if (msg->service == QMI_CTL) {
+	if (msg->service == QMI_CTL)
 		hlen = QMUX_HEADER - 1;
-	} else {
+	else
 		hlen = QMUX_HEADER;
-	}
 
 	/* QMUX length is total header + total payload - IFC selector */
 	len = hlen + msg->size - 1;
@@ -248,11 +247,10 @@ static int qmi_send(struct qmi_ctxt *ctxt, struct qmi_msg *msg)
 	/* len + 1 takes the interface selector into account */
 	r = smd_write(ctxt->ch, msg->tlv - hlen, len + 1);
 
-	if (r != len) {
+	if (r != len)
 		return -1;
-	} else {
+	else
 		return 0;
-	}
 }
 
 static void qmi_process_ctl_msg(struct qmi_ctxt *ctxt, struct qmi_msg *msg)
@@ -376,7 +374,7 @@ static void qmi_process_broadcast_wds_msg(struct qmi_ctxt *ctxt,
 static void qmi_process_wds_msg(struct qmi_ctxt *ctxt,
 				struct qmi_msg *msg)
 {
-	printk("wds: %04x @ %02x\n", msg->type, msg->client_id);
+	printk(KERN_INFO "wds: %04x @ %02x\n", msg->type, msg->client_id);
 	if (msg->client_id == ctxt->wds_client_id) {
 		qmi_process_unicast_wds_msg(ctxt, msg);
 	} else if (msg->client_id == 0xff) {
@@ -504,9 +502,8 @@ static void qmi_notify(void *priv, unsigned event)
 	case SMD_EVENT_DATA: {
 		int sz;
 		sz = smd_cur_packet_size(ctxt->ch);
-		if ((sz > 0) && (sz <= smd_read_avail(ctxt->ch))) {
+		if ((sz > 0) && (sz <= smd_read_avail(ctxt->ch)))
 			queue_work(qmi_wq, &ctxt->read_work);
-		}
 		break;
 	}
 	case SMD_EVENT_OPEN:
-- 
1.5.6.3


             reply	other threads:[~2010-04-15 21:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 21:01 Chihau Chau [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-03-15  3:44 Chihau Chau
2010-03-15  5:32 ` Pavel Machek
2010-04-10 18:08   ` Chihau Chau
2010-04-28 18:42     ` Greg KH

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=1271365297-26805-1-git-send-email-chihau@gmail.com \
    --to=chihau@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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

all inboxes | Powered by JetHome®