* [PATCH] auxdisplay: small cleanups
@ 2008-07-05 11:21 Akinobu Mita
2008-07-06 0:12 ` Miguel Ojeda
0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2008-07-05 11:21 UTC (permalink / raw)
To: linux-kernel; +Cc: Miguel Ojeda Sandonis
- 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>
---
drivers/auxdisplay/cfag12864b.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
Index: 2.6-git/drivers/auxdisplay/cfag12864b.c
===================================================================
--- 2.6-git.orig/drivers/auxdisplay/cfag12864b.c
+++ 2.6-git/drivers/auxdisplay/cfag12864b.c
@@ -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");
@@ -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();
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] auxdisplay: small cleanups
2008-07-05 11:21 [PATCH] auxdisplay: small cleanups Akinobu Mita
@ 2008-07-06 0:12 ` Miguel Ojeda
0 siblings, 0 replies; 2+ messages in thread
From: Miguel Ojeda @ 2008-07-06 0:12 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-kernel, Miguel Ojeda Sandonis
On Sat, Jul 5, 2008 at 1:21 PM, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> - Use BUILD_BUG_ON for CFAG12864B_SIZE instead of runtime-check
>
> - Use get_zeroed_page()
Thank you very much! I will test it soon (~10th of July). In the meantime:
Signed-off-by: Miguel Ojeda Sandonis <maxextreme@gmail.com>
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Miguel Ojeda Sandonis <maxextreme@gmail.com>
> ---
> drivers/auxdisplay/cfag12864b.c | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
>
> Index: 2.6-git/drivers/auxdisplay/cfag12864b.c
> ===================================================================
> --- 2.6-git.orig/drivers/auxdisplay/cfag12864b.c
> +++ 2.6-git/drivers/auxdisplay/cfag12864b.c
> @@ -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");
> @@ -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();
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-06 0:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-05 11:21 [PATCH] auxdisplay: small cleanups Akinobu Mita
2008-07-06 0:12 ` Miguel Ojeda
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®