Fix checkpatch issue - ERROR:POINTER_LOCATION
This commit changes the pointer's location in order to comply with
the defined coding style.
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@linux.intel.com>
Change-Id: Ibcf1ef0e4fc53b0cb5286b36119e76d017f24cd9
diff --git a/host/src/dec2hex/dec2hex.c b/host/src/dec2hex/dec2hex.c
index a190465..fc6a01c 100644
--- a/host/src/dec2hex/dec2hex.c
+++ b/host/src/dec2hex/dec2hex.c
@@ -34,7 +34,7 @@
#include <stdlib.h>
void usage (
- char* progname /* name of the program to use */
+ char *progname /* name of the program to use */
)
{
fprintf (stderr, "Utility converts decimal numbers to hexadecimal\n");
@@ -43,7 +43,7 @@
int main (
int argc,
- char* argv[]
+ char *argv[]
)
{
if (argc != 2)
diff --git a/host/src/genIdt/genIdt.c b/host/src/genIdt/genIdt.c
index a423ca7..98de22c 100644
--- a/host/src/genIdt/genIdt.c
+++ b/host/src/genIdt/genIdt.c
@@ -84,7 +84,7 @@
typedef struct s_isrList
{
- void * fnc;
+ void *fnc;
unsigned int dpl;
} ISR_LIST;
@@ -213,8 +213,8 @@
{
unsigned int i;
unsigned int size;
- void * spurAddr;
- void * spurNoErrAddr;
+ void *spurAddr;
+ void *spurNoErrAddr;
/*
* First find the address of the spurious interrupt handlers. They are the
@@ -257,7 +257,7 @@
while (size--)
{
- void * addr;
+ void *addr;
unsigned int vec;
unsigned int dpl;
diff --git a/host/src/genOffsetHeader/genOffsetHeader.c b/host/src/genOffsetHeader/genOffsetHeader.c
index 66357c3..11c8577 100644
--- a/host/src/genOffsetHeader/genOffsetHeader.c
+++ b/host/src/genOffsetHeader/genOffsetHeader.c
@@ -186,7 +186,7 @@
#endif /* _HGUARD_ */\n";
static Elf32_Ehdr ehdr; /* ELF header */
-static Elf32_Shdr * shdr; /* pointer to array ELF section headers */
+static Elf32_Shdr *shdr; /* pointer to array ELF section headers */
/*******************************************************************************
*
@@ -308,8 +308,8 @@
* byte swapping if the host and target have different byte ordering.
*/
- if (((*(char*)&ix == 0x78) && (ehdr.e_ident[EI_DATA] == ELFDATA2MSB)) ||
- ((*(char*)&ix == 0x12) && (ehdr.e_ident[EI_DATA] == ELFDATA2LSB)))
+ if (((*(char *)&ix == 0x78) && (ehdr.e_ident[EI_DATA] == ELFDATA2MSB)) ||
+ ((*(char *)&ix == 0x12) && (ehdr.e_ident[EI_DATA] == ELFDATA2LSB)))
{
swabRequired = 1;
DBG_PRINT ("Swab required\n");
@@ -460,7 +460,7 @@
char **ppStringTable /* ptr to ptr to string table */
)
{
- char * pTable;
+ char *pTable;
int nBytes;
DBG_PRINT ("Allocating %d bytes for string table\n",
@@ -600,12 +600,12 @@
{
Elf32_Off symTblOffset = 0;
Elf32_Word symTblSize; /* in bytes */
- char * pStringTable = NULL;
- char * inFileName;
- char * outFileName;
+ char *pStringTable = NULL;
+ char *inFileName;
+ char *outFileName;
int option;
int inFd = -1;
- FILE * outFile = NULL;
+ FILE *outFile = NULL;
unsigned strTblIx;
/* argument parsing */
diff --git a/host/src/include/vxmicro/util.h b/host/src/include/vxmicro/util.h
index 2b516c4..e2f3593 100644
--- a/host/src/include/vxmicro/util.h
+++ b/host/src/include/vxmicro/util.h
@@ -35,7 +35,7 @@
#define ALIAS(fn,fn_alias,ret) ret fn_alias() __attribute__((alias(#fn)));
-extern const char * basename(const char *pathname);
+extern const char *basename(const char *pathname);
static inline
unsigned long round_up(unsigned long x, unsigned long align)
diff --git a/host/src/lib/util.c b/host/src/lib/util.c
index ef8491d..b7e047a 100644
--- a/host/src/lib/util.c
+++ b/host/src/lib/util.c
@@ -33,7 +33,7 @@
#include <string.h>
#include <vxmicro/os.h>
-const char * basename(const char *pathname)
+const char *basename(const char *pathname)
{
int end = strlen(pathname)-1;
while(end != -1) {
diff --git a/host/src/mkEvents/mkevents.c b/host/src/mkEvents/mkevents.c
index 81e5d79..d2d5dfd 100644
--- a/host/src/mkEvents/mkevents.c
+++ b/host/src/mkEvents/mkevents.c
@@ -41,7 +41,7 @@
#include <stdlib.h>
void usage (
- char* progname /* name of the program to use */
+ char *progname /* name of the program to use */
)
{
fprintf (stderr, "Utility creates a series of microkernel VPF event objects. Output is sent to stdout.\n");
@@ -52,7 +52,7 @@
int main (
int argc,
- char* argv[]
+ char *argv[]
)
{
int i, j;
diff --git a/include/toolchain/gcc.h b/include/toolchain/gcc.h
index 697f28b..3eefa65 100644
--- a/include/toolchain/gcc.h
+++ b/include/toolchain/gcc.h
@@ -85,7 +85,7 @@
#define UNALIGNED_WRITE(p, v) \
do { \
- unsigned int __attribute__((__may_alias__)) *pp = (unsigned int*)(p); \
+ unsigned int __attribute__((__may_alias__)) *pp = (unsigned int *)(p); \
_Unaligned32Write (pp, (v)); \
} \
while (0)
@@ -94,7 +94,7 @@
#define UNALIGNED_WRITE(p, v) \
do { \
- unsigned int __attribute__((__may_alias__)) *pp = (unsigned int*)(p); \
+ unsigned int __attribute__((__may_alias__)) *pp = (unsigned int *)(p); \
*pp = (v); \
} \
while (0)
diff --git a/lib/libc/minimal/include/stdio.h b/lib/libc/minimal/include/stdio.h
index 1387a3e..502f73b 100644
--- a/lib/libc/minimal/include/stdio.h
+++ b/lib/libc/minimal/include/stdio.h
@@ -73,7 +73,7 @@
int vsprintf(char *restrict s, const char *restrict fmt, va_list list);
int vfprintf(FILE *restrict stream, const char *restrict format, va_list ap);
-int puts(const char* s);
+int puts(const char *s);
int fputc (int c, FILE *stream);
int fputs (const char *restrict s, FILE *restrict stream);
diff --git a/samples/microkernel/test/test_sprintf/src/test_sprintf.c b/samples/microkernel/test/test_sprintf/src/test_sprintf.c
index c7f0f09..13c88e1 100644
--- a/samples/microkernel/test/test_sprintf/src/test_sprintf.c
+++ b/samples/microkernel/test/test_sprintf/src/test_sprintf.c
@@ -494,7 +494,7 @@
char buffer[100];
/*******************/
- sprintf (buffer, "%p", (void*) DEADBEEF);
+ sprintf (buffer, "%p", (void *) DEADBEEF);
if (strcmp (buffer, DEADBEEF_PTR_STR) != 0)
{
TC_ERROR ("sprintf(%%p). Expected '%s', got '%s'\n",
diff --git a/samples/microkernel/test/test_static_idt/src/static_idt.c b/samples/microkernel/test/test_static_idt/src/static_idt.c
index c55e7b8..3561370 100644
--- a/samples/microkernel/test/test_static_idt/src/static_idt.c
+++ b/samples/microkernel/test/test_static_idt/src/static_idt.c
@@ -58,8 +58,8 @@
extern unsigned char _IdtBaseAddress[];
-extern void * nanoIntStub;
-extern void * exc_divide_error_handlerStub;
+extern void *nanoIntStub;
+extern void *exc_divide_error_handlerStub;
NANO_CPU_INT_REGISTER (nanoIntStub, TEST_SOFT_INT, 0);
@@ -142,7 +142,7 @@
int nanoIdtStubTest(void)
{
- IDT_ENTRY * pIdtEntry;
+ IDT_ENTRY *pIdtEntry;
uint16_t offset;
/* Check for the interrupt stub */
diff --git a/samples/microkernel/test/test_task/src/task.c b/samples/microkernel/test/test_task/src/task.c
index 720ffcd..053cfd6 100644
--- a/samples/microkernel/test/test_task/src/task.c
+++ b/samples/microkernel/test/test_task/src/task.c
@@ -88,7 +88,7 @@
void isr_task_command_handler(void *data)
{
- ISR_INFO * pInfo = (ISR_INFO *) data;
+ ISR_INFO *pInfo = (ISR_INFO *) data;
int value = -1;
switch (pInfo->cmd)
diff --git a/samples/nanokernel/test/test_context/src/context.c b/samples/nanokernel/test/test_context/src/context.c
index 8280d55..9b6c62d 100644
--- a/samples/nanokernel/test/test_context/src/context.c
+++ b/samples/nanokernel/test/test_context/src/context.c
@@ -96,7 +96,7 @@
int error; /* error value (if any) */
union
{
- void * data; /* pointer to data to use or return */
+ void *data; /* pointer to data to use or return */
int value; /* value to be passed or returned */
};
}
@@ -115,7 +115,7 @@
static struct nano_sem wakeFiber;
static struct nano_timer timer;
-static void * timerData[1];
+static void *timerData[1];
static int fiberDetectedError = 0;
static char fiberStack1[FIBER_STACKSIZE];
diff --git a/samples/nanokernel/test/test_fifo/src/fifo.c b/samples/nanokernel/test/test_fifo/src/fifo.c
index 5848005..e2e67e3 100644
--- a/samples/nanokernel/test/test_fifo/src/fifo.c
+++ b/samples/nanokernel/test/test_fifo/src/fifo.c
@@ -87,7 +87,7 @@
typedef struct
{
struct nano_fifo *channel; /* FIFO channel */
- void * data; /* pointer to data to add */
+ void *data; /* pointer to data to add */
} ISR_FIFO_INFO;
/* globals */
@@ -105,7 +105,7 @@
struct nano_sem nanoSemObjTask; /* Used to block/wake-up task */
struct nano_timer timer;
-void * timerData[1];
+void *timerData[1];
int myFifoData1[4];
int myFifoData2[2];
@@ -165,7 +165,7 @@
void isr_fifo_put(void *parameter)
{
- ISR_FIFO_INFO * pInfo = (ISR_FIFO_INFO *) parameter;
+ ISR_FIFO_INFO *pInfo = (ISR_FIFO_INFO *) parameter;
nano_isr_fifo_put (pInfo->channel, pInfo->data);
}
@@ -184,7 +184,7 @@
void isr_fifo_get(void *parameter)
{
- ISR_FIFO_INFO * pInfo = (ISR_FIFO_INFO *) parameter;
+ ISR_FIFO_INFO *pInfo = (ISR_FIFO_INFO *) parameter;
pInfo->data = nano_isr_fifo_get (pInfo->channel);
}
@@ -199,7 +199,7 @@
void fiber1(void)
{
- void * pData; /* pointer to FIFO object get from the queue */
+ void *pData; /* pointer to FIFO object get from the queue */
int count = 0; /* counter */
/* Wait for fiber1 to be activated. */
@@ -276,8 +276,8 @@
void testFiberFifoGetW(void)
{
- void * pGetData; /* pointer to FIFO object get from the queue */
- void * pPutData; /* pointer to FIFO object to put to the queue */
+ void *pGetData; /* pointer to FIFO object get from the queue */
+ void *pPutData; /* pointer to FIFO object to put to the queue */
TC_PRINT("Test Fiber FIFO Get Wait Interfaces\n\n");
pGetData = nano_fiber_fifo_get_wait(&nanoFifoObj2);
@@ -327,7 +327,7 @@
void testIsrFifoFromFiber(void)
{
- void * pGetData; /* pointer to FIFO object get from the queue */
+ void *pGetData; /* pointer to FIFO object get from the queue */
TC_PRINT("Test ISR FIFO (invoked from Fiber)\n\n");
@@ -384,8 +384,8 @@
void testIsrFifoFromTask(void)
{
- void * pGetData; /* pointer to FIFO object get from the queue */
- void * pPutData; /* pointer to FIFO object put to queue */
+ void *pGetData; /* pointer to FIFO object get from the queue */
+ void *pPutData; /* pointer to FIFO object put to queue */
int count = 0; /* counter */
TC_PRINT("Test ISR FIFO (invoked from Task)\n\n");
@@ -447,7 +447,7 @@
void fiber2(void)
{
- void * pData; /* pointer to FIFO object from the queue */
+ void *pData; /* pointer to FIFO object from the queue */
/* Wait for fiber2 to be activated */
@@ -507,7 +507,7 @@
void fiber3(void)
{
- void * pData;
+ void *pData;
/* Wait for fiber3 to be activated */
nano_fiber_sem_take_wait (&nanoSemObj3);
@@ -557,8 +557,8 @@
void testTaskFifoGetW(void)
{
- void * pGetData; /* pointer to FIFO object get from the queue */
- void * pPutData; /* pointer to FIFO object to put to the queue */
+ void *pGetData; /* pointer to FIFO object get from the queue */
+ void *pPutData; /* pointer to FIFO object to put to the queue */
PRINT_LINE;
TC_PRINT("Test Task FIFO Get Wait Interfaces\n\n");
@@ -627,7 +627,7 @@
void main(void)
{
- void * pData; /* pointer to FIFO object get from the queue */
+ void *pData; /* pointer to FIFO object get from the queue */
int count = 0; /* counter */
TC_START("Test Nanokernel FIFO");
diff --git a/samples/nanokernel/test/test_lifo/src/lifo.c b/samples/nanokernel/test/test_lifo/src/lifo.c
index 7e3471e..6f65429 100644
--- a/samples/nanokernel/test/test_lifo/src/lifo.c
+++ b/samples/nanokernel/test/test_lifo/src/lifo.c
@@ -70,7 +70,7 @@
typedef struct
{
struct nano_lifo *channel; /* LIFO channel */
- void * data; /* pointer to data to add */
+ void *data; /* pointer to data to add */
} ISR_LIFO_INFO;
typedef struct
@@ -94,7 +94,7 @@
static struct nano_sem taskWaitSem; /* task waits on this semaphore */
static struct nano_sem fiberWaitSem; /* fiber waits on this semaphore */
static struct nano_timer timer;
-static void * timerData[1];
+static void *timerData[1];
static ISR_LIFO_INFO isrLifoInfo = {&lifoChannel, NULL};
static volatile int fiberDetectedFailure = 0; /* non-zero on failure */
@@ -118,7 +118,7 @@
void isr_lifo_put(void *data)
{
- ISR_LIFO_INFO * pInfo = (ISR_LIFO_INFO *) data;
+ ISR_LIFO_INFO *pInfo = (ISR_LIFO_INFO *) data;
nano_isr_lifo_put (pInfo->channel, pInfo->data);
}
@@ -137,7 +137,7 @@
void isr_lifo_get(void *data)
{
- ISR_LIFO_INFO * pInfo = (ISR_LIFO_INFO *) data;
+ ISR_LIFO_INFO *pInfo = (ISR_LIFO_INFO *) data;
pInfo->data = nano_isr_lifo_get (pInfo->channel);
}
@@ -155,7 +155,7 @@
int fiberLifoWaitTest(void)
{
- void * data; /* ptr to data retrieved from LIFO */
+ void *data; /* ptr to data retrieved from LIFO */
/*
* The LIFO is empty; wait for an item to be added to the LIFO
@@ -217,7 +217,7 @@
int fiberLifoNonWaitTest(void)
{
- void * data; /* pointer to data retrieved from LIFO */
+ void *data; /* pointer to data retrieved from LIFO */
/* The LIFO has two items in it; retrieve them both */
@@ -391,7 +391,7 @@
int taskLifoNonWaitTest(void)
{
- void * data; /* ptr to data retrieved from LIFO */
+ void *data; /* ptr to data retrieved from LIFO */
/*
* The fiber is presently waiting for <fiberWaitSem>. Populate the LIFO
diff --git a/samples/nanokernel/test/test_sema/src/sema.c b/samples/nanokernel/test/test_sema/src/sema.c
index eb80497..be02249 100644
--- a/samples/nanokernel/test/test_sema/src/sema.c
+++ b/samples/nanokernel/test/test_sema/src/sema.c
@@ -87,7 +87,7 @@
static int fiberDetectedFailure = 0;
static struct nano_timer timer;
-static void * timerData[1];
+static void *timerData[1];
static char fiberStack[FIBER_STACKSIZE];
@@ -109,7 +109,7 @@
void isr_sem_take(void *data)
{
- ISR_SEM_INFO * pInfo = (ISR_SEM_INFO *) data;
+ ISR_SEM_INFO *pInfo = (ISR_SEM_INFO *) data;
pInfo->data = nano_isr_sem_take (pInfo->sem);
}
@@ -128,7 +128,7 @@
void isr_sem_give(void *data)
{
- ISR_SEM_INFO * pInfo = (ISR_SEM_INFO *) data;
+ ISR_SEM_INFO *pInfo = (ISR_SEM_INFO *) data;
nano_isr_sem_give (pInfo->sem);
pInfo->data = 1; /* Indicate semaphore has been given */
diff --git a/samples/nanokernel/test/test_stack/src/stack.c b/samples/nanokernel/test/test_stack/src/stack.c
index 0e06da0..a5ae47e 100644
--- a/samples/nanokernel/test/test_stack/src/stack.c
+++ b/samples/nanokernel/test/test_stack/src/stack.c
@@ -113,7 +113,7 @@
uint32_t stack1[NUM_STACK_ELEMENT];
uint32_t stack2[NUM_STACK_ELEMENT];
-void * timerData[1];
+void *timerData[1];
int retCode = TC_PASS;
/* locals */
@@ -132,8 +132,8 @@
void testFiberStackPopW(void);
void testTaskStackPopW(void);
/* Isr related functions */
-void isr_stack_push(void * parameter);
-void isr_stack_pop(void * parameter);
+void isr_stack_push(void *parameter);
+void isr_stack_pop(void *parameter);
void testIsrStackFromFiber(void);
void testIsrStackFromTask(void);
@@ -170,7 +170,7 @@
void isr_stack_push(void *parameter)
{
- ISR_STACK_INFO * pInfo = (ISR_STACK_INFO *) parameter;
+ ISR_STACK_INFO *pInfo = (ISR_STACK_INFO *) parameter;
nano_isr_stack_push (pInfo->channel, pInfo->data);
@@ -191,7 +191,7 @@
void isr_stack_pop(void *parameter)
{
- ISR_STACK_INFO * pInfo = (ISR_STACK_INFO *) parameter;
+ ISR_STACK_INFO *pInfo = (ISR_STACK_INFO *) parameter;
if (nano_isr_stack_pop (pInfo->channel, &(pInfo->data)) == 0)
{
diff --git a/samples/nanokernel/test/test_timer/src/timer.c b/samples/nanokernel/test/test_timer/src/timer.c
index 49980dc..345242b 100644
--- a/samples/nanokernel/test/test_timer/src/timer.c
+++ b/samples/nanokernel/test/test_timer/src/timer.c
@@ -76,10 +76,10 @@
static struct nano_sem wakeTask;
static struct nano_sem wakeFiber;
-static void * timerData[1];
-static void * shortTimerData[1];
-static void * longTimerData[1];
-static void * midTimerData[1];
+static void *timerData[1];
+static void *shortTimerData[1];
+static void *longTimerData[1];
+static void *midTimerData[1];
static int fiberDetectedError = 0;
static char fiberStack[FIBER_STACKSIZE];
@@ -136,7 +136,7 @@
uint32_t tick; /* current tick */
uint32_t elapsed; /* # of elapsed ticks */
uint32_t duration; /* duration of the test in ticks */
- void * result; /* value returned from timer get routine */
+ void *result; /* value returned from timer get routine */
int busywaited = 0; /* non-zero if <getRtn> returns NULL */
TC_PRINT (" - test expected to take four seconds\n");
@@ -243,7 +243,7 @@
int busyWaitTimers(timer_get_func getRtn)
{
int numExpired = 0; /* # of expired timers */
- void * result; /* value returned from <getRtn> */
+ void *result; /* value returned from <getRtn> */
uint32_t ticks; /* tick by which time test should be complete */
TC_PRINT (" - test expected to take five or six seconds\n");
diff --git a/shared/include/nanokernel/x86/idtEnt.h b/shared/include/nanokernel/x86/idtEnt.h
index b1e355e..0d68bbd 100644
--- a/shared/include/nanokernel/x86/idtEnt.h
+++ b/shared/include/nanokernel/x86/idtEnt.h
@@ -104,12 +104,12 @@
static inline void _IdtEntCreate
(
- unsigned long long * pIdtEntry, /* Pointer to where the entry is be built */
+ unsigned long long *pIdtEntry, /* Pointer to where the entry is be built */
void (*routine) (void *), /* Routine to call when interrupt occurs */
unsigned int dpl /* priv level for interrupt descriptor */
)
{
- unsigned long * pIdtEntry32 = (unsigned long *)pIdtEntry;
+ unsigned long *pIdtEntry32 = (unsigned long *)pIdtEntry;
pIdtEntry32[0] = (KERNEL_CODE_SEG_SELECTOR << 16) |
((unsigned short)(unsigned int)routine);