public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RESEND] staging: speakup: fixed checkpatch and sparse warnings in selection.c
@ 2012-06-12 18:44 Chris Yungmann
  2012-06-12 21:36 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Yungmann @ 2012-06-12 18:44 UTC (permalink / raw)
  To: samuel.thibault
  Cc: w.d.hubbs, chris, kirk, gregkh, speakup, linux-kernel,
	kernelnewbies, Chris Yungmann

Left in_atomic() call as more work is needed (see TODO note at top of function).

Signed-off-by: Chris Yungmann <yungmann.chris@gmail.com>
---
 drivers/staging/speakup/selection.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c
index fe1f405..006403d 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -68,7 +68,7 @@ int speakup_set_selection(struct tty_struct *tty)
 	if (spk_sel_cons != vc_cons[fg_console].d) {
 		speakup_clear_selection();
 		spk_sel_cons = vc_cons[fg_console].d;
-		printk(KERN_WARNING
+		pr_warn(KERN_WARNING
 			"Selection: mark console not the same as cut\n");
 		return -EINVAL;
 	}
@@ -95,7 +95,7 @@ int speakup_set_selection(struct tty_struct *tty)
 	/* Allocate a new buffer before freeing the old one ... */
 	bp = kmalloc((sel_end-sel_start)/2+1, GFP_ATOMIC);
 	if (!bp) {
-		printk(KERN_WARNING "selection: kmalloc() failed\n");
+		pr_warn(KERN_WARNING "selection: kmalloc() failed\n");
 		speakup_clear_selection();
 		return -ENOMEM;
 	}
@@ -141,7 +141,7 @@ int speakup_paste_selection(struct tty_struct *tty)
 		count = sel_buffer_lth - pasted;
 		count = min_t(int, count, tty->receive_room);
 		tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
-			0, count);
+			NULL, count);
 		pasted += count;
 	}
 	remove_wait_queue(&vc->paste_wait, &wait);
-- 
1.7.10


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

* Re: [PATCH][RESEND] staging: speakup: fixed checkpatch and sparse warnings in selection.c
  2012-06-12 18:44 [PATCH][RESEND] staging: speakup: fixed checkpatch and sparse warnings in selection.c Chris Yungmann
@ 2012-06-12 21:36 ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2012-06-12 21:36 UTC (permalink / raw)
  To: Chris Yungmann
  Cc: samuel.thibault, w.d.hubbs, chris, kirk, speakup, linux-kernel,
	kernelnewbies

On Tue, Jun 12, 2012 at 02:44:11PM -0400, Chris Yungmann wrote:
> Left in_atomic() call as more work is needed (see TODO note at top of function).
> 
> Signed-off-by: Chris Yungmann <yungmann.chris@gmail.com>
> ---
>  drivers/staging/speakup/selection.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c
> index fe1f405..006403d 100644
> --- a/drivers/staging/speakup/selection.c
> +++ b/drivers/staging/speakup/selection.c
> @@ -68,7 +68,7 @@ int speakup_set_selection(struct tty_struct *tty)
>  	if (spk_sel_cons != vc_cons[fg_console].d) {
>  		speakup_clear_selection();
>  		spk_sel_cons = vc_cons[fg_console].d;
> -		printk(KERN_WARNING
> +		pr_warn(KERN_WARNING

Nope, that will not work, sorry.

Actually, please use dev_warn() and friends instead of "raw" printk()
calls is the better thing to do.

thanks,

greg k-h

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

* [PATCH][RESEND] staging: speakup: fixed checkpatch and sparse warnings in selection.c
@ 2012-06-13 16:39 Chris Yungmann
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Yungmann @ 2012-06-13 16:39 UTC (permalink / raw)
  To: samuel.thibault
  Cc: w.d.hubbs, chris, kirk, gregkh, speakup, linux-kernel,
	kernelnewbies, Chris Yungmann

Signed-off-by: Chris Yungmann <yungmann.chris@gmail.com>
---
 drivers/staging/speakup/selection.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c
index fe1f405..0612df0 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -68,7 +68,7 @@ int speakup_set_selection(struct tty_struct *tty)
 	if (spk_sel_cons != vc_cons[fg_console].d) {
 		speakup_clear_selection();
 		spk_sel_cons = vc_cons[fg_console].d;
-		printk(KERN_WARNING
+		dev_warn(tty->dev,
 			"Selection: mark console not the same as cut\n");
 		return -EINVAL;
 	}
@@ -95,7 +95,7 @@ int speakup_set_selection(struct tty_struct *tty)
 	/* Allocate a new buffer before freeing the old one ... */
 	bp = kmalloc((sel_end-sel_start)/2+1, GFP_ATOMIC);
 	if (!bp) {
-		printk(KERN_WARNING "selection: kmalloc() failed\n");
+		dev_warn(tty->dev, "selection: kmalloc() failed\n");
 		speakup_clear_selection();
 		return -ENOMEM;
 	}
@@ -141,7 +141,7 @@ int speakup_paste_selection(struct tty_struct *tty)
 		count = sel_buffer_lth - pasted;
 		count = min_t(int, count, tty->receive_room);
 		tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted,
-			0, count);
+			NULL, count);
 		pasted += count;
 	}
 	remove_wait_queue(&vc->paste_wait, &wait);
-- 
1.7.10


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

end of thread, other threads:[~2012-06-13 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12 18:44 [PATCH][RESEND] staging: speakup: fixed checkpatch and sparse warnings in selection.c Chris Yungmann
2012-06-12 21:36 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2012-06-13 16:39 Chris Yungmann

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