modules: fix build with -Wmissing-prototypes
Mainline commit 0fcb70851fbf ("Makefile.extrawarn: turn on missing-prototypes globally") in 6.8-rc1 enables -Wmissing-prototypes globally, revealing a lot of unclean code and also some actual problems. This is also the case in vmmon and vmnet modules. Most of them are addressed by making functions used only within one file static. The missing prototype of random_get_entropy_fallback() is handled by including <linux/timex.h> rather than <asm/timex.h>. Finally, there are four functions in vmnet module which are actually used in multiple files but instead of proper declarations, their prototype is duplicated in vmnet-only/driver.c, risking that the two copies won't match (which actually happened in one case). The cleanest solution would be creating separate header files for them (bridge.h, netif.h, userif.h and vnetUserListener.h) and including them in the respective source file and driver.c. As the developers already handle similar cases by simply putting the declarations into vnetInt.h, let us do the same to keep things simple.
This commit is contained in:
parent
4798e59690
commit
e4bfec0cc8
|
@ -542,7 +542,7 @@ Task_Terminate(void)
|
|||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Selector
|
||||
static Selector
|
||||
TaskGetFlatWriteableDataSegment(void)
|
||||
{
|
||||
DTR hostGDTR;
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
#include "x86svm.h"
|
||||
#include "x86cpuid_asm.h"
|
||||
#if defined(__linux__)
|
||||
#include <asm/timex.h>
|
||||
#include <linux/timex.h>
|
||||
#endif
|
||||
#include "perfctr.h"
|
||||
#include "x86vtinstr.h"
|
||||
|
@ -583,7 +583,7 @@ Vmx86_Calloc(size_t numElements, // IN
|
|||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
Vmx86FreeVMDriver(VMDriver *vm)
|
||||
{
|
||||
Vmx86_Free(vm->ptRootMpns);
|
||||
|
@ -616,7 +616,7 @@ Vmx86FreeVMDriver(VMDriver *vm)
|
|||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
VMDriver *
|
||||
static VMDriver *
|
||||
Vmx86AllocVMDriver(uint32 numVCPUs)
|
||||
{
|
||||
VMDriver *vm = Vmx86_Calloc(1, sizeof *vm, TRUE);
|
||||
|
|
|
@ -258,7 +258,7 @@ LinuxDriverInitTSCkHz(void)
|
|||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
LinuxDriverInit(void)
|
||||
{
|
||||
int retval;
|
||||
|
@ -347,7 +347,7 @@ LinuxDriverInit(void)
|
|||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
LinuxDriverExit(void)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -3021,7 +3021,7 @@ HostIF_CallOnEachCPU(void (*func)(void*), // IN: function to call
|
|||
*-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Bool
|
||||
static Bool
|
||||
HostIFCheckTrackedMPN(VMDriver *vm, // IN: The VM instance
|
||||
MPN mpn) // IN: The MPN
|
||||
{
|
||||
|
@ -3141,7 +3141,7 @@ HostIF_ReadPhysical(VMDriver *vm, // IN: The VM instance
|
|||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
HostIFWritePhysicalWork(MA ma, // MA to be written to
|
||||
VA64 addr, // src data to write
|
||||
Bool kernelBuffer, // is the buffer in kernel space?
|
||||
|
@ -3300,7 +3300,7 @@ HostIF_GetCurrentPCPU(void)
|
|||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
HostIFStartTimer(Bool rateChanged, //IN: Did rate change?
|
||||
unsigned int rate) //IN: current clock rate
|
||||
{
|
||||
|
|
|
@ -1413,7 +1413,7 @@ VNetBridgeComputeHeaderPos(struct sk_buff *skb) // IN: buffer to examine
|
|||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
VNetBridgeSendLargePacket(struct sk_buff *skb, // IN: packet to split
|
||||
VNetBridge *bridge) // IN: bridge
|
||||
{
|
||||
|
|
|
@ -51,18 +51,6 @@
|
|||
|
||||
#include "vmnetInt.h"
|
||||
|
||||
/*
|
||||
* Initialization and creation routines from other files.
|
||||
* Putting them here reduces the need for so many header files.
|
||||
*/
|
||||
|
||||
extern int VNetUserIf_Create(VNetPort **ret);
|
||||
extern int VNetNetIf_Create(char *devName, VNetPort **ret, int hubNum);
|
||||
extern int VNetBridge_Create(char *devName, uint32 flags, VNetJack *hubJack,
|
||||
VNetPort **ret);
|
||||
extern int VNetUserListener_Create(uint32 classMask, VNetJack *hubJack, VNetPort **ret);
|
||||
|
||||
|
||||
/*
|
||||
* Structure for cycle detection of host interfaces. This
|
||||
* struct is only used by VNetCycleDetectIf().
|
||||
|
@ -296,7 +284,7 @@ VNetRemovePortFromList(const VNetPort *port) // IN: port to remove from list
|
|||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
vmnet_init_module(void)
|
||||
{
|
||||
int retval;
|
||||
|
@ -375,7 +363,7 @@ err_proto:
|
|||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
vmnet_cleanup_module(void)
|
||||
{
|
||||
unregister_chrdev(VNET_MAJOR_NUMBER, "vmnet");
|
||||
|
|
|
@ -218,6 +218,13 @@ extern int VNetProc_Init(void);
|
|||
|
||||
extern void VNetProc_Cleanup(void);
|
||||
|
||||
int VNetNetIf_Create(char *devName, VNetPort **ret, int hubNum);
|
||||
int VNetUserIf_Create(VNetPort **ret);
|
||||
int VNetBridge_Create(const char *devName, uint32 flags, VNetJack *hubJack,
|
||||
VNetPort **ret);
|
||||
int VNetUserListener_Create(uint32 classMask, VNetJack *hubJack,
|
||||
VNetPort **port);
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue