From: Mikael Pettersson <mikpe@csd.uu.se>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: lkml <linux-kernel@vger.kernel.org>, akpm@osdl.org
Subject: Re: [PATCH] floppy driver cleanup
Date: Thu, 28 Aug 2003 13:19:41 +0200 [thread overview]
Message-ID: <16205.58701.762150.49446@gargle.gargle.HOWL> (raw)
In-Reply-To: <20030827224135.75f344dd.rddunlap@osdl.org>
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
next prev parent reply other threads:[~2003-08-28 11:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-28 5:41 Randy.Dunlap
2003-08-28 11:19 ` Mikael Pettersson [this message]
2003-08-28 15:59 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16205.58701.762150.49446@gargle.gargle.HOWL \
--to=mikpe@csd.uu.se \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rddunlap@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®