public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/staging/speakup: fix some coding style problem in spk_ttyio.c
@ 2017-05-20 18:43 Rui Teng
  2017-05-22  9:32 ` Greg Kroah-Hartman
  2017-05-22 13:40 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 3+ messages in thread
From: Rui Teng @ 2017-05-20 18:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: speakup, devel, linux-kernel, Rui Teng

This is a patch to the spk_ttyio.c file which fixes up the problems
reported by the checkpatch.pl tool.

Signed-off-by: Rui Teng <rui.teng@linux.vnet.ibm.com>
---
 drivers/staging/speakup/spk_ttyio.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/speakup/spk_ttyio.c b/drivers/staging/speakup/spk_ttyio.c
index 6e0f042f6a44..791da6e6d6ed 100644
--- a/drivers/staging/speakup/spk_ttyio.c
+++ b/drivers/staging/speakup/spk_ttyio.c
@@ -25,10 +25,8 @@ static int spk_ttyio_ldisc_open(struct tty_struct *tty)
 	speakup_tty = tty;
 
 	ldisc_data = kmalloc(sizeof(struct spk_ldisc_data), GFP_KERNEL);
-	if (!ldisc_data) {
-		pr_err("speakup: Failed to allocate ldisc_data.\n");
+	if (!ldisc_data)
 		return -ENOMEM;
-	}
 
 	sema_init(&ldisc_data->sem, 0);
 	ldisc_data->buf_free = true;
@@ -50,6 +48,7 @@ static int spk_ttyio_receive_buf2(struct tty_struct *tty,
 
 	if (spk_ttyio_synth->read_buff_add) {
 		int i;
+
 		for (i = 0; i < count; i++)
 			spk_ttyio_synth->read_buff_add(cp[i]);
 
@@ -61,7 +60,8 @@ static int spk_ttyio_receive_buf2(struct tty_struct *tty,
 		return 0;
 
 	/* Make sure the consumer has read buf before we have seen
-         * buf_free == true and overwrite buf */
+	 * buf_free == true and overwrite buf
+	 */
 	mb();
 
 	ldisc_data->buf = cp[0];
@@ -162,6 +162,7 @@ static int spk_ttyio_out(struct spk_synth *in_synth, const char ch)
 {
 	if (in_synth->alive && speakup_tty && speakup_tty->ops->write) {
 		int ret = speakup_tty->ops->write(speakup_tty, &ch, 1);
+
 		if (ret == 0)
 			/* No room */
 			return 0;
@@ -204,7 +205,8 @@ static unsigned char ttyio_in(int timeout)
 
 	rv = ldisc_data->buf;
 	/* Make sure we have read buf before we set buf_free to let
-	 * the producer overwrite it */
+	 * the producer overwrite it
+	 */
 	mb();
 	ldisc_data->buf_free = true;
 	/* Let TTY push more characters */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers/staging/speakup: fix some coding style problem in spk_ttyio.c
  2017-05-20 18:43 [PATCH] drivers/staging/speakup: fix some coding style problem in spk_ttyio.c Rui Teng
@ 2017-05-22  9:32 ` Greg Kroah-Hartman
  2017-05-22 13:40 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2017-05-22  9:32 UTC (permalink / raw)
  To: Rui Teng; +Cc: speakup, devel, linux-kernel

On Sun, May 21, 2017 at 02:43:47AM +0800, Rui Teng wrote:
> This is a patch to the spk_ttyio.c file which fixes up the problems
> reported by the checkpatch.pl tool.

Be specific as to what you are fixing up please.

And don't do more than one "type" of cleanup in the same patch.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers/staging/speakup: fix some coding style problem in spk_ttyio.c
  2017-05-20 18:43 [PATCH] drivers/staging/speakup: fix some coding style problem in spk_ttyio.c Rui Teng
  2017-05-22  9:32 ` Greg Kroah-Hartman
@ 2017-05-22 13:40 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2017-05-22 13:40 UTC (permalink / raw)
  To: Rui Teng; +Cc: devel, speakup, linux-kernel

On Sun, May 21, 2017 at 02:43:47AM +0800, Rui Teng wrote:
> This is a patch to the spk_ttyio.c file which fixes up the problems
> reported by the checkpatch.pl tool.

"the problems reported" is very very very vague.

Please read my last email to you...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-22 13:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-20 18:43 [PATCH] drivers/staging/speakup: fix some coding style problem in spk_ttyio.c Rui Teng
2017-05-22  9:32 ` Greg Kroah-Hartman
2017-05-22 13:40 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox