All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH 1/1] uml: replace kmalloc() in line.c
@ 2010-04-16  8:35 Tiger Yang
  2010-04-18 16:34 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Tiger Yang @ 2010-04-16  8:35 UTC (permalink / raw)
  To: user-mode-linux-devel

This patch replace kmalloc() with uml_kmalloc() in line.c and
remove an unused variable.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
---
 arch/um/drivers/line.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 64cda95..616a1f3 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -11,6 +11,7 @@
 #include "irq_user.h"
 #include "kern_util.h"
 #include "os.h"
+#include "um_malloc.h"
 
 #define LINE_BUFSIZE 4096
 
@@ -18,7 +19,6 @@ static irqreturn_t line_interrupt(int irq, void *data)
 {
 	struct chan *chan = data;
 	struct line *line = chan->line;
-	struct tty_struct *tty;
 
 	if (line)
 		chan_interrupt(&line->chan_list, &line->task, line->tty, irq);
@@ -95,7 +95,7 @@ static int buffer_data(struct line *line, const char *buf, int len)
 	int end, room;
 
 	if (line->buffer == NULL) {
-		line->buffer = kmalloc(LINE_BUFSIZE, GFP_ATOMIC);
+		line->buffer = uml_kmalloc(LINE_BUFSIZE, UM_GFP_ATOMIC);
 		if (line->buffer == NULL) {
 			printk(KERN_ERR "buffer_data - atomic allocation "
 			       "failed\n");
@@ -782,7 +782,7 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty,
 {
 	struct winch *winch;
 
-	winch = kmalloc(sizeof(*winch), GFP_KERNEL);
+	winch = uml_kmalloc(sizeof(*winch), UM_GFP_KERNEL);
 	if (winch == NULL) {
 		printk(KERN_ERR "register_winch_irq - kmalloc failed\n");
 		goto cleanup;
@@ -861,7 +861,7 @@ char *add_xterm_umid(char *base)
 		return base;
 
 	len = strlen(base) + strlen(" ()") + strlen(umid) + 1;
-	title = kmalloc(len, GFP_KERNEL);
+	title = uml_kmalloc(len, UM_GFP_KERNEL);
 	if (title == NULL) {
 		printk(KERN_ERR "Failed to allocate buffer for xterm title\n");
 		return base;
-- 
1.5.4.3


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


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

end of thread, other threads:[~2010-04-18 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-16  8:35 [uml-devel] [PATCH 1/1] uml: replace kmalloc() in line.c Tiger Yang
2010-04-18 16:34 ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.