diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-07-24 00:31:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:41 -0400 |
commit | b340e8a57ef381e69c99a7a8ede61a6bf71a8014 (patch) | |
tree | a7e975b48d0d6f6cfa49b8173b1b5daf99be580e | |
parent | 5bb49fcd501aa9fd3d321a22b7c01d9b0db7ab36 (diff) |
auxdisplay: small cleanups
- Use BUILD_BUG_ON for CFAG12864B_SIZE instead of runtime-check
- Use get_zeroed_page()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Miguel Ojeda Sandonis <maxextreme@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/auxdisplay/cfag12864b.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/auxdisplay/cfag12864b.c b/drivers/auxdisplay/cfag12864b.c index 683509f013ab..eacb175f6bd3 100644 --- a/drivers/auxdisplay/cfag12864b.c +++ b/drivers/auxdisplay/cfag12864b.c | |||
@@ -336,16 +336,9 @@ static int __init cfag12864b_init(void) | |||
336 | "ks0108 is not initialized\n"); | 336 | "ks0108 is not initialized\n"); |
337 | goto none; | 337 | goto none; |
338 | } | 338 | } |
339 | BUILD_BUG_ON(PAGE_SIZE < CFAG12864B_SIZE); | ||
339 | 340 | ||
340 | if (PAGE_SIZE < CFAG12864B_SIZE) { | 341 | cfag12864b_buffer = (unsigned char *) get_zeroed_page(GFP_KERNEL); |
341 | printk(KERN_ERR CFAG12864B_NAME ": ERROR: " | ||
342 | "page size (%i) < cfag12864b size (%i)\n", | ||
343 | (unsigned int)PAGE_SIZE, CFAG12864B_SIZE); | ||
344 | ret = -ENOMEM; | ||
345 | goto none; | ||
346 | } | ||
347 | |||
348 | cfag12864b_buffer = (unsigned char *) __get_free_page(GFP_KERNEL); | ||
349 | if (cfag12864b_buffer == NULL) { | 342 | if (cfag12864b_buffer == NULL) { |
350 | printk(KERN_ERR CFAG12864B_NAME ": ERROR: " | 343 | printk(KERN_ERR CFAG12864B_NAME ": ERROR: " |
351 | "can't get a free page\n"); | 344 | "can't get a free page\n"); |
@@ -367,8 +360,6 @@ static int __init cfag12864b_init(void) | |||
367 | if (cfag12864b_workqueue == NULL) | 360 | if (cfag12864b_workqueue == NULL) |
368 | goto cachealloced; | 361 | goto cachealloced; |
369 | 362 | ||
370 | memset(cfag12864b_buffer, 0, CFAG12864B_SIZE); | ||
371 | |||
372 | cfag12864b_clear(); | 363 | cfag12864b_clear(); |
373 | cfag12864b_on(); | 364 | cfag12864b_on(); |
374 | 365 | ||