diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c index d5dc222..5ce0538 100644 --- a/drivers/dahdi/xpp/card_bri.c +++ b/drivers/dahdi/xpp/card_bri.c @@ -1611,12 +1611,18 @@ static const struct phoneops bri_phoneops = { }; static xproto_table_t PROTO_TABLE(BRI) = { - .owner = THIS_MODULE,.entries = { + .owner = THIS_MODULE, + .entries = { /* Table Card Opcode */ - },.name = "BRI", /* protocol name */ -.ports_per_subunit = 1,.type = XPD_TYPE_BRI,.xops = - &bri_xops,.phoneops = &bri_phoneops,.packet_is_valid = - bri_packet_is_valid,.packet_dump = bri_packet_dump,}; + }, + .name = "BRI", /* protocol name */ + .ports_per_subunit = 1, + .type = XPD_TYPE_BRI, + .xops = &bri_xops, + .phoneops = &bri_phoneops, + .packet_is_valid = bri_packet_is_valid, + .packet_dump = bri_packet_dump, +}; static bool bri_packet_is_valid(xpacket_t *pack) { diff --git a/drivers/dahdi/xpp/card_echo.c b/drivers/dahdi/xpp/card_echo.c index 7107917..3155656 100644 --- a/drivers/dahdi/xpp/card_echo.c +++ b/drivers/dahdi/xpp/card_echo.c @@ -272,12 +272,19 @@ static const struct echoops echoops = { }; static xproto_table_t PROTO_TABLE(ECHO) = { - .owner = THIS_MODULE,.entries = { + .owner = THIS_MODULE, + .entries = { /* Table Card Opcode */ -XENTRY(ECHO, ECHO, SET_REPLY),},.name = "ECHO",.ports_per_subunit = - 1,.type = XPD_TYPE_ECHO,.xops = &echo_xops,.echoops = - &echoops,.packet_is_valid = - echo_packet_is_valid,.packet_dump = echo_packet_dump,}; + XENTRY( ECHO, ECHO, SET_REPLY ), + }, + .name = "ECHO", + .ports_per_subunit = 1, + .type = XPD_TYPE_ECHO, + .xops = &echo_xops, + .echoops = &echoops, + .packet_is_valid = echo_packet_is_valid, + .packet_dump = echo_packet_dump, +}; static bool echo_packet_is_valid(xpacket_t *pack) { diff --git a/drivers/dahdi/xpp/card_fxo.c b/drivers/dahdi/xpp/card_fxo.c index aca1a83..6c76903 100644 --- a/drivers/dahdi/xpp/card_fxo.c +++ b/drivers/dahdi/xpp/card_fxo.c @@ -1219,12 +1219,19 @@ static const struct phoneops fxo_phoneops = { }; static xproto_table_t PROTO_TABLE(FXO) = { - .owner = THIS_MODULE,.entries = { + .owner = THIS_MODULE, + .entries = { /* Prototable Card Opcode */ - XENTRY(FXO, FXO, SIG_CHANGED),},.name = "FXO", /* protocol name */ -.ports_per_subunit = 8,.type = XPD_TYPE_FXO,.xops = - &fxo_xops,.phoneops = &fxo_phoneops,.packet_is_valid = - fxo_packet_is_valid,.packet_dump = fxo_packet_dump,}; + XENTRY( FXO, FXO, SIG_CHANGED ), + }, + .name = "FXO", /* protocol name */ + .ports_per_subunit = 8, + .type = XPD_TYPE_FXO, + .xops = &fxo_xops, + .phoneops = &fxo_phoneops, + .packet_is_valid = fxo_packet_is_valid, + .packet_dump = fxo_packet_dump, +}; static bool fxo_packet_is_valid(xpacket_t *pack) { diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c index e36606d..8991895 100644 --- a/drivers/dahdi/xpp/card_fxs.c +++ b/drivers/dahdi/xpp/card_fxs.c @@ -1641,12 +1641,19 @@ static const struct phoneops fxs_phoneops = { }; static xproto_table_t PROTO_TABLE(FXS) = { - .owner = THIS_MODULE,.entries = { + .owner = THIS_MODULE, + .entries = { /* Prototable Card Opcode */ - XENTRY(FXS, FXS, SIG_CHANGED),},.name = "FXS", /* protocol name */ -.ports_per_subunit = 8,.type = XPD_TYPE_FXS,.xops = - &fxs_xops,.phoneops = &fxs_phoneops,.packet_is_valid = - fxs_packet_is_valid,.packet_dump = fxs_packet_dump,}; + XENTRY( FXS, FXS, SIG_CHANGED ), + }, + .name = "FXS", /* protocol name */ + .ports_per_subunit = 8, + .type = XPD_TYPE_FXS, + .xops = &fxs_xops, + .phoneops = &fxs_phoneops, + .packet_is_valid = fxs_packet_is_valid, + .packet_dump = fxs_packet_dump, +}; static bool fxs_packet_is_valid(xpacket_t *pack) { diff --git a/drivers/dahdi/xpp/card_global.c b/drivers/dahdi/xpp/card_global.c index 7965d68..1387b2f 100644 --- a/drivers/dahdi/xpp/card_global.c +++ b/drivers/dahdi/xpp/card_global.c @@ -268,7 +268,7 @@ static int execute_chip_command(xpd_t *xpd, const int argc, char *argv[]) writing, /* writing */ regnum, do_subreg, /* use subreg */ subreg, /* subreg */ - data_low, do_datah, /* use data_high */ + data_low, do_datah, /* use data_high */ data_high); #endif ret = xpp_register_request(xpd->xbus, xpd, portno, @@ -627,14 +627,17 @@ HANDLER_DEF(GLOBAL, ERROR_CODE) xproto_table_t PROTO_TABLE(GLOBAL) = { .entries = { - /* Prototable Card Opcode */ -XENTRY(GLOBAL, GLOBAL, NULL_REPLY), XENTRY(GLOBAL, GLOBAL, - AB_DESCRIPTION), - XENTRY(GLOBAL, GLOBAL, SYNC_REPLY), - XENTRY(GLOBAL, GLOBAL, ERROR_CODE), - XENTRY(GLOBAL, GLOBAL, REGISTER_REPLY),},.name = - "GLOBAL",.packet_is_valid = - global_packet_is_valid,.packet_dump = global_packet_dump,}; + /* Prototable Card Opcode */ + XENTRY( GLOBAL, GLOBAL, NULL_REPLY ), + XENTRY( GLOBAL, GLOBAL, AB_DESCRIPTION ), + XENTRY( GLOBAL, GLOBAL, SYNC_REPLY ), + XENTRY( GLOBAL, GLOBAL, ERROR_CODE ), + XENTRY( GLOBAL, GLOBAL, REGISTER_REPLY ), + }, + .name = "GLOBAL", + .packet_is_valid = global_packet_is_valid, + .packet_dump = global_packet_dump, +}; static bool global_packet_is_valid(xpacket_t *pack) { diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c index dde5903..4d69ce9 100644 --- a/drivers/dahdi/xpp/card_pri.c +++ b/drivers/dahdi/xpp/card_pri.c @@ -2266,12 +2266,18 @@ static const struct phoneops pri_phoneops = { }; static xproto_table_t PROTO_TABLE(PRI) = { - .owner = THIS_MODULE,.entries = { + .owner = THIS_MODULE, + .entries = { /* Table Card Opcode */ - },.name = "PRI", /* protocol name */ -.ports_per_subunit = 1,.type = XPD_TYPE_PRI,.xops = - &pri_xops,.phoneops = &pri_phoneops,.packet_is_valid = - pri_packet_is_valid,.packet_dump = pri_packet_dump,}; + }, + .name = "PRI", /* protocol name */ + .ports_per_subunit = 1, + .type = XPD_TYPE_PRI, + .xops = &pri_xops, + .phoneops = &pri_phoneops, + .packet_is_valid = pri_packet_is_valid, + .packet_dump = pri_packet_dump, +}; static bool pri_packet_is_valid(xpacket_t *pack) { diff --git a/drivers/dahdi/xpp/mmapdrv.c b/drivers/dahdi/xpp/mmapdrv.c index d258581..6384d18 100644 --- a/drivers/dahdi/xpp/mmapdrv.c +++ b/drivers/dahdi/xpp/mmapdrv.c @@ -465,11 +465,11 @@ static int __init xpp_mmap_load_fpga(u8 * data, size_t size) */ for (j = 0; j < 8; j++) { - if (__u8 &1) + if (__u8 & 1) bfin_write_PORTGIO_SET(DATA); else bfin_write_PORTGIO_CLEAR(DATA); - __u8 >>=1; + __u8 >>= 1; bfin_write_PORTGIO_SET(DCLK); bfin_write_PORTGIO_CLEAR(DCLK); } diff --git a/drivers/dahdi/xpp/xbus-core.c b/drivers/dahdi/xpp/xbus-core.c index a316b0b..1f60920 100644 --- a/drivers/dahdi/xpp/xbus-core.c +++ b/drivers/dahdi/xpp/xbus-core.c @@ -1813,7 +1813,8 @@ static int proc_xbus_command_write(struct file *file, int val; char hexdigit[3]; - while (*p && isspace(*p)) // skip whitespace + /* skip whitespace */ + while (*p && isspace(*p)) p++; if (!(*p)) break; diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c index 3181da7..cff5f15 100644 --- a/drivers/dahdi/xpp/xbus-sysfs.c +++ b/drivers/dahdi/xpp/xbus-sysfs.c @@ -291,20 +291,18 @@ static DEVICE_ATTR_READER(driftinfo_show, dev, buf) static ssize_t \ field##_show(struct device *dev, struct device_attribute *attr, char *buf) \ { \ - xbus_t *xbus; \ - \ - xbus = dev_to_xbus(dev); \ - return sprintf (buf, format_string, xbus->field); \ + xbus_t *xbus; \ + xbus = dev_to_xbus(dev); \ + return sprintf(buf, format_string, xbus->field); \ } #else #define xbus_attr(field, format_string) \ static ssize_t \ field##_show(struct device *dev, char *buf) \ { \ - xbus_t *xbus; \ - \ - xbus = dev_to_xbus(dev); \ - return sprintf (buf, format_string, xbus->field); \ + xbus_t *xbus; \ + xbus = dev_to_xbus(dev); \ + return sprintf(buf, format_string, xbus->field); \ } #endif diff --git a/drivers/dahdi/xpp/xdefs.h b/drivers/dahdi/xpp/xdefs.h index 3c2edf2..8da10ea 100644 --- a/drivers/dahdi/xpp/xdefs.h +++ b/drivers/dahdi/xpp/xdefs.h @@ -158,7 +158,7 @@ typedef char *charp; /* Also don't define this for later RHEL >= 5.2 . hex_asc is from the * same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch * as is the bool typedef. */ -#if LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 18) || ! defined(hex_asc) +#if LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 18) || !defined(hex_asc) typedef int bool; #endif #endif diff --git a/drivers/dahdi/xpp/xpp_usb.c b/drivers/dahdi/xpp/xpp_usb.c index dd9e4b2..5b5900c 100644 --- a/drivers/dahdi/xpp/xpp_usb.c +++ b/drivers/dahdi/xpp/xpp_usb.c @@ -510,20 +510,23 @@ static const struct xusb_model_info { struct xusb_endpoint out; } model_table[] = { [MODEL_FPGA_XPD] = { - .iface_num = 0,.in = { - .ep_addr = 0x86},.out = { -.ep_addr = 0x02},.desc = "FPGA_XPD"},}; + .iface_num = 0, + .in = { .ep_addr = 0x86 }, + .out = { .ep_addr = 0x02 }, + .desc = "FPGA_XPD" + }, +}; /* table of devices that work with this driver */ static const struct usb_device_id xusb_table[] = { /* FPGA_FXS */ {USB_DEVICE(0xE4E4, 0x1132), - .driver_info = (kernel_ulong_t) & model_table[MODEL_FPGA_XPD]}, + .driver_info = (kernel_ulong_t)&model_table[MODEL_FPGA_XPD]}, /* FPGA_1141 */ {USB_DEVICE(0xE4E4, 0x1142), - .driver_info = (kernel_ulong_t) & model_table[MODEL_FPGA_XPD]}, + .driver_info = (kernel_ulong_t)&model_table[MODEL_FPGA_XPD]}, /* FPGA_1151 */ {USB_DEVICE(0xE4E4, 0x1152), - .driver_info = (kernel_ulong_t) & model_table[MODEL_FPGA_XPD]}, + .driver_info = (kernel_ulong_t)&model_table[MODEL_FPGA_XPD]}, /* FPGA_1161 */ {USB_DEVICE(0xE4E4, 0x1162), - .driver_info = (kernel_ulong_t) & model_table[MODEL_FPGA_XPD]}, + .driver_info = (kernel_ulong_t)&model_table[MODEL_FPGA_XPD]}, /* Terminate */ {} }; @@ -640,7 +643,7 @@ static int set_endpoints(xusb_t *xusb, struct usb_host_interface *iface_desc, ep_addr, endpoint->bmAttributes); continue; } - if (usb_pipein(ep_addr)) { // Input + if (usb_pipein(ep_addr)) { /* Input */ if (ep_addr == model_info->in.ep_addr) { if (!check_usb1(endpoint)) return 0; @@ -649,7 +652,7 @@ static int set_endpoints(xusb_t *xusb, struct usb_host_interface *iface_desc, xusb_ep->max_size = endpoint->wMaxPacketSize; xusb_ep->callback = xpp_receive_callback; } - } else { // Output + } else { /* Output */ if (ep_addr == model_info->out.ep_addr) { if (!check_usb1(endpoint)) return 0; @@ -832,7 +835,7 @@ probe_failed: ERR("Failed to initialize xpp usb bus: %d\n", retval); usb_set_intfdata(interface, NULL); if (xusb) { - if (xusb->minor) { // passed registration phase + if (xusb->minor) { /* passed registration phase */ ERR("Calling usb_deregister_dev()\n"); usb_deregister_dev(interface, &xusb_class); } diff --git a/drivers/dahdi/xpp/xproto.h b/drivers/dahdi/xpp/xproto.h index cdfb018..321dd81 100644 --- a/drivers/dahdi/xpp/xproto.h +++ b/drivers/dahdi/xpp/xproto.h @@ -85,7 +85,7 @@ typedef __u8 xpd_type_t; #define XPD_TYPE_PREFIX "xpd-type-" -#define MODULE_ALIAS_XPD(type) \ +#define MODULE_ALIAS_XPD(type) \ MODULE_ALIAS(XPD_TYPE_PREFIX __stringify(type)) #define PCM_CHUNKSIZE (CHANNELS_PERXPD * 8) /* samples of 8 bytes */ @@ -96,26 +96,26 @@ bool valid_xpd_addr(const struct xpd_addr *addr); #define XPROTO_HANDLER(card, op) XPROTO_NAME(card, op ## _handler) #define XPROTO_CALLER(card, op) XPROTO_NAME(card, op ## _send) -#define HANDLER_DEF(card, op) \ +#define HANDLER_DEF(card, op) \ static int XPROTO_HANDLER(card, op) ( \ xbus_t *xbus, \ xpd_t *xpd, \ const xproto_entry_t *cmd, \ xpacket_t *pack) -#define CALL_PROTO(card, op, ...) XPROTO_CALLER(card, op)( __VA_ARGS__ ) +#define CALL_PROTO(card, op, ...) XPROTO_CALLER(card, op)(__VA_ARGS__) -#define DECLARE_CMD(card, op, ...) \ - int CALL_PROTO(card, op, xbus_t *xbus, xpd_t *xpd, ## __VA_ARGS__ ) +#define DECLARE_CMD(card, op, ...) \ + int CALL_PROTO(card, op, xbus_t *xbus, xpd_t *xpd, ## __VA_ARGS__) -#define HOSTCMD(card, op, ...) \ - DECLARE_CMD(card, op, ## __VA_ARGS__ ) +#define HOSTCMD(card, op, ...) \ + DECLARE_CMD(card, op, ## __VA_ARGS__) #define RPACKET_NAME(card, op) XPROTO_NAME(RPACKET_ ## card, op) #define RPACKET_TYPE(card, op) struct RPACKET_NAME(card, op) -#define DEF_RPACKET_DATA(card, op, ...) \ - RPACKET_TYPE(card, op) { \ +#define DEF_RPACKET_DATA(card, op, ...) \ + RPACKET_TYPE(card, op) { \ struct xpacket_header head; \ __VA_ARGS__ \ } PACKED @@ -124,7 +124,7 @@ bool valid_xpd_addr(const struct xpd_addr *addr); (((RPACKET_TYPE(card, op) *)(p))->field) #define RPACKET_SIZE(card, op) sizeof(RPACKET_TYPE(card, op)) -#define XENTRY(prototab, module, op) \ +#define XENTRY(prototab, module, op) \ [ XPROTO_NAME(module, op) ] = { \ .handler = XPROTO_HANDLER(module, op), \ .datalen = RPACKET_SIZE(module, op), \ @@ -132,7 +132,7 @@ bool valid_xpd_addr(const struct xpd_addr *addr); .table = &PROTO_TABLE(prototab) \ } -#define XPACKET_INIT(p, card, op, to, pcm, pcmslot) \ +#define XPACKET_INIT(p, card, op, to, pcm, pcmslot) \ do { \ XPACKET_OP(p) = XPROTO_NAME(card, op); \ XPACKET_LEN(p) = RPACKET_SIZE(card, op); \ @@ -145,9 +145,9 @@ bool valid_xpd_addr(const struct xpd_addr *addr); XPACKET_ADDR_RESERVED(p) = 0; \ } while (0) -#define XFRAME_NEW_CMD(frm, p, xbus, card, op, to) \ +#define XFRAME_NEW_CMD(frm, p, xbus, card, op, to) \ do { \ - int pack_len = RPACKET_SIZE(card, op); \ + int pack_len = RPACKET_SIZE(card, op); \ \ if (!XBUS_FLAGS(xbus, CONNECTED)) \ return -ENODEV; \ @@ -219,16 +219,16 @@ xproto_handler_t xproto_global_handler(__u8 opcode); * CALL_XMETHOD() calls the method, passing mandatory arguments */ #define XMETHOD(name, xpd) ((xpd)->xops->name) -#define CALL_XMETHOD(name, xpd, ...) \ - (XMETHOD(name, (xpd))((xpd)->xbus, (xpd), ## __VA_ARGS__ )) +#define CALL_XMETHOD(name, xpd, ...) \ + (XMETHOD(name, (xpd))((xpd)->xbus, (xpd), ## __VA_ARGS__)) /* * PHONE_METHOD() resolve to method pointer (NULL for optional methods) * CALL_PHONE_METHOD() calls the method, passing mandatory arguments */ #define PHONE_METHOD(name, xpd) (PHONEDEV(xpd).phoneops->name) -#define CALL_PHONE_METHOD(name, xpd, ...) \ - (PHONE_METHOD(name, (xpd))((xpd), ## __VA_ARGS__ )) +#define CALL_PHONE_METHOD(name, xpd, ...) \ + (PHONE_METHOD(name, (xpd))((xpd), ## __VA_ARGS__)) struct phoneops { void (*card_pcm_recompute) (xpd_t *xpd, xpp_line_t pcm_mask);