Commit eca02b0c authored by Russell King's avatar Russell King
Browse files

[PATCH] ARM: Cleanup kmalloc in cyber2000fb



We use one kmalloc to allocate two structures needlessly.
Combine these two structures into one.

Signed-off-by: default avatarRussell King <rmk@arm.linux.org.uk>
parent 1f9c381f
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -90,6 +90,8 @@ struct cfb_info {
	 */
	 */
	u_char			ramdac_ctrl;
	u_char			ramdac_ctrl;
	u_char			ramdac_powerdown;
	u_char			ramdac_powerdown;

	u32			pseudo_palette[16];
};
};


static char *default_font = "Acorn8x8";
static char *default_font = "Acorn8x8";
@@ -1223,9 +1225,7 @@ cyberpro_alloc_fb_info(unsigned int id, char *name)
{
{
	struct cfb_info *cfb;
	struct cfb_info *cfb;


	cfb = kmalloc(sizeof(struct cfb_info) +
	cfb = kmalloc(sizeof(struct cfb_info), GFP_KERNEL);
		       sizeof(u32) * 16, GFP_KERNEL);

	if (!cfb)
	if (!cfb)
		return NULL;
		return NULL;


@@ -1281,7 +1281,7 @@ cyberpro_alloc_fb_info(unsigned int id, char *name)


	cfb->fb.fbops		= &cyber2000fb_ops;
	cfb->fb.fbops		= &cyber2000fb_ops;
	cfb->fb.flags		= FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
	cfb->fb.flags		= FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
	cfb->fb.pseudo_palette	= (void *)(cfb + 1);
	cfb->fb.pseudo_palette	= cfb->pseudo_palette;


	fb_alloc_cmap(&cfb->fb.cmap, NR_PALETTE, 0);
	fb_alloc_cmap(&cfb->fb.cmap, NR_PALETTE, 0);