svn commit: r213680 - user/weongyo/usb/sys/dev/usb
Weongyo Jeong
weongyo at FreeBSD.org
Mon Oct 11 01:05:42 UTC 2010
Author: weongyo
Date: Mon Oct 11 01:05:42 2010
New Revision: 213680
URL: http://svn.freebsd.org/changeset/base/213680
Log:
style(9)
Modified:
user/weongyo/usb/sys/dev/usb/usb_pf.c
user/weongyo/usb/sys/dev/usb/usb_pf.h
Modified: user/weongyo/usb/sys/dev/usb/usb_pf.c
==============================================================================
--- user/weongyo/usb/sys/dev/usb/usb_pf.c Mon Oct 11 01:02:14 2010 (r213679)
+++ user/weongyo/usb/sys/dev/usb/usb_pf.c Mon Oct 11 01:05:42 2010 (r213680)
@@ -74,18 +74,18 @@ MALLOC_DEFINE(M_USBPF, "USBPktFilter", "
} while (0)
#ifndef __i386__
-#define USBPF_ALIGN
+#define USBPF_ALIGN
#endif
#ifndef USBPF_ALIGN
-#define USBPF_EXTRACT_SHORT(p) ((u_int16_t)ntohs(*(u_int16_t *)p))
-#define USBPF_EXTRACT_LONG(p) (ntohl(*(u_int32_t *)p))
+#define USBPF_EXTRACT_SHORT(p) ((u_int16_t)ntohs(*(u_int16_t *)p))
+#define USBPF_EXTRACT_LONG(p) (ntohl(*(u_int32_t *)p))
#else
-#define USBPF_EXTRACT_SHORT(p) \
+#define USBPF_EXTRACT_SHORT(p) \
((u_int16_t) \
((u_int16_t)*((u_char *)p+0)<<8| \
(u_int16_t)*((u_char *)p+1)<<0))
-#define USBPF_EXTRACT_LONG(p) \
+#define USBPF_EXTRACT_LONG(p) \
((u_int32_t)*((u_char *)p+0)<<24| \
(u_int32_t)*((u_char *)p+1)<<16| \
(u_int32_t)*((u_char *)p+2)<<8| \
@@ -97,7 +97,7 @@ MALLOC_DEFINE(M_USBPF, "USBPktFilter", "
*/
/* instruction classes */
-#define USBPF_CLASS(code) ((code) & 0x07)
+#define USBPF_CLASS(code) ((code) & 0x07)
#define USBPF_LD 0x00
#define USBPF_LDX 0x01
#define USBPF_ST 0x02
@@ -108,11 +108,11 @@ MALLOC_DEFINE(M_USBPF, "USBPktFilter", "
#define USBPF_MISC 0x07
/* ld/ldx fields */
-#define USBPF_SIZE(code) ((code) & 0x18)
+#define USBPF_SIZE(code) ((code) & 0x18)
#define USBPF_W 0x00
#define USBPF_H 0x08
#define USBPF_B 0x10
-#define USBPF_MODE(code) ((code) & 0xe0)
+#define USBPF_MODE(code) ((code) & 0xe0)
#define USBPF_IMM 0x00
#define USBPF_ABS 0x20
#define USBPF_IND 0x40
@@ -121,7 +121,7 @@ MALLOC_DEFINE(M_USBPF, "USBPktFilter", "
#define USBPF_MSH 0xa0
/* alu/jmp fields */
-#define USBPF_OP(code) ((code) & 0xf0)
+#define USBPF_OP(code) ((code) & 0xf0)
#define USBPF_ADD 0x00
#define USBPF_SUB 0x10
#define USBPF_MUL 0x20
@@ -136,28 +136,28 @@ MALLOC_DEFINE(M_USBPF, "USBPktFilter", "
#define USBPF_JGT 0x20
#define USBPF_JGE 0x30
#define USBPF_JSET 0x40
-#define USBPF_SRC(code) ((code) & 0x08)
+#define USBPF_SRC(code) ((code) & 0x08)
#define USBPF_K 0x00
#define USBPF_X 0x08
/* ret - USBPF_K and USBPF_X also apply */
-#define USBPF_RVAL(code) ((code) & 0x18)
+#define USBPF_RVAL(code) ((code) & 0x18)
#define USBPF_A 0x10
/* misc */
-#define USBPF_MISCOP(code) ((code) & 0xf8)
+#define USBPF_MISCOP(code) ((code) & 0xf8)
#define USBPF_TAX 0x00
#define USBPF_TXA 0x80
/*
* Number of scratch memory words (for USBPF_LD|USBPF_MEM and USBPF_ST).
*/
-#define USBPF_MEMWORDS 16
+#define USBPF_MEMWORDS 16
/* Values for ud_state */
-#define USBPF_IDLE 0 /* no select in progress */
-#define USBPF_WAITING 1 /* waiting for read timeout in select */
-#define USBPF_TIMED_OUT 2 /* read timeout has expired in select */
+#define USBPF_IDLE 0 /* no select in progress */
+#define USBPF_WAITING 1 /* waiting for read timeout in select */
+#define USBPF_TIMED_OUT 2 /* read timeout has expired in select */
#define PRIUSB 26 /* interruptible */
@@ -199,10 +199,10 @@ static struct mtx usbpf_mtx; /* global
static int usbpf_uifd_cnt;
static int usbpf_bufsize = 4096;
-#define USBPF_MINBUFSIZE 32
-#define USBPF_MAXBUFSIZE 0x80000
+#define USBPF_MINBUFSIZE 32
+#define USBPF_MAXBUFSIZE 0x80000
static int usbpf_maxbufsize = USBPF_MAXBUFSIZE;
-#define USBPF_MAXINSNS 512
+#define USBPF_MAXINSNS 512
static int usbpf_maxinsns = USBPF_MAXINSNS;
static void
@@ -379,7 +379,7 @@ usbpf_validate(const struct usbpf_insn *
}
#ifdef _KERNEL
-#define MINDEX(m, k) \
+#define MINDEX(m, k) \
{ \
register int len = m->m_len; \
\
@@ -1508,8 +1508,8 @@ usbpf_buf_reclaimed(struct usbpf_d *ud)
* Alignment macros. USBPF_WORDALIGN rounds up to the next
* even multiple of USBPF_ALIGNMENT.
*/
-#define USBPF_ALIGNMENT sizeof(long)
-#define USBPF_WORDALIGN(x) (((x)+(USBPF_ALIGNMENT-1))&~(USBPF_ALIGNMENT-1))
+#define USBPF_ALIGNMENT sizeof(long)
+#define USBPF_WORDALIGN(x) (((x)+(USBPF_ALIGNMENT-1))&~(USBPF_ALIGNMENT-1))
#define SIZEOF_USBPF_HDR(type) \
(offsetof(type, uh_hdrlen) + sizeof(((type *)0)->uh_hdrlen))
Modified: user/weongyo/usb/sys/dev/usb/usb_pf.h
==============================================================================
--- user/weongyo/usb/sys/dev/usb/usb_pf.h Mon Oct 11 01:02:14 2010 (r213679)
+++ user/weongyo/usb/sys/dev/usb/usb_pf.h Mon Oct 11 01:05:42 2010 (r213680)
@@ -77,14 +77,14 @@ struct usbpf_d {
caddr_t ud_sbuf; /* store slot */
caddr_t ud_hbuf; /* hold slot */
caddr_t ud_fbuf; /* free slot */
- int ud_slen; /* current length of store buffer */
- int ud_hlen; /* current length of hold buffer */
+ int ud_slen; /* current length of store buffer */
+ int ud_hlen; /* current length of hold buffer */
int ud_bufsize; /* absolute length of buffers */
struct usbpf_if *ud_bif; /* interface descriptor */
u_long ud_rtout; /* Read timeout in 'ticks' */
- struct usbpf_insn *ud_rfilter; /* read filter code */
+ struct usbpf_insn *ud_rfilter; /* read filter code */
struct usbpf_insn *ud_wfilter; /* write filter code */
void *ud_bfilter; /* binary filter code */
u_int64_t ud_rcount; /* number of packets received */
@@ -115,9 +115,9 @@ struct usbpf_d {
u_char ud_compat32; /* 32-bit stream on LP64 system */
};
-#define USBPFD_LOCK(ud) mtx_lock(&(ud)->ud_mtx)
-#define USBPFD_UNLOCK(ud) mtx_unlock(&(ud)->ud_mtx)
-#define USBPFD_LOCK_ASSERT(ud) mtx_assert(&(ud)->ud_mtx, MA_OWNED)
+#define USBPFD_LOCK(ud) mtx_lock(&(ud)->ud_mtx)
+#define USBPFD_UNLOCK(ud) mtx_unlock(&(ud)->ud_mtx)
+#define USBPFD_LOCK_ASSERT(ud) mtx_assert(&(ud)->ud_mtx, MA_OWNED)
/*
* Descriptor associated with each attached hardware interface.
@@ -130,8 +130,8 @@ struct usbpf_if {
struct mtx uif_mtx; /* mutex for interface */
};
-#define USBPFIF_LOCK(uif) mtx_lock(&(uif)->uif_mtx)
-#define USBPFIF_UNLOCK(uif) mtx_unlock(&(uif)->uif_mtx)
+#define USBPFIF_LOCK(uif) mtx_lock(&(uif)->uif_mtx)
+#define USBPFIF_UNLOCK(uif) mtx_unlock(&(uif)->uif_mtx)
/*
* Structure prepended to each packet.
More information about the svn-src-user
mailing list