lkml.org 
[lkml]   [2003]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] floppy driver cleanup
Randy.Dunlap writes:
> -static void schedule_bh( void (*handler)(void*) )
> +static void schedule_bh(void (*handler) (void *))
...
> - schedule_bh( (void *)(void *) handler);
> + schedule_bh((void *) handler);
...
> - schedule_bh((void *)(void *)handler);
> + schedule_bh((void *) handler);
...
> - schedule_bh( (void *)(void *) floppy_start);
> + schedule_bh((void *) floppy_start);
...
> - schedule_bh( (void *)(void *) redo_fd_request);
> + schedule_bh((void *) redo_fd_request);

Am I the only one having problems with code like this?
(Not Randy's, the original.)

1. void* and function pointers are not interchangeable.
The casts should be to (void(*)(void*)) not (void*).

2. If shedule_bh() causes handler to be invoked as a
(void(*)(void*)), then handler had better point to a
function with exactly that prototype and nothing else.
Fixing this also eliminates the need for the casts.

IMO changing whitespace while these issues remain is just
a waste of time.

/Mikael
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.086 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site