* [PATCH] Staging: dream: smd: smd_qmi: fix code style issues
@ 2010-04-15 21:01 Chihau Chau
0 siblings, 0 replies; 5+ messages in thread
From: Chihau Chau @ 2010-04-15 21:01 UTC (permalink / raw)
To: gregkh; +Cc: pavel, devel, linux-kernel, Chihau Chau
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Staging: dream: smd: smd_qmi: fix code style issues
2010-04-10 18:08 ` Chihau Chau
@ 2010-04-28 18:42 ` Greg KH
0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2010-04-28 18:42 UTC (permalink / raw)
To: Chihau Chau; +Cc: Pavel Machek, devel, gregkh, linux-kernel
On Sat, Apr 10, 2010 at 02:08:47PM -0400, Chihau Chau wrote:
> So, What about this patch? Greg?
Now queued up, sorry for the delay.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Staging: dream: smd: smd_qmi: fix code style issues
2010-03-15 5:32 ` Pavel Machek
@ 2010-04-10 18:08 ` Chihau Chau
2010-04-28 18:42 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Chihau Chau @ 2010-04-10 18:08 UTC (permalink / raw)
To: Pavel Machek; +Cc: gregkh, devel, linux-kernel
So, What about this patch? Greg?
2010/3/15 Pavel Machek <pavel@ucw.cz>:
> On Mon 2010-03-15 00:44:54, Chihau Chau wrote:
>> From: Chihau Chau <chihau@gmail.com>
>>
>> This fixes some code style issues about to #include <linux/uaccess.h>
>> instead of <asm/uaccess.h> and some not necessary braces {}.
>>
>> Signed-off-by: Chihau Chau <chihau@gmail.com>
>
> ACK.
>
>> ---
>> drivers/staging/dream/smd/smd_qmi.c | 7 +++----
>> 1 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/dream/smd/smd_qmi.c b/drivers/staging/dream/smd/smd_qmi.c
>> index 687db14..9e9067f 100644
>> --- a/drivers/staging/dream/smd/smd_qmi.c
>> +++ b/drivers/staging/dream/smd/smd_qmi.c
>> @@ -25,7 +25,7 @@
>> #include <linux/miscdevice.h>
>> #include <linux/workqueue.h>
>>
>> -#include <asm/uaccess.h>
>> +#include <linux/uaccess.h>
>> #include <mach/msm_smd.h>
>>
>> #define QMI_CTL 0x00
>> @@ -643,11 +643,10 @@ static int qmi_print_state(struct qmi_ctxt *ctxt, char *buf, int max)
>> }
>>
>> i = scnprintf(buf, max, "STATE=%s\n", statename);
>> - i += scnprintf(buf + i, max - i, "CID=%d\n",ctxt->wds_client_id);
>> + i += scnprintf(buf + i, max - i, "CID=%d\n", ctxt->wds_client_id);
>>
>> - if (ctxt->state != STATE_ONLINE){
>> + if (ctxt->state != STATE_ONLINE)
>> return i;
>> - }
>>
>> i += scnprintf(buf + i, max - i, "ADDR=%d.%d.%d.%d\n",
>> ctxt->addr[0], ctxt->addr[1], ctxt->addr[2], ctxt->addr[3]);
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>
--
Chihau Chau
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Staging: dream: smd: smd_qmi: fix code style issues
2010-03-15 3:44 Chihau Chau
@ 2010-03-15 5:32 ` Pavel Machek
2010-04-10 18:08 ` Chihau Chau
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2010-03-15 5:32 UTC (permalink / raw)
To: Chihau Chau; +Cc: gregkh, devel, linux-kernel
On Mon 2010-03-15 00:44:54, Chihau Chau wrote:
> From: Chihau Chau <chihau@gmail.com>
>
> This fixes some code style issues about to #include <linux/uaccess.h>
> instead of <asm/uaccess.h> and some not necessary braces {}.
>
> Signed-off-by: Chihau Chau <chihau@gmail.com>
ACK.
> ---
> drivers/staging/dream/smd/smd_qmi.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/dream/smd/smd_qmi.c b/drivers/staging/dream/smd/smd_qmi.c
> index 687db14..9e9067f 100644
> --- a/drivers/staging/dream/smd/smd_qmi.c
> +++ b/drivers/staging/dream/smd/smd_qmi.c
> @@ -25,7 +25,7 @@
> #include <linux/miscdevice.h>
> #include <linux/workqueue.h>
>
> -#include <asm/uaccess.h>
> +#include <linux/uaccess.h>
> #include <mach/msm_smd.h>
>
> #define QMI_CTL 0x00
> @@ -643,11 +643,10 @@ static int qmi_print_state(struct qmi_ctxt *ctxt, char *buf, int max)
> }
>
> i = scnprintf(buf, max, "STATE=%s\n", statename);
> - i += scnprintf(buf + i, max - i, "CID=%d\n",ctxt->wds_client_id);
> + i += scnprintf(buf + i, max - i, "CID=%d\n", ctxt->wds_client_id);
>
> - if (ctxt->state != STATE_ONLINE){
> + if (ctxt->state != STATE_ONLINE)
> return i;
> - }
>
> i += scnprintf(buf + i, max - i, "ADDR=%d.%d.%d.%d\n",
> ctxt->addr[0], ctxt->addr[1], ctxt->addr[2], ctxt->addr[3]);
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Staging: dream: smd: smd_qmi: fix code style issues
@ 2010-03-15 3:44 Chihau Chau
2010-03-15 5:32 ` Pavel Machek
0 siblings, 1 reply; 5+ messages in thread
From: Chihau Chau @ 2010-03-15 3:44 UTC (permalink / raw)
To: gregkh; +Cc: pavel, devel, linux-kernel, Chihau Chau
From: Chihau Chau <chihau@gmail.com>
This fixes some code style issues about to #include <linux/uaccess.h>
instead of <asm/uaccess.h> and some not necessary braces {}.
Signed-off-by: Chihau Chau <chihau@gmail.com>
---
drivers/staging/dream/smd/smd_qmi.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/dream/smd/smd_qmi.c b/drivers/staging/dream/smd/smd_qmi.c
index 687db14..9e9067f 100644
--- a/drivers/staging/dream/smd/smd_qmi.c
+++ b/drivers/staging/dream/smd/smd_qmi.c
@@ -25,7 +25,7 @@
#include <linux/miscdevice.h>
#include <linux/workqueue.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include <mach/msm_smd.h>
#define QMI_CTL 0x00
@@ -643,11 +643,10 @@ static int qmi_print_state(struct qmi_ctxt *ctxt, char *buf, int max)
}
i = scnprintf(buf, max, "STATE=%s\n", statename);
- i += scnprintf(buf + i, max - i, "CID=%d\n",ctxt->wds_client_id);
+ i += scnprintf(buf + i, max - i, "CID=%d\n", ctxt->wds_client_id);
- if (ctxt->state != STATE_ONLINE){
+ if (ctxt->state != STATE_ONLINE)
return i;
- }
i += scnprintf(buf + i, max - i, "ADDR=%d.%d.%d.%d\n",
ctxt->addr[0], ctxt->addr[1], ctxt->addr[2], ctxt->addr[3]);
--
1.5.6.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-28 18:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-15 21:01 [PATCH] Staging: dream: smd: smd_qmi: fix code style issues Chihau Chau
-- 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
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).