tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Some kernel void functions do return a value



On Fri, Oct 14, 2011 at 03:23:05PM +0200, Nicolas Joly wrote:
> 
> Hi,
> 
> While linting the kernel amd64 GENERIC sources, i noted that some void
> functions do return a value:
> 
> /local/src/NetBSD/src/sys/arch/x86/x86/bus_dma.c(1321): void function 
> bus_dmamap_sync cannot return value [213]
> /local/src/NetBSD/src/sys/dev/ic/bwivar.h(773): void function 
> bwi_rf_lo_update cannot return value [213]
> /local/src/NetBSD/src/sys/dev/pci/if_sip.c(1113): void function sipcom_attach 
> cannot return value [213]
> /local/src/NetBSD/src/sys/dev/pci/if_sip.c(1129): void function sipcom_attach 
> cannot return value [213]
> /local/src/NetBSD/src/sys/kern/subr_vmem.c(1070): void function vmem_free 
> cannot return value [213]
> /local/src/NetBSD/src/sys/kern/subr_vmem.c(210): void function xfree cannot 
> return value [213]
> 
> Could someone with more knowledge of corresponding sub-systems,
> especially dma and vmem, have look ?

This isn't just a lint bug?  At least two of these are instances of void
functions returning the return "value" of a void function, for which
the compiler need neither throw away a value nor create one from whole
nothing.  The compiler doesn't complain---should it?  For example:

static void
sipcom_do_detach(...)
{ ... }

static void
sipcom_attach(...)
{
        return sipcom_do_detach(...);
}

Dave

-- 
David Young             OJC Technologies is now Pixo
dyoung%pixotech.com@localhost     Urbana, IL   (217) 344-0444 x24


Home | Main Index | Thread Index | Old Index