mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: speakup: fixed checkpatch and sparse warnings in selection.c
@ 2012-06-02 17:32 Chris Yungmann
  2012-06-03 14:20 ` Samuel Thibault
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Yungmann @ 2012-06-02 17:32 UTC (permalink / raw)
  To: yungmann.chris, w.d.hubbs, chris, kirk, samuel.thibault, gregkh
  Cc: speakup, linux-kernel, kernelnewbies

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

diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c
index fe1f405..496c81e 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;
 	}
@@ -132,7 +132,7 @@ int speakup_paste_selection(struct tty_struct *tty)
 	while (sel_buffer && sel_buffer_lth > pasted) {
 		set_current_state(TASK_INTERRUPTIBLE);
 		if (test_bit(TTY_THROTTLED, &tty->flags)) {
-			if (in_atomic())
+			if (in_interrupt())
 				/* if we are in an interrupt handler, abort */
 				break;
 			schedule();
@@ -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	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: speakup: fixed checkpatch and sparse warnings in selection.c
  2012-06-02 17:32 [PATCH] staging: speakup: fixed checkpatch and sparse warnings in selection.c Chris Yungmann
@ 2012-06-03 14:20 ` Samuel Thibault
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2012-06-03 14:20 UTC (permalink / raw)
  To: Chris Yungmann
  Cc: w.d.hubbs, chris, kirk, gregkh, speakup, linux-kernel, kernelnewbies

Chris Yungmann, le Sat 02 Jun 2012 12:32:38 -0500, a écrit :
> @@ -132,7 +132,7 @@ int speakup_paste_selection(struct tty_struct *tty)
>  	while (sel_buffer && sel_buffer_lth > pasted) {
>  		set_current_state(TASK_INTERRUPTIBLE);
>  		if (test_bit(TTY_THROTTLED, &tty->flags)) {
> -			if (in_atomic())
> +			if (in_interrupt())
>  				/* if we are in an interrupt handler, abort */
>  				break;
>  			schedule();

I'd rather keep in_atomic(), which is clearly known to be broken (see
TODO above).

Samuel

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

end of thread, other threads:[~2012-06-03 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-02 17:32 [PATCH] staging: speakup: fixed checkpatch and sparse warnings in selection.c Chris Yungmann
2012-06-03 14:20 ` Samuel Thibault

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®