Commit c52bb3e1 authored by Alessandro Rubini's avatar Alessandro Rubini

trivial: arch-bare-i386/: checkpatch fixes

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 7255f628
......@@ -84,8 +84,7 @@ struct bare_sockaddr_ll {
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
#define SOL_IP 0
/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use
SOL_ICMP=1 */
/* #define SOL_ICMP 1 No-no-no! We cannot use SOL_ICMP=1 */
#define SOL_TCP 6
#define SOL_UDP 17
#define SOL_IPV6 41
......@@ -195,6 +194,7 @@ struct bare_timeval {
#define ADJ_STATUS 0x0010 /* clock status */
#define ADJ_TIMECONST 0x0020 /* pll time constant */
#define ADJ_TAI 0x0080 /* set TAI offset */
#define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */
#define ADJ_MICRO 0x1000 /* select microsecond resolution */
#define ADJ_NANO 0x2000 /* select nanosecond resolution */
#define ADJ_TICK 0x4000 /* tick value */
......@@ -209,6 +209,9 @@ struct bare_timeval {
#define MOD_ESTERROR ADJ_ESTERROR
#define MOD_STATUS ADJ_STATUS
#define MOD_TIMECONST ADJ_TIMECONST
#define MOD_TAI ADJ_TAI
#define MOD_MICRO ADJ_MICRO
#define MOD_NANO ADJ_NANO
struct bare_timex {
unsigned int modes; /* mode selector */
......@@ -222,7 +225,7 @@ struct bare_timex {
long tolerance; /* clock frequency tolerance (ppm)
* (read only)
*/
struct bare_timeval time; /* (read only) */
struct bare_timeval time; /* (RO, except for ADJ_SETOFFSET) */
long tick; /* (modified) usecs between clock ticks */
long ppsfreq; /* pps frequency (scaled ppm) (ro) */
......
......@@ -71,7 +71,7 @@ int pp_memcmp(const void *cs, const void *ct, int count)
const unsigned char *su1, *su2;
int res = 0;
for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
if ((res = *su1 - *su2) != 0)
break;
return res;
......
......@@ -28,11 +28,10 @@ int bare_send_packet(struct pp_instance *ppi, void *pkt, int len,
hdr = PROTO_HDR(pkt);
hdr->h_proto = htons(ETH_P_1588);
if (OPTS(ppi)->gptp_mode) {
if (OPTS(ppi)->gptp_mode)
memcpy(hdr->h_dest, PP_PEER_MACADDRESS, 6);
} else {
else
memcpy(hdr->h_dest, PP_MCAST_MACADDRESS, 6);
}
/* raw socket implementation always uses gen socket */
memcpy(hdr->h_source, NP(ppi)->ch[PP_NP_GEN].addr, 6);
......
......@@ -9,7 +9,7 @@ int bare_timer_init(struct pp_instance *ppi)
{
uint32_t i;
for(i =0; i<PP_TIMER_ARRAY_SIZE; i++)
for (i = 0; i < PP_TIMER_ARRAY_SIZE; i++)
ppi->timers[i] = &bare_timers[i];
return 0;
......@@ -27,7 +27,7 @@ int bare_timer_start(uint32_t interval_ms, struct pp_timer *tm)
int bare_timer_stop(struct pp_timer *tm)
{
tm->interval_ms= 0;
tm->interval_ms = 0;
tm->start = 0;
return 0;
......@@ -39,7 +39,7 @@ int bare_timer_expired(struct pp_timer *tm)
uint64_t now_ms;
if (tm->start == 0) {
PP_PRINTF("%p Warning: bare_timer_expired: timer not started\n",tm);
PP_PRINTF("%s: Warning: timer %p not started\n", __func__, tm);
return 0;
}
......
......@@ -24,8 +24,8 @@ _syscall1(int, time, void *, tz)
_syscall3(int, ioctl, int, fd, int, cmd, void *, arg)
_syscall1(int, select, struct sel_arg_struct *, as)
static _syscall2(int, socketcall, int, call, unsigned long *, args)
_syscall2(int, gettimeofday, void *, tv, void *,z);
_syscall2(int, settimeofday, void *, tv, void *,z);
_syscall2(int, gettimeofday, void *, tv, void *, z);
_syscall2(int, settimeofday, void *, tv, void *, z);
_syscall1(int, adjtimex, void *, tv);
_syscall2(int, clock_gettime, int, clock, void *, t);
_syscall1(int, close, int, fd);
......@@ -140,7 +140,8 @@ int sys_shutdown(int fd, int flags)
return socketcall(SYS_SHUTDOWN, args);
}
int sys_setsockopt(int fd, int level, int optname, const void *optval, int optlen)
int sys_setsockopt(int fd, int level, int optname, const void *optval,
int optlen)
{
args[0] = fd;
args[1] = level;
......
......@@ -17,80 +17,83 @@ do { \
} while (0)
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#define _syscall0(type,name) \
#define _syscall0(type, name) \
type name(void) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name)); \
__syscall_return(type,__res); \
__syscall_return(type, __res); \
}
#define _syscall1(type,name,type1,arg1) \
#define _syscall1(type, name, type1, arg1) \
type name(type1 arg1) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1))); \
__syscall_return(type,__res); \
: "0" (__NR_##name), "b" ((long)(arg1))); \
__syscall_return(type, __res); \
}
#define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) \
#define _syscall2(type, name, type1, arg1, type2, arg2) \
type name(type1 arg1, type2 arg2) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \
__syscall_return(type,__res); \
: "0" (__NR_##name), "b" ((long)(arg1)), "c" ((long)(arg2))); \
__syscall_return(type, __res); \
}
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) \
#define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
type name(type1 arg1, type2 arg2, type3 arg3) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
: "0" (__NR_##name), "b" ((long)(arg1)), "c" ((long)(arg2)), \
"d" ((long)(arg3))); \
__syscall_return(type,__res); \
__syscall_return(type, __res); \
}
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
#define _syscall4(type, name, type1, arg1, type2, arg2, type3, arg3, \
type4, arg4) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
"d" ((long)(arg3)),"S" ((long)(arg4))); \
__syscall_return(type,__res); \
: "0" (__NR_##name), "b" ((long)(arg1)), "c" ((long)(arg2)), \
"d" ((long)(arg3)), "S" ((long)(arg4))); \
__syscall_return(type, __res); \
}
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5) \
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
#define _syscall5(type, name, type1, arg1, type2, arg2, type3, arg3, \
type4, arg4, type5, arg5) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
"d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \
__syscall_return(type,__res); \
: "0" (__NR_##name), "b" ((long)(arg1)), "c" ((long)(arg2)), \
"d" ((long)(arg3)), "S" ((long)(arg4)), "D" ((long)(arg5))); \
__syscall_return(type, __res); \
}
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5,type6,arg6) \
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
#define _syscall6(type, name, type1, arg1, type2, arg2, type3, arg3, \
type4, arg4, type5, arg5, type6, arg6) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, \
type6 arg6) \
{ \
long __res; \
__asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; int $0x80 ; pop %%ebp" \
__asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; " \
"movl %1,%%eax ; int $0x80 ; pop %%ebp" \
: "=a" (__res) \
: "i" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
"d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5)), \
: "i" (__NR_##name), "b" ((long)(arg1)), "c" ((long)(arg2)), \
"d" ((long)(arg3)), "S" ((long)(arg4)), "D" ((long)(arg5)), \
"0" ((long)(arg6))); \
__syscall_return(type,__res); \
__syscall_return(type, __res); \
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment