From owner-cvs-all Mon Dec 14 15:03:37 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA26897 for cvs-all-outgoing; Mon, 14 Dec 1998 15:03:37 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: (from wpaul@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA26888; Mon, 14 Dec 1998 15:03:31 -0800 (PST) (envelope-from wpaul) From: Bill Paul Message-Id: <199812142303.PAA26888@hub.freebsd.org> Subject: Re: best way to fix function mismatch warning In-Reply-To: <199812142204.OAA49586@apollo.backplane.com> from Matthew Dillon at "Dec 14, 98 02:04:28 pm" To: dillon@apollo.backplane.com (Matthew Dillon) Date: Mon, 14 Dec 1998 15:03:31 -0800 (PST) Cc: brian@Awfulhak.org, committers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > > : > :> This warning occurs because the vxintr function does not match the > :> function type expected by pci_map_int. That is, because pci_map_int > :> expects a void func(void *) function and vxintr is a > :> void func(struct softc *). > :> > :> So, to get rid of the warning do we (a) cast the function pointer > :> in the pci_map_int() call to the correct type or (b) make the function > :> (in dev/vx/*) take a void * and then reassign the variable to a pointer > :> of the right type inside it? Or (c) some other choice that I haven't > :> thought of ? > : > :(a) as there's no overhead.... alternatively, you could try (c) ;-) > > There's no overhead for b either, GCC detects the alias and optimizes > it out. > > -Matt The mechanism used in most of the drivers I've looked at (and the one that I use myself) is b. Usually, you see something like: void foo_intr(xsc) void *xsc; { struct foo_softc *sc = xsc; /* blah */ return; } -Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message