Re: [PATCH] add NULL short circuit to fb_dealloc_cmap()

2005-07-26 Thread Geert Uytterhoeven
On Sun, 17 Jul 2005, Jon Smirl wrote: > On 7/17/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > > > > > struct fb_super_cmap { > > >struct fb_cmap cmap; > > >__u16 red[255]; > > >__u16 blue[255]; > > >__u16 green[255]; > > >__u16 transp[255]; > > ^^^ > >

Re: [PATCH] add NULL short circuit to fb_dealloc_cmap()

2005-07-17 Thread Jon Smirl
On 7/17/05, Geert Uytterhoeven <[EMAIL PROTECTED]> wrote: > > > > struct fb_super_cmap { > >struct fb_cmap cmap; > >__u16 red[255]; > >__u16 blue[255]; > >__u16 green[255]; > >__u16 transp[255]; > ^^^ > I assume you meant 256? > > > } > > > > Then adjust the c

Re: [PATCH] add NULL short circuit to fb_dealloc_cmap()

2005-07-17 Thread Jan Engelhardt
>> struct fb_super_cmap { >>struct fb_cmap cmap; >>__u16 red[255]; >>__u16 blue[255]; >>__u16 green[255]; >>__u16 transp[255]; > ^^^ >I assume you meant 256? Even if it really was 255, it should probably be made 256 to have things aligned <-- if that matters.

Re: [PATCH] add NULL short circuit to fb_dealloc_cmap()

2005-07-17 Thread Geert Uytterhoeven
On Sun, 17 Jul 2005, Jon Smirl wrote: > On 7/17/05, Jesper Juhl <[EMAIL PROTECTED]> wrote: > > Resource freeing functions should generally be safe to call with NULL > > pointers. > > Why? > > - there is some precedence in the kernel for this for deallocation > > functions. > > - removes the nee

Re: [PATCH] add NULL short circuit to fb_dealloc_cmap()

2005-07-17 Thread Jon Smirl
On 7/17/05, Jesper Juhl <[EMAIL PROTECTED]> wrote: > Resource freeing functions should generally be safe to call with NULL > pointers. > Why? > - there is some precedence in the kernel for this for deallocation functions. > - removes the need for callers to check pointers for NULL. > - space is

[PATCH] add NULL short circuit to fb_dealloc_cmap()

2005-07-17 Thread Jesper Juhl
Resource freeing functions should generally be safe to call with NULL pointers. Why? - there is some precedence in the kernel for this for deallocation functions. - removes the need for callers to check pointers for NULL. - space is saved overall by less code to test pointers for NULL all over t