]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] fbdev: Replace kmalloc with kzalloc
authorAntonino A. Daplas <adaplas@gmail.com>
Tue, 10 Jan 2006 04:53:45 +0000 (20:53 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 10 Jan 2006 16:01:51 +0000 (08:01 -0800)
Replace kmalloc with kzalloc

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/video/fbcvt.c
drivers/video/fbmon.c
drivers/video/fbsysfs.c
drivers/video/vgastate.c

index 0b6af00d197e058af63663fad76fe84d6c802d57..ac90883dc3aa310ea23016ba9cf01f95165f91ba 100644 (file)
@@ -214,12 +214,11 @@ static void fb_cvt_print_name(struct fb_cvt_data *cvt)
 {
        u32 pixcount, pixcount_mod;
        int cnt = 255, offset = 0, read = 0;
-       u8 *buf = kmalloc(256, GFP_KERNEL);
+       u8 *buf = kzalloc(256, GFP_KERNEL);
 
        if (!buf)
                return;
 
-       memset(buf, 0, 256);
        pixcount = (cvt->xres * (cvt->yres/cvt->interlace))/1000000;
        pixcount_mod = (cvt->xres * (cvt->yres/cvt->interlace)) % 1000000;
        pixcount_mod /= 1000;
index 0ef75a9f84affb10277d283f1d3d4573f513f262..7c74e7325d95a1830ef0d36aac0680462ff62fac 100644 (file)
@@ -528,10 +528,9 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
        unsigned char *block;
        int num = 0, i;
 
-       mode = kmalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
+       mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
        if (mode == NULL)
                return NULL;
-       memset(mode, 0, 50 * sizeof(struct fb_videomode));
 
        if (edid == NULL || !edid_checksum(edid) || 
            !edid_check_header(edid)) {
index 35147030a3e8eb8310defb3f5058136083ff2641..6d26057337e262e1c762ae2de279a02a9054273d 100644 (file)
@@ -43,10 +43,11 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
        if (size)
                fb_info_size += PADDING;
 
-       p = kmalloc(fb_info_size + size, GFP_KERNEL);
+       p = kzalloc(fb_info_size + size, GFP_KERNEL);
+
        if (!p)
                return NULL;
-       memset(p, 0, fb_info_size + size);
+
        info = (struct fb_info *) p;
 
        if (size)
index d9e01daee630dae2283c27bdf559dd93597b5c1a..15179ec62339f4dd6a02897442ded8bf85d6ab3e 100644 (file)
@@ -356,10 +356,11 @@ int save_vga(struct vgastate *state)
 {
        struct regstate *saved;
 
-       saved = kmalloc(sizeof(struct regstate), GFP_KERNEL);
+       saved = kzalloc(sizeof(struct regstate), GFP_KERNEL);
+
        if (saved == NULL)
                return 1;
-       memset (saved, 0, sizeof(struct regstate));
+
        state->vidstate = (void *)saved;
                
        if (state->flags & VGA_SAVE_CMAP) {