Skip to content

Commit

Permalink
auxdisplay: small cleanups
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Jul 24, 2008
1 parent 5bb49fc commit b340e8a
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions drivers/auxdisplay/cfag12864b.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,9 @@ static int __init cfag12864b_init(void)
"ks0108 is not initialized\n");
goto none;
}
BUILD_BUG_ON(PAGE_SIZE < CFAG12864B_SIZE);

if (PAGE_SIZE < CFAG12864B_SIZE) {
printk(KERN_ERR CFAG12864B_NAME ": ERROR: "
"page size (%i) < cfag12864b size (%i)\n",
(unsigned int)PAGE_SIZE, CFAG12864B_SIZE);
ret = -ENOMEM;
goto none;
}

cfag12864b_buffer = (unsigned char *) __get_free_page(GFP_KERNEL);
cfag12864b_buffer = (unsigned char *) get_zeroed_page(GFP_KERNEL);
if (cfag12864b_buffer == NULL) {
printk(KERN_ERR CFAG12864B_NAME ": ERROR: "
"can't get a free page\n");
Expand All @@ -367,8 +360,6 @@ static int __init cfag12864b_init(void)
if (cfag12864b_workqueue == NULL)
goto cachealloced;

memset(cfag12864b_buffer, 0, CFAG12864B_SIZE);

cfag12864b_clear();
cfag12864b_on();

Expand Down

0 comments on commit b340e8a

Please sign in to comment.