From 52d83bde6f10480268c454b3373bfcec8c2e3c3e Mon Sep 17 00:00:00 2001 From: Chihau Chau Date: Thu, 4 Feb 2010 22:27:05 -0300 Subject: Staging: comedi: poc: fix coding style issues This fixes a line over 80 characters and a brace warnings. Signed-off-by: Chihau Chau Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/poc.c b/drivers/staging/comedi/drivers/poc.c index d23e588..28eba6d 100644 --- a/drivers/staging/comedi/drivers/poc.c +++ b/drivers/staging/comedi/drivers/poc.c @@ -136,8 +136,8 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it) /* check if io addresses are available */ if (!request_region(iobase, iosize, "dac02")) { printk - ("I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n", - iobase, iobase + iosize - 1); + ("I/O port conflict: failed to allocate ports 0x%lx to " + "0x%lx\n", iobase, iobase + iosize - 1); return -EIO; } dev->iobase = iobase; @@ -156,9 +156,8 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->insn_write = this_board->winsn; s->insn_read = this_board->rinsn; s->insn_bits = this_board->insnbits; - if (s->type == COMEDI_SUBD_AO || s->type == COMEDI_SUBD_DO) { + if (s->type == COMEDI_SUBD_AO || s->type == COMEDI_SUBD_DO) s->subdev_flags = SDF_WRITABLE; - } return 0; } -- cgit v0.10.2 From dedf3ad1534ff5e30a2eba88afe64bbe7beecfb6 Mon Sep 17 00:00:00 2001 From: Benjamin Adolphi Date: Sat, 6 Feb 2010 20:06:50 +0100 Subject: Staging: comedi: pcmad: Checkpatch cleanups This fixes all checkpatch issues in the pcmad comedi driver. Signed-off-by: Benjamin Adolphi Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/pcmad.c b/drivers/staging/comedi/drivers/pcmad.c index acac670..f7991a9 100644 --- a/drivers/staging/comedi/drivers/pcmad.c +++ b/drivers/staging/comedi/drivers/pcmad.c @@ -34,11 +34,11 @@ Configuration options: [0] - I/O port base [1] - unused [2] - Analog input reference - 0 = single ended - 1 = differential + 0 = single ended + 1 = differential [3] - Analog input encoding (must match jumpers) - 0 = straight binary - 1 = two's complement + 0 = straight binary + 1 = two's complement */ #include @@ -113,9 +113,8 @@ static int pcmad_ai_insn_read(struct comedi_device *dev, data[n] = inb(dev->iobase + PCMAD_LSB); data[n] |= (inb(dev->iobase + PCMAD_MSB) << 8); - if (devpriv->twos_comp) { + if (devpriv->twos_comp) data[n] ^= (1 << (this_board->n_ai_bits - 1)); - } } return n; @@ -135,7 +134,7 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it) unsigned long iobase; iobase = it->options[0]; - printk("comedi%d: pcmad: 0x%04lx ", dev->minor, iobase); + printk(KERN_INFO "comedi%d: pcmad: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, PCMAD_SIZE, "pcmad")) { printk("I/O port conflict\n"); return -EIO; @@ -166,11 +165,11 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it) static int pcmad_detach(struct comedi_device *dev) { - printk("comedi%d: pcmad: remove\n", dev->minor); + printk(KERN_INFO "comedi%d: pcmad: remove\n", dev->minor); - if (dev->irq) { + if (dev->irq) free_irq(dev->irq, dev); - } + if (dev->iobase) release_region(dev->iobase, PCMAD_SIZE); -- cgit v0.10.2 From c2ca6a476a2fde7239a576c1bde8d7cd2ded87a8 Mon Sep 17 00:00:00 2001 From: Graham M Howe Date: Tue, 9 Feb 2010 23:42:25 +0000 Subject: Staging: comedi: fix bracing coding style issue in ni_65xx.c This is a patch to the ni_65xx.c file that fixes up a brace warning found by the checkpatch.pl tool Signed-off-by: Graham M Howe Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index bbf75eb..dad79d5 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c @@ -26,12 +26,13 @@ /* Driver: ni_65xx Description: National Instruments 65xx static dio boards -Author: Jon Grierson , Frank Mori Hess +Author: Jon Grierson , + Frank Mori Hess Status: testing -Devices: [National Instruments] PCI-6509 (ni_65xx), PXI-6509, PCI-6510, PCI-6511, - PXI-6511, PCI-6512, PXI-6512, PCI-6513, PXI-6513, PCI-6514, PXI-6514, PCI-6515, - PXI-6515, PCI-6516, PCI-6517, PCI-6518, PCI-6519, PCI-6520, PCI-6521, PXI-6521, - PCI-6528, PXI-6528 +Devices: [National Instruments] PCI-6509 (ni_65xx), PXI-6509, PCI-6510, + PCI-6511, PXI-6511, PCI-6512, PXI-6512, PCI-6513, PXI-6513, PCI-6514, + PXI-6514, PCI-6515, PXI-6515, PCI-6516, PCI-6517, PCI-6518, PCI-6519, + PCI-6520, PCI-6521, PXI-6521, PCI-6528, PXI-6528 Updated: Wed Oct 18 08:59:11 EDT 2006 Based on the PCI-6527 driver by ds. @@ -418,7 +419,8 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, return -EINVAL; base_bitfield_channel = CR_CHAN(insn->chanspec); for (j = 0; j < max_ports_per_bitfield; ++j) { - const unsigned port_offset = ni_65xx_port_by_channel(base_bitfield_channel) + j; + const unsigned port_offset = + ni_65xx_port_by_channel(base_bitfield_channel) + j; const unsigned port = sprivate(s)->base_port + port_offset; unsigned base_port_channel; @@ -463,11 +465,11 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, * subdevice.) */ port_read_bits ^= 0xFF; } - if (bitshift > 0) { + if (bitshift > 0) port_read_bits <<= bitshift; - } else { + else port_read_bits >>= -bitshift; - } + read_bits |= port_read_bits; } data[1] = read_bits; @@ -532,7 +534,8 @@ static int ni_65xx_intr_cmdtest(struct comedi_device *dev, if (err) return 1; - /* step 2: make sure trigger sources are unique and mutually compatible */ + /* step 2: make sure trigger sources are unique and mutually + compatible */ if (err) return 2; @@ -790,9 +793,9 @@ static int ni_65xx_detach(struct comedi_device *dev) Master_Interrupt_Control); } - if (dev->irq) { + if (dev->irq) free_irq(dev->irq, dev); - } + if (private(dev)) { unsigned i; @@ -802,9 +805,9 @@ static int ni_65xx_detach(struct comedi_device *dev) dev->subdevices[i].private = NULL; } } - if (private(dev)->mite) { + if (private(dev)->mite) mite_unsetup(private(dev)->mite); - } + } return 0; } -- cgit v0.10.2 From 0054a361e44bf71b8bb79b863bcf00e04dc4a464 Mon Sep 17 00:00:00 2001 From: Graham M Howe Date: Wed, 10 Feb 2010 18:11:47 +0000 Subject: Staging: comedi: fix bracing coding style and 80 character issues in ni_660x.c This is a patch to the ni_660x.c file that fixes up the brace and 80 character issues found by the checkpatch tool Signed-off-by: Graham M Howe Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 404d3c5..df61e5a 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -52,7 +52,8 @@ enum ni_660x_constants { }; #define NUM_PFI_CHANNELS 40 -/* really there are only up to 3 dma channels, but the register layout allows for 4 */ +/* really there are only up to 3 dma channels, but the register layout allows +for 4 */ #define MAX_DMA_CHANNEL 4 /* See Register-Level Programmer Manual page 3.1 */ @@ -198,7 +199,7 @@ struct NI_660xRegisterData { const char *name; /* Register Name */ int offset; /* Offset from base address from GPCT chip */ enum ni_660x_register_direction direction; - enum ni_660x_register_width size; /* 1 byte, 2 bytes, or 4 bytes */ + enum ni_660x_register_width size; /*1 byte, 2 bytes, or 4 bytes*/ }; static const struct NI_660xRegisterData registerData[NumRegisters] = { @@ -382,8 +383,8 @@ enum global_interrupt_config_register_bits { }; /* Offset of the GPCT chips from the base-adress of the card */ -static const unsigned GPCT_OFFSET[2] = { 0x0, 0x800 }; /* First chip is at base-address + - 0x00, etc. */ +/* First chip is at base-address + 0x00, etc. */ +static const unsigned GPCT_OFFSET[2] = { 0x0, 0x800 }; /* Board description*/ struct ni_660x_board { @@ -993,9 +994,9 @@ static int ni_660x_allocate_private(struct comedi_device *dev) spin_lock_init(&private(dev)->mite_channel_lock); spin_lock_init(&private(dev)->interrupt_lock); spin_lock_init(&private(dev)->soft_reg_copy_lock); - for (i = 0; i < NUM_PFI_CHANNELS; ++i) { + for (i = 0; i < NUM_PFI_CHANNELS; ++i) private(dev)->pfi_output_selects[i] = pfi_output_select_counter; - } + return 0; } @@ -1008,9 +1009,8 @@ static int ni_660x_alloc_mite_rings(struct comedi_device *dev) for (j = 0; j < counters_per_chip; ++j) { private(dev)->mite_rings[i][j] = mite_alloc_ring(private(dev)->mite); - if (private(dev)->mite_rings[i][j] == NULL) { + if (private(dev)->mite_rings[i][j] == NULL) return -ENOMEM; - } } } return 0; @@ -1022,9 +1022,8 @@ static void ni_660x_free_mite_rings(struct comedi_device *dev) unsigned j; for (i = 0; i < board(dev)->n_chips; ++i) { - for (j = 0; j < counters_per_chip; ++j) { + for (j = 0; j < counters_per_chip; ++j) mite_free_ring(private(dev)->mite_rings[i][j]); - } } } @@ -1078,15 +1077,16 @@ static int ni_660x_attach(struct comedi_device *dev, s->insn_bits = ni_660x_dio_insn_bits; s->insn_config = ni_660x_dio_insn_config; s->io_bits = 0; /* all bits default to input */ - /* we use the ioconfig registers to control dio direction, so zero output enables in stc dio control reg */ + /* we use the ioconfig registers to control dio direction, so zero + output enables in stc dio control reg */ ni_660x_write_register(dev, 0, 0, STCDIOControl); private(dev)->counter_dev = ni_gpct_device_construct(dev, - &ni_gpct_write_register, - &ni_gpct_read_register, - ni_gpct_variant_660x, - ni_660x_num_counters - (dev)); + &ni_gpct_write_register, + &ni_gpct_read_register, + ni_gpct_variant_660x, + ni_660x_num_counters + (dev)); if (private(dev)->counter_dev == NULL) return -ENOMEM; for (i = 0; i < NI_660X_MAX_NUM_COUNTERS; ++i) { @@ -1118,12 +1118,12 @@ static int ni_660x_attach(struct comedi_device *dev, s->type = COMEDI_SUBD_UNUSED; } } - for (i = 0; i < board(dev)->n_chips; ++i) { + for (i = 0; i < board(dev)->n_chips; ++i) init_tio_chip(dev, i); - } - for (i = 0; i < ni_660x_num_counters(dev); ++i) { + + for (i = 0; i < ni_660x_num_counters(dev); ++i) ni_tio_init_counter(&private(dev)->counter_dev->counters[i]); - } + for (i = 0; i < NUM_PFI_CHANNELS; ++i) { if (i < min_counter_pfi_chan) ni_660x_set_pfi_routing(dev, i, pfi_output_select_do); @@ -1134,9 +1134,9 @@ static int ni_660x_attach(struct comedi_device *dev, } /* to be safe, set counterswap bits on tio chips after all the counter outputs have been set to high impedance mode */ - for (i = 0; i < board(dev)->n_chips; ++i) { + for (i = 0; i < board(dev)->n_chips; ++i) set_tio_counterswap(dev, i); - } + ret = request_irq(mite_irq(private(dev)->mite), ni_660x_interrupt, IRQF_SHARED, "ni_660x", dev); if (ret < 0) { @@ -1193,9 +1193,9 @@ static void init_tio_chip(struct comedi_device *dev, int chipset) private(dev)-> dma_configuration_soft_copies[chipset], DMAConfigRegister); - for (i = 0; i < NUM_PFI_CHANNELS; ++i) { + for (i = 0; i < NUM_PFI_CHANNELS; ++i) ni_660x_write_register(dev, chipset, 0, IOConfigReg(i)); - } + } static int -- cgit v0.10.2 From 49c9b5c7bd6cf87ccc1d820dec8d23ba3ae53f64 Mon Sep 17 00:00:00 2001 From: Chihau Chau Date: Thu, 11 Feb 2010 15:47:47 -0300 Subject: Staging: dream: camera: msm_camera: fix coding style issues This fixes some coding style issues like to use __func__ instead __FUNCTION__, "foo *bar" instead "foo* bar" and a initial comment with "/* */" instead "//" Signed-off-by: Chihau Chau Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/dream/camera/msm_camera.c b/drivers/staging/dream/camera/msm_camera.c index 7d93877..4f808dc 100644 --- a/drivers/staging/dream/camera/msm_camera.c +++ b/drivers/staging/dream/camera/msm_camera.c @@ -2,7 +2,7 @@ * Copyright (C) 2008-2009 QUALCOMM Incorporated. */ -//FIXME: most allocations need not be GFP_ATOMIC +/* FIXME: most allocations need not be GFP_ATOMIC */ /* FIXME: management of mutexes */ /* FIXME: msm_pmem_region_lookup return values */ /* FIXME: way too many copy to/from user */ @@ -361,7 +361,7 @@ static int __msm_get_frame(struct msm_sync *sync, if (!frame->buffer) { pr_err("%s: cannot get frame, invalid lookup address " "y=%x cbcr=%x offset=%d\n", - __FUNCTION__, + __func__, pphy->y_phy, pphy->cbcr_phy, frame->y_off); @@ -455,7 +455,7 @@ static int msm_disable_vfe(struct msm_sync *sync, void __user *arg) return rc; } -static struct msm_queue_cmd* __msm_control(struct msm_sync *sync, +static struct msm_queue_cmd *__msm_control(struct msm_sync *sync, struct msm_control_device_queue *queue, struct msm_queue_cmd *qcmd, int timeout) -- cgit v0.10.2 From 71508ee489e09dc206ea3f62542dd3bd11c0e201 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Mon, 15 Feb 2010 12:25:22 +0100 Subject: Staging: wlan-ng: fix most of the style issues in hfa384x.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fixes all the errors and the majority of the warnings found with checkpatch.pl script in hfa384x.h, following Gábor Stefanik hints Signed-off-by: Alessandro Ghedini Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h index 46cce81..5984d74 100644 --- a/drivers/staging/wlan-ng/hfa384x.h +++ b/drivers/staging/wlan-ng/hfa384x.h @@ -61,17 +61,17 @@ #include /*--- Mins & Maxs -----------------------------------*/ -#define HFA384x_PORTID_MAX ((u16)7) -#define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX+1)) -#define HFA384x_PDR_LEN_MAX ((u16)512) /* in bytes, from EK */ -#define HFA384x_PDA_RECS_MAX ((u16)200) /* a guess */ -#define HFA384x_PDA_LEN_MAX ((u16)1024) /* in bytes, from EK */ -#define HFA384x_SCANRESULT_MAX ((u16)31) -#define HFA384x_HSCANRESULT_MAX ((u16)31) -#define HFA384x_CHINFORESULT_MAX ((u16)16) -#define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */ -#define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN -#define HFA384x_USB_RWMEM_MAXLEN 2048 +#define HFA384x_PORTID_MAX ((u16)7) +#define HFA384x_NUMPORTS_MAX ((u16)(HFA384x_PORTID_MAX+1)) +#define HFA384x_PDR_LEN_MAX ((u16)512) /* in bytes, from EK */ +#define HFA384x_PDA_RECS_MAX ((u16)200) /* a guess */ +#define HFA384x_PDA_LEN_MAX ((u16)1024) /* in bytes, from EK*/ +#define HFA384x_SCANRESULT_MAX ((u16)31) +#define HFA384x_HSCANRESULT_MAX ((u16)31) +#define HFA384x_CHINFORESULT_MAX ((u16)16) +#define HFA384x_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */ +#define HFA384x_RIDDATA_MAXLEN HFA384x_RID_GUESSING_MAXLEN +#define HFA384x_USB_RWMEM_MAXLEN 2048 /*--- Support Constants -----------------------------*/ #define HFA384x_PORTTYPE_IBSS ((u16)0) @@ -114,9 +114,9 @@ #define HFA384x_ADDR_AUX_OFF_MASK (0x007f) /* Make a 32-bit flat address from AUX format 16-bit page and offset */ -#define HFA384x_ADDR_AUX_MKFLAT(p, o) \ - (((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \ - ((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK)) +#define HFA384x_ADDR_AUX_MKFLAT(p, o) \ + ((((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \ + ((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK))) /* Make CMD format offset and page from a 32-bit flat address */ #define HFA384x_ADDR_CMD_MKPAGE(f) \ @@ -135,12 +135,21 @@ #define HFA384x_DLSTATE_FLASHENABLED 2 /*--- Register Field Masks --------------------------*/ -#define HFA384x_CMD_AINFO ((u16)(BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8))) -#define HFA384x_CMD_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8))) +#define HFA384x_CMD_AINFO ((u16)(BIT(14) | BIT(13) \ + | BIT(12) | BIT(11) \ + | BIT(10) | BIT(9) \ + | BIT(8))) +#define HFA384x_CMD_MACPORT ((u16)(BIT(10) | BIT(9) | \ + BIT(8))) #define HFA384x_CMD_PROGMODE ((u16)(BIT(9) | BIT(8))) -#define HFA384x_CMD_CMDCODE ((u16)(BIT(5) | BIT(4) | BIT(3) | BIT(2) | BIT(1) | BIT(0))) +#define HFA384x_CMD_CMDCODE ((u16)(BIT(5) | BIT(4) | \ + BIT(3) | BIT(2) | \ + BIT(1) | BIT(0))) -#define HFA384x_STATUS_RESULT ((u16)(BIT(14) | BIT(13) | BIT(12) | BIT(11) | BIT(10) | BIT(9) | BIT(8))) +#define HFA384x_STATUS_RESULT ((u16)(BIT(14) | BIT(13) \ + | BIT(12) | BIT(11) \ + | BIT(10) | BIT(9) \ + | BIT(8))) /*--- Command Code Constants --------------------------*/ /*--- Controller Commands --------------------------*/ @@ -244,8 +253,10 @@ Information RID Lengths: MAC Information This is the length of JUST the DATA part of the RID (does not include the len or code fields) --------------------------------------------------------------------*/ -#define HFA384x_RID_DBMCOMMSQUALITY_LEN ((u16)sizeof(hfa384x_dbmcommsquality_t)) -#define HFA384x_RID_JOINREQUEST_LEN ((u16)sizeof(hfa384x_JoinRequest_data_t)) +#define HFA384x_RID_DBMCOMMSQUALITY_LEN \ + ((u16) sizeof(hfa384x_dbmcommsquality_t)) +#define HFA384x_RID_JOINREQUEST_LEN \ + ((u16)sizeof(hfa384x_JoinRequest_data_t)) /*-------------------------------------------------------------------- Information RIDs: Modem Information @@ -322,9 +333,11 @@ PD Record codes /*--- Register Test/Get/Set Field macros ------------------------*/ -#define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8)) -#define HFA384x_CMD_MACPORT_SET(value) ((u16)HFA384x_CMD_AINFO_SET(value)) -#define HFA384x_CMD_PROGMODE_SET(value) ((u16)HFA384x_CMD_AINFO_SET((u16)value)) +#define HFA384x_CMD_AINFO_SET(value) ((u16)((u16)(value) << 8)) +#define HFA384x_CMD_MACPORT_SET(value) \ + ((u16)HFA384x_CMD_AINFO_SET(value)) +#define HFA384x_CMD_PROGMODE_SET(value) \ + ((u16)HFA384x_CMD_AINFO_SET((u16)value)) #define HFA384x_CMD_CMDCODE_SET(value) ((u16)(value)) #define HFA384x_STATUS_RESULT_SET(value) (((u16)(value)) << 8) @@ -402,7 +415,7 @@ typedef struct hfa384x_authenticateStation_data { /*-- Configuration Record: WPAData (data portion only) --*/ typedef struct hfa384x_WPAData { u16 datalen; - u8 data[0]; // max 80 + u8 data[0]; /* max 80 */ } __attribute__ ((packed)) hfa384x_WPAData_t; /*-------------------------------------------------------------------- @@ -479,7 +492,8 @@ Communication Frames: Field Masks for Transmit Frames #define HFA384x_TXSTATUS_AGEDERR ((u16)BIT(1)) #define HFA384x_TXSTATUS_RETRYERR ((u16)BIT(0)) /*-- Transmit Control Field --*/ -#define HFA384x_TX_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8))) +#define HFA384x_TX_MACPORT ((u16)(BIT(10) | \ + BIT(9) | BIT(8))) #define HFA384x_TX_STRUCTYPE ((u16)(BIT(4) | BIT(3))) #define HFA384x_TX_TXEX ((u16)BIT(2)) #define HFA384x_TX_TXOK ((u16)BIT(1)) @@ -496,7 +510,8 @@ Communication Frames: Test/Get/Set Field Values for Transmit Frames #define HFA384x_TX_SET(v, m, s) ((((u16)(v))<<((u16)(s)))&((u16)(m))) #define HFA384x_TX_MACPORT_SET(v) HFA384x_TX_SET(v, HFA384x_TX_MACPORT, 8) -#define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, HFA384x_TX_STRUCTYPE, 3) +#define HFA384x_TX_STRUCTYPE_SET(v) HFA384x_TX_SET(v, \ + HFA384x_TX_STRUCTYPE, 3) #define HFA384x_TX_TXEX_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXEX, 2) #define HFA384x_TX_TXOK_SET(v) HFA384x_TX_SET(v, HFA384x_TX_TXOK, 1) /*-------------------------------------------------------------------- @@ -534,13 +549,17 @@ Communication Frames: Field Masks for Receive Frames --------------------------------------------------------------------*/ /*-- Status Fields --*/ -#define HFA384x_RXSTATUS_MACPORT ((u16)(BIT(10) | BIT(9) | BIT(8))) +#define HFA384x_RXSTATUS_MACPORT ((u16)(BIT(10) | \ + BIT(9) | \ + BIT(8))) #define HFA384x_RXSTATUS_FCSERR ((u16)BIT(0)) /*-------------------------------------------------------------------- Communication Frames: Test/Get/Set Field Values for Receive Frames --------------------------------------------------------------------*/ -#define HFA384x_RXSTATUS_MACPORT_GET(value) ((u16)((((u16)(value)) & HFA384x_RXSTATUS_MACPORT) >> 8)) -#define HFA384x_RXSTATUS_ISFCSERR(value) ((u16)(((u16)(value)) & HFA384x_RXSTATUS_FCSERR)) +#define HFA384x_RXSTATUS_MACPORT_GET(value) ((u16)((((u16)(value)) \ + & HFA384x_RXSTATUS_MACPORT) >> 8)) +#define HFA384x_RXSTATUS_ISFCSERR(value) ((u16)(((u16)(value)) \ + & HFA384x_RXSTATUS_FCSERR)) /*-------------------------------------------------------------------- FRAME STRUCTURES: Information Types and Information Frame Structures ---------------------------------------------------------------------- @@ -1133,7 +1152,7 @@ struct hfa384x; typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *); -typedef void (*ctlx_usercb_t) (struct hfa384x * hw, +typedef void (*ctlx_usercb_t) (struct hfa384x *hw, void *ctlxresult, void *usercb_data); typedef struct hfa384x_usbctlx { @@ -1174,14 +1193,14 @@ typedef struct hfa484x_metacmd { } hfa384x_metacmd_t; #define MAX_GRP_ADDR 32 -#define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */ +#define WLAN_COMMENT_MAX 80 /* Max. length of user comment string. */ -#define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */ -#define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */ -#define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */ -#define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */ -#define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */ -#define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */ +#define WLAN_AUTH_MAX 60 /* Max. # of authenticated stations. */ +#define WLAN_ACCESS_MAX 60 /* Max. # of stations in an access list. */ +#define WLAN_ACCESS_NONE 0 /* No stations may be authenticated. */ +#define WLAN_ACCESS_ALL 1 /* All stations may be authenticated. */ +#define WLAN_ACCESS_ALLOW 2 /* Authenticate only "allowed" stations. */ +#define WLAN_ACCESS_DENY 3 /* Do not authenticate "denied" stations. */ /* XXX These are going away ASAP */ typedef struct prism2sta_authlist { @@ -1294,10 +1313,23 @@ typedef struct hfa384x { hfa384x_caplevel_t cap_sup_ap; /* Actor compatibility ranges */ - hfa384x_caplevel_t cap_act_pri_cfi; /* pri f/w to controller interface */ - hfa384x_caplevel_t cap_act_sta_cfi; /* sta f/w to controller interface */ + hfa384x_caplevel_t cap_act_pri_cfi; /* + * pri f/w to controller + * interface + */ + + hfa384x_caplevel_t cap_act_sta_cfi; /* + * sta f/w to controller + * interface + */ + hfa384x_caplevel_t cap_act_sta_mfi; /* sta f/w to modem interface */ - hfa384x_caplevel_t cap_act_ap_cfi; /* ap f/w to controller interface */ + + hfa384x_caplevel_t cap_act_ap_cfi; /* + * ap f/w to controller + * interface + */ + hfa384x_caplevel_t cap_act_ap_mfi; /* ap f/w to modem interface */ u32 psusercount; /* Power save user count. */ @@ -1320,25 +1352,25 @@ typedef struct hfa384x { } hfa384x_t; -void hfa384x_create(hfa384x_t * hw, struct usb_device *usb); -void hfa384x_destroy(hfa384x_t * hw); +void hfa384x_create(hfa384x_t *hw, struct usb_device *usb); +void hfa384x_destroy(hfa384x_t *hw); int -hfa384x_corereset(hfa384x_t * hw, int holdtime, int settletime, int genesis); -int hfa384x_drvr_commtallies(hfa384x_t * hw); -int hfa384x_drvr_disable(hfa384x_t * hw, u16 macport); -int hfa384x_drvr_enable(hfa384x_t * hw, u16 macport); -int hfa384x_drvr_flashdl_enable(hfa384x_t * hw); -int hfa384x_drvr_flashdl_disable(hfa384x_t * hw); -int hfa384x_drvr_flashdl_write(hfa384x_t * hw, u32 daddr, void *buf, u32 len); -int hfa384x_drvr_getconfig(hfa384x_t * hw, u16 rid, void *buf, u16 len); -int hfa384x_drvr_ramdl_enable(hfa384x_t * hw, u32 exeaddr); -int hfa384x_drvr_ramdl_disable(hfa384x_t * hw); -int hfa384x_drvr_ramdl_write(hfa384x_t * hw, u32 daddr, void *buf, u32 len); -int hfa384x_drvr_readpda(hfa384x_t * hw, void *buf, unsigned int len); -int hfa384x_drvr_setconfig(hfa384x_t * hw, u16 rid, void *buf, u16 len); - -static inline int hfa384x_drvr_getconfig16(hfa384x_t * hw, u16 rid, void *val) +hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis); +int hfa384x_drvr_commtallies(hfa384x_t *hw); +int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport); +int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport); +int hfa384x_drvr_flashdl_enable(hfa384x_t *hw); +int hfa384x_drvr_flashdl_disable(hfa384x_t *hw); +int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len); +int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len); +int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr); +int hfa384x_drvr_ramdl_disable(hfa384x_t *hw); +int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len); +int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len); +int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len); + +static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val) { int result = 0; result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16)); @@ -1347,46 +1379,46 @@ static inline int hfa384x_drvr_getconfig16(hfa384x_t * hw, u16 rid, void *val) return result; } -static inline int hfa384x_drvr_setconfig16(hfa384x_t * hw, u16 rid, u16 val) +static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val) { u16 value = cpu_to_le16(val); return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value)); } int -hfa384x_drvr_getconfig_async(hfa384x_t * hw, +hfa384x_drvr_getconfig_async(hfa384x_t *hw, u16 rid, ctlx_usercb_t usercb, void *usercb_data); int -hfa384x_drvr_setconfig_async(hfa384x_t * hw, +hfa384x_drvr_setconfig_async(hfa384x_t *hw, u16 rid, void *buf, u16 len, ctlx_usercb_t usercb, void *usercb_data); static inline int -hfa384x_drvr_setconfig16_async(hfa384x_t * hw, u16 rid, u16 val) +hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val) { u16 value = cpu_to_le16(val); return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value), NULL, NULL); } -int hfa384x_drvr_start(hfa384x_t * hw); -int hfa384x_drvr_stop(hfa384x_t * hw); +int hfa384x_drvr_start(hfa384x_t *hw); +int hfa384x_drvr_stop(hfa384x_t *hw); int -hfa384x_drvr_txframe(hfa384x_t * hw, struct sk_buff *skb, - p80211_hdr_t * p80211_hdr, p80211_metawep_t * p80211_wep); -void hfa384x_tx_timeout(wlandevice_t * wlandev); - -int hfa384x_cmd_initialize(hfa384x_t * hw); -int hfa384x_cmd_enable(hfa384x_t * hw, u16 macport); -int hfa384x_cmd_disable(hfa384x_t * hw, u16 macport); -int hfa384x_cmd_allocate(hfa384x_t * hw, u16 len); -int hfa384x_cmd_monitor(hfa384x_t * hw, u16 enable); +hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb, + p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep); +void hfa384x_tx_timeout(wlandevice_t *wlandev); + +int hfa384x_cmd_initialize(hfa384x_t *hw); +int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport); +int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport); +int hfa384x_cmd_allocate(hfa384x_t *hw, u16 len); +int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable); int -hfa384x_cmd_download(hfa384x_t * hw, +hfa384x_cmd_download(hfa384x_t *hw, u16 mode, u16 lowaddr, u16 highaddr, u16 codelen); -#endif /* __KERNEL__ */ +#endif /*__KERNEL__ */ -#endif /* _HFA384x_H */ +#endif /*_HFA384x_H */ -- cgit v0.10.2 From d4023a5ee2f683f57636346c0baf94cda710055a Mon Sep 17 00:00:00 2001 From: Chihau Chau Date: Thu, 25 Feb 2010 18:13:00 -0300 Subject: Staging: dream: camera: msm_camera: fix some code style issues This fixes some code style issues like else staments after the close braces '}' and to use __func__ instead of __FUNCTION__. Signed-off-by: Chihau Chau Acked-by: Pavel Machek Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/dream/camera/msm_camera.c b/drivers/staging/dream/camera/msm_camera.c index 4f808dc..925e16c 100644 --- a/drivers/staging/dream/camera/msm_camera.c +++ b/drivers/staging/dream/camera/msm_camera.c @@ -670,7 +670,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg) &(stats.fd)); if (!stats.buffer) { pr_err("%s: msm_pmem_stats_ptov_lookup error\n", - __FUNCTION__); + __func__); rc = -EINVAL; goto failure; } @@ -718,8 +718,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg) buf.fmain.buffer = (unsigned long)region.vaddr; buf.fmain.fd = region.fd; - } - else { + } else { pr_err("%s: pmem lookup failed\n", __func__); rc = -EINVAL; @@ -838,8 +837,8 @@ static int msm_ctrl_cmd_done(struct msm_control_device *ctrl_pmsm, kfree(qcmd); goto end; } - } - else ctrlcmd->value = NULL; + } else + ctrlcmd->value = NULL; end: CDBG("msm_ctrl_cmd_done: end rc = %d\n", rc); @@ -876,7 +875,7 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg) MSM_PMEM_AEC_AWB, ®ion[0], NUM_WB_EXP_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { - pr_err("%s: pmem region lookup error\n", __FUNCTION__); + pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } axi_data.region = ®ion[0]; @@ -888,7 +887,7 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg) MSM_PMEM_AF, ®ion[0], NUM_AF_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { - pr_err("%s: pmem region lookup error\n", __FUNCTION__); + pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } axi_data.region = ®ion[0]; @@ -899,7 +898,7 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg) break; default: pr_err("%s: unknown command type %d\n", - __FUNCTION__, cfgcmd.cmd_type); + __func__, cfgcmd.cmd_type); return -EINVAL; } @@ -928,7 +927,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, msm_pmem_region_lookup(&sync->frame, pmem_type, ®ion[0], 8); if (!axi_data.bufnum1) { - pr_err("%s: pmem region lookup error\n", __FUNCTION__); + pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } break; @@ -939,7 +938,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, msm_pmem_region_lookup(&sync->frame, pmem_type, ®ion[0], 8); if (!axi_data.bufnum2) { - pr_err("%s: pmem region lookup error\n", __FUNCTION__); + pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } break; @@ -950,7 +949,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, msm_pmem_region_lookup(&sync->frame, pmem_type, ®ion[0], 8); if (!axi_data.bufnum1) { - pr_err("%s: pmem region lookup error\n", __FUNCTION__); + pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } @@ -959,7 +958,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, msm_pmem_region_lookup(&sync->frame, pmem_type, ®ion[axi_data.bufnum1], 8); if (!axi_data.bufnum2) { - pr_err("%s: pmem region lookup error\n", __FUNCTION__); + pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } break; @@ -970,7 +969,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, msm_pmem_region_lookup(&sync->frame, pmem_type, ®ion[0], 8); if (!axi_data.bufnum2) { - pr_err("%s: pmem region lookup error\n", __FUNCTION__); + pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } break; @@ -981,7 +980,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, default: pr_err("%s: unknown command type %d\n", - __FUNCTION__, cfgcmd->cmd_type); + __func__, cfgcmd->cmd_type); return -EINVAL; } @@ -1047,7 +1046,7 @@ static int __msm_put_frame_buf(struct msm_sync *sync, rc = sync->vfefn.vfe_config(&cfgcmd, &pphy); } else { pr_err("%s: msm_pmem_frame_vtop_lookup failed\n", - __FUNCTION__); + __func__); rc = -EINVAL; } @@ -1131,7 +1130,7 @@ static int msm_stats_axi_cfg(struct msm_sync *sync, break; default: pr_err("%s: unknown command type %d\n", - __FUNCTION__, cfgcmd->cmd_type); + __func__, cfgcmd->cmd_type); return -EINVAL; } @@ -1140,7 +1139,7 @@ static int msm_stats_axi_cfg(struct msm_sync *sync, msm_pmem_region_lookup(&sync->stats, pmem_type, ®ion[0], NUM_WB_EXP_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { - pr_err("%s: pmem region lookup error\n", __FUNCTION__); + pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } axi_data.region = ®ion[0]; @@ -1177,7 +1176,7 @@ static int msm_put_stats_buffer(struct msm_sync *sync, void __user *arg) cfgcmd.cmd_type = CMD_STATS_AF_BUF_RELEASE; else { pr_err("%s: invalid buf type %d\n", - __FUNCTION__, + __func__, buf.type); rc = -EINVAL; goto put_done; @@ -1223,7 +1222,7 @@ static int msm_axi_config(struct msm_sync *sync, void __user *arg) default: pr_err("%s: unknown command type %d\n", - __FUNCTION__, + __func__, cfgcmd.cmd_type); return -EINVAL; } -- cgit v0.10.2 From a917d4c4251314afc196fd7a7d9d10faff2effda Mon Sep 17 00:00:00 2001 From: Chihau Chau Date: Thu, 25 Feb 2010 17:40:28 -0300 Subject: Staging: comedi: poc: Adding some KERN_ facility level This fixes some coding style issues like include KERN_ facility levels in some printk() and one trailing whitespace error. Signed-off-by: Chihau Chau Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/poc.c b/drivers/staging/comedi/drivers/poc.c index 28eba6d..e15fbd7 100644 --- a/drivers/staging/comedi/drivers/poc.c +++ b/drivers/staging/comedi/drivers/poc.c @@ -122,22 +122,21 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it) unsigned int iosize; iobase = it->options[0]; - printk("comedi%d: poc: using %s iobase 0x%lx\n", dev->minor, + printk(KERN_INFO "comedi%d: poc: using %s iobase 0x%lx\n", dev->minor, this_board->name, iobase); dev->board_name = this_board->name; if (iobase == 0) { - printk("io base address required\n"); + printk(KERN_ERR "io base address required\n"); return -EINVAL; } iosize = this_board->iosize; /* check if io addresses are available */ if (!request_region(iobase, iosize, "dac02")) { - printk - ("I/O port conflict: failed to allocate ports 0x%lx to " - "0x%lx\n", iobase, iobase + iosize - 1); + printk(KERN_ERR "I/O port conflict: failed to allocate ports " + "0x%lx to 0x%lx\n", iobase, iobase + iosize - 1); return -EIO; } dev->iobase = iobase; -- cgit v0.10.2 From 8377e813c75cf5aca46032fb780ca74c923dbe86 Mon Sep 17 00:00:00 2001 From: Maurice Dawson Date: Fri, 19 Feb 2010 10:53:13 +0000 Subject: Staging: comedi: fix brace coding style issue in ni_labpc.c This is a patch to the ni_labpc.c file that fixes up a brace warning found by the checkpatch.pl tool. Signed-off-by: Maurice Dawson Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index dc3f398..a01e35d 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -483,12 +483,10 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, printk("comedi%d: ni_labpc: %s, io 0x%lx", dev->minor, thisboard->name, iobase); - if (irq) { + if (irq) printk(", irq %u", irq); - } - if (dma_chan) { + if (dma_chan) printk(", dma %u", dma_chan); - } printk("\n"); if (iobase == 0) { -- cgit v0.10.2 From 2bb9c335902a5d59fc084170aaae0ccc9d9d4012 Mon Sep 17 00:00:00 2001 From: Maurice Dawson Date: Fri, 19 Feb 2010 10:53:14 +0000 Subject: Staging: comedi: fix another brace coding style issues in ni_labpc.c This is a patch to the ni_labpc.c file that fixes up a brace warning found by the checkpatch.pl tool Signed-off-by: Maurice Dawson Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index a01e35d..5dc8606 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -638,9 +638,8 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, s->insn_read = labpc_eeprom_read_insn; s->insn_write = labpc_eeprom_write_insn; - for (i = 0; i < EEPROM_SIZE; i++) { + for (i = 0; i < EEPROM_SIZE; i++) devpriv->eeprom_data[i] = labpc_eeprom_read(dev, i); - } #ifdef LABPC_DEBUG printk(" eeprom:"); for (i = 0; i < EEPROM_SIZE; i++) { -- cgit v0.10.2 From 65d6d26c6bcd802ebe2b22a29d9b6bbebfd8d7f8 Mon Sep 17 00:00:00 2001 From: Maurice Dawson Date: Fri, 19 Feb 2010 10:53:15 +0000 Subject: Staging: comedi: fix yet another brace coding style issue in ni_labpc.c This is a patch to the ni_labpc.c file that fixes up all the brace warnings found by the checkpatch.pl tool Signed-off-by: Maurice Dawson Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 5dc8606..d6b5c05 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -642,9 +642,8 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, devpriv->eeprom_data[i] = labpc_eeprom_read(dev, i); #ifdef LABPC_DEBUG printk(" eeprom:"); - for (i = 0; i < EEPROM_SIZE; i++) { + for (i = 0; i < EEPROM_SIZE; i++) printk(" %i:0x%x ", i, devpriv->eeprom_data[i]); - } printk("\n"); #endif } else @@ -676,9 +675,8 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it) case pci_bustype: #ifdef CONFIG_COMEDI_PCI retval = labpc_find_device(dev, it->options[0], it->options[1]); - if (retval < 0) { + if (retval < 0) return retval; - } retval = mite_setup(devpriv->mite); if (retval < 0) return retval; @@ -1005,9 +1003,9 @@ static int labpc_ai_cmdtest(struct comedi_device *dev, err++; } - if (!cmd->chanlist_len) { + if (!cmd->chanlist_len) err++; - } + if (cmd->scan_end_arg != cmd->chanlist_len) { cmd->scan_end_arg = cmd->chanlist_len; err++; @@ -1102,9 +1100,9 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) devpriv->write_byte(devpriv->command3_bits, dev->iobase + COMMAND3_REG); /* initialize software conversion count */ - if (cmd->stop_src == TRIG_COUNT) { + if (cmd->stop_src == TRIG_COUNT) devpriv->count = cmd->stop_arg * cmd->chanlist_len; - } + /* setup hardware conversion counter */ if (cmd->stop_src == TRIG_EXT) { /* load counter a1 with count of 3 (pc+ manual says this is minimum allowed) using mode 0 */ @@ -1476,9 +1474,9 @@ static void labpc_drain_dma(struct comedi_device *dev) } /* write data to comedi buffer */ - for (i = 0; i < num_points; i++) { + for (i = 0; i < num_points; i++) cfc_write_to_buffer(s, devpriv->dma_buffer[i]); - } + if (async->cmd.stop_src == TRIG_COUNT) devpriv->count -= num_points; @@ -1861,9 +1859,9 @@ static unsigned int labpc_serial_in(struct comedi_device *dev) udelay(1); devpriv->status2_bits = devpriv->read_byte(dev->iobase + STATUS2_REG); - if (devpriv->status2_bits & EEPROM_OUT_BIT) { + if (devpriv->status2_bits & EEPROM_OUT_BIT) value |= 1 << (value_width - i); - } + } return value; -- cgit v0.10.2 From 639b9f1ee5987270be2bca4bf8b7e6110d3b47ec Mon Sep 17 00:00:00 2001 From: Stewart Robertson Date: Sun, 21 Feb 2010 11:21:37 +0000 Subject: Staging: comedi: fix suspect code indent in ni_labpc.c This is a patch to the ni_labpc.c file that fixes suspect code indent for conditional statements found by the checkpatch.pl tool Signed-off-by: Stewart Robertson Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index d6b5c05..ddc3b07 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -583,8 +583,11 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, /* analog output */ s = dev->subdevices + 1; if (thisboard->has_ao) { -/* Could provide command support, except it only has a one sample - * hardware buffer for analog output and no underrun flag. */ + /* + * Could provide command support, except it only has a + * one sample hardware buffer for analog output and no + * underrun flag. + */ s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_GROUND; s->n_chan = NUM_AO_CHAN; @@ -1356,7 +1359,10 @@ static irqreturn_t labpc_interrupt(int irq, void *d) } if (devpriv->current_transfer == isa_dma_transfer) { - /* if a dma terminal count of external stop trigger has occurred */ + /* + * if a dma terminal count of external stop trigger + * has occurred + */ if (devpriv->status1_bits & DMATC_BIT || (thisboard->register_layout == labpc_1200_layout && devpriv->status2_bits & A1_TC_BIT)) { -- cgit v0.10.2 From 6705b68d0be284e2f9949f3657ea65d426d0f988 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Fri, 26 Feb 2010 10:14:55 +0100 Subject: Staging: comedi: comedi_fops.c: Checkpatch cleanup ERROR: do not initialise externals to 0 or NULL +int comedi_num_legacy_minors = 0; WARNING: braces {} are not necessary for single statement blocks + if (s->subdev_flags & SDF_CMD_READ) { + kill_fasync(&dev->async_queue, SIGIO, POLL_IN); + } WARNING: braces {} are not necessary for single statement blocks + if (s->subdev_flags & SDF_CMD_WRITE) { + kill_fasync(&dev->async_queue, SIGIO, POLL_OUT); + } Signed-off-by: Andrea Gelmini Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 8117748..aca9674 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -63,7 +63,7 @@ module_param(comedi_debug, int, 0644); int comedi_autoconfig = 1; module_param(comedi_autoconfig, bool, 0444); -int comedi_num_legacy_minors = 0; +int comedi_num_legacy_minors; module_param(comedi_num_legacy_minors, int, 0444); static DEFINE_SPINLOCK(comedi_file_info_table_lock); @@ -1510,7 +1510,7 @@ static unsigned int comedi_poll(struct file *file, poll_table * wait) } static ssize_t comedi_write(struct file *file, const char *buf, size_t nbytes, - loff_t * offset) + loff_t *offset) { struct comedi_subdevice *s; struct comedi_async *async; @@ -1612,7 +1612,7 @@ done: } static ssize_t comedi_read(struct file *file, char *buf, size_t nbytes, - loff_t * offset) + loff_t *offset) { struct comedi_subdevice *s; struct comedi_async *async; @@ -2004,12 +2004,10 @@ void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s) if (async->cb_mask & s->async->events) { if (comedi_get_subdevice_runflags(s) & SRF_USER) { wake_up_interruptible(&async->wait_head); - if (s->subdev_flags & SDF_CMD_READ) { + if (s->subdev_flags & SDF_CMD_READ) kill_fasync(&dev->async_queue, SIGIO, POLL_IN); - } - if (s->subdev_flags & SDF_CMD_WRITE) { + if (s->subdev_flags & SDF_CMD_WRITE) kill_fasync(&dev->async_queue, SIGIO, POLL_OUT); - } } else { if (async->cb_func) async->cb_func(s->async->events, async->cb_arg); -- cgit v0.10.2 From ef1a0ed7f1793531e5fb3ee489cb1e2b627f76fd Mon Sep 17 00:00:00 2001 From: Andrew Elwell Date: Thu, 18 Feb 2010 23:56:12 +0100 Subject: Staging: wlan-ng - checkpatch.pl fixups Basic fixups in the staging/wlan-ng directory. (First kernel patch - thanks to FOSDEM talk) Signed-off-by: Andrew Elwell Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 925678b..730d085 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -118,15 +118,15 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include -#define SUBMIT_URB(u,f) usb_submit_urb(u,f) +#define SUBMIT_URB(u, f) usb_submit_urb(u, f) #include "p80211types.h" #include "p80211hdr.h" @@ -627,7 +627,7 @@ static hfa384x_usbctlx_t *usbctlx_alloc(void) { hfa384x_usbctlx_t *ctlx; - ctlx = kmalloc(sizeof(*ctlx), in_interrupt()? GFP_ATOMIC : GFP_KERNEL); + ctlx = kmalloc(sizeof(*ctlx), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); if (ctlx != NULL) { memset(ctlx, 0, sizeof(*ctlx)); init_completion(&ctlx->done); @@ -675,7 +675,7 @@ struct usbctlx_cmd_completor { }; typedef struct usbctlx_cmd_completor usbctlx_cmd_completor_t; -static int usbctlx_cmd_completor_fn(usbctlx_completor_t * head) +static int usbctlx_cmd_completor_fn(usbctlx_completor_t *head) { usbctlx_cmd_completor_t *complete = (usbctlx_cmd_completor_t *) head; return usbctlx_get_status(complete->cmdresp, complete->result); @@ -3642,7 +3642,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev, /* check for unencrypted stuff if WEP bit set. */ if (*(datap - hdrlen + 1) & 0x40) /* wep set */ if ((*(datap) == 0xaa) && (*(datap + 1) == 0xaa)) - *(datap - hdrlen + 1) &= 0xbf; // clear wep; it's the 802.2 header! + *(datap - hdrlen + 1) &= 0xbf; /* clear wep; it's the 802.2 header! */ } if (hw->sniff_fcs) { diff --git a/drivers/staging/wlan-ng/p80211conv.h b/drivers/staging/wlan-ng/p80211conv.h index 0c62df1..6fe163b 100644 --- a/drivers/staging/wlan-ng/p80211conv.h +++ b/drivers/staging/wlan-ng/p80211conv.h @@ -153,8 +153,8 @@ struct wlandevice; int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv, struct sk_buff *skb); int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv, - struct sk_buff *skb, p80211_hdr_t * p80211_hdr, - p80211_metawep_t * p80211_wep); + struct sk_buff *skb, p80211_hdr_t *p80211_hdr, + p80211_metawep_t *p80211_wep); int p80211_stt_findproto(u16 proto); diff --git a/drivers/staging/wlan-ng/p80211metadef.h b/drivers/staging/wlan-ng/p80211metadef.h index da8b6f5..0ccfba1 100644 --- a/drivers/staging/wlan-ng/p80211metadef.h +++ b/drivers/staging/wlan-ng/p80211metadef.h @@ -190,9 +190,9 @@ (P80211DID_MKSECTION(2) | \ P80211DID_MKGROUP(1)) #define DIDmib_dot11mac_dot11OperationTable_dot11MACAddress \ - (P80211DID_MKSECTION(2) | \ - P80211DID_MKGROUP(1) | \ - P80211DID_MKITEM(1) | 0x18000000) + (P80211DID_MKSECTION(2) | \ + P80211DID_MKGROUP(1) | \ + P80211DID_MKITEM(1) | 0x18000000) #define DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold \ (P80211DID_MKSECTION(2) | \ P80211DID_MKGROUP(1) | \ @@ -210,18 +210,18 @@ P80211DID_MKGROUP(1) | \ P80211DID_MKITEM(5) | 0x18000000) #define DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime \ - (P80211DID_MKSECTION(2) | \ - P80211DID_MKGROUP(1) | \ - P80211DID_MKITEM(6) | 0x10000000) + (P80211DID_MKSECTION(2) | \ + P80211DID_MKGROUP(1) | \ + P80211DID_MKITEM(6) | 0x10000000) #define DIDmib_cat_dot11phy \ P80211DID_MKSECTION(3) #define DIDmib_dot11phy_dot11PhyOperationTable \ (P80211DID_MKSECTION(3) | \ P80211DID_MKGROUP(1)) #define DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel \ - (P80211DID_MKSECTION(3) | \ - P80211DID_MKGROUP(3) | \ - P80211DID_MKITEM(10) | 0x18000000) + (P80211DID_MKSECTION(3) | \ + P80211DID_MKGROUP(3) | \ + P80211DID_MKITEM(10) | 0x18000000) #define DIDmib_dot11phy_dot11PhyDSSSTable \ (P80211DID_MKSECTION(3) | \ P80211DID_MKGROUP(5)) diff --git a/drivers/staging/wlan-ng/p80211mgmt.h b/drivers/staging/wlan-ng/p80211mgmt.h index 14cdc86..deb52f5 100644 --- a/drivers/staging/wlan-ng/p80211mgmt.h +++ b/drivers/staging/wlan-ng/p80211mgmt.h @@ -100,7 +100,7 @@ #ifndef _P80211MGMT_H #define _P80211MGMT_H -#ifndef _P80211HDR_H +#ifndef _P80211HDR_H #include "p80211hdr.h" #endif @@ -496,25 +496,25 @@ typedef struct wlan_fr_deauthen { } wlan_fr_deauthen_t; -void wlan_mgmt_encode_beacon(wlan_fr_beacon_t * f); -void wlan_mgmt_decode_beacon(wlan_fr_beacon_t * f); -void wlan_mgmt_encode_disassoc(wlan_fr_disassoc_t * f); -void wlan_mgmt_decode_disassoc(wlan_fr_disassoc_t * f); -void wlan_mgmt_encode_assocreq(wlan_fr_assocreq_t * f); -void wlan_mgmt_decode_assocreq(wlan_fr_assocreq_t * f); -void wlan_mgmt_encode_assocresp(wlan_fr_assocresp_t * f); -void wlan_mgmt_decode_assocresp(wlan_fr_assocresp_t * f); -void wlan_mgmt_encode_reassocreq(wlan_fr_reassocreq_t * f); -void wlan_mgmt_decode_reassocreq(wlan_fr_reassocreq_t * f); -void wlan_mgmt_encode_reassocresp(wlan_fr_reassocresp_t * f); -void wlan_mgmt_decode_reassocresp(wlan_fr_reassocresp_t * f); -void wlan_mgmt_encode_probereq(wlan_fr_probereq_t * f); -void wlan_mgmt_decode_probereq(wlan_fr_probereq_t * f); -void wlan_mgmt_encode_proberesp(wlan_fr_proberesp_t * f); -void wlan_mgmt_decode_proberesp(wlan_fr_proberesp_t * f); -void wlan_mgmt_encode_authen(wlan_fr_authen_t * f); -void wlan_mgmt_decode_authen(wlan_fr_authen_t * f); -void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t * f); -void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t * f); +void wlan_mgmt_encode_beacon(wlan_fr_beacon_t *f); +void wlan_mgmt_decode_beacon(wlan_fr_beacon_t *f); +void wlan_mgmt_encode_disassoc(wlan_fr_disassoc_t *f); +void wlan_mgmt_decode_disassoc(wlan_fr_disassoc_t *f); +void wlan_mgmt_encode_assocreq(wlan_fr_assocreq_t *f); +void wlan_mgmt_decode_assocreq(wlan_fr_assocreq_t *f); +void wlan_mgmt_encode_assocresp(wlan_fr_assocresp_t *f); +void wlan_mgmt_decode_assocresp(wlan_fr_assocresp_t *f); +void wlan_mgmt_encode_reassocreq(wlan_fr_reassocreq_t *f); +void wlan_mgmt_decode_reassocreq(wlan_fr_reassocreq_t *f); +void wlan_mgmt_encode_reassocresp(wlan_fr_reassocresp_t *f); +void wlan_mgmt_decode_reassocresp(wlan_fr_reassocresp_t *f); +void wlan_mgmt_encode_probereq(wlan_fr_probereq_t *f); +void wlan_mgmt_decode_probereq(wlan_fr_probereq_t *f); +void wlan_mgmt_encode_proberesp(wlan_fr_proberesp_t *f); +void wlan_mgmt_decode_proberesp(wlan_fr_proberesp_t *f); +void wlan_mgmt_encode_authen(wlan_fr_authen_t *f); +void wlan_mgmt_decode_authen(wlan_fr_authen_t *f); +void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t *f); +void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t *f); #endif /* _P80211MGMT_H */ diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 22424c8..e27d72c 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -646,7 +646,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr) /* Set up some convenience pointers. */ mibattr = &dot11req.mibattribute; - macaddr = (p80211item_pstr6_t *) & mibattr->data; + macaddr = (p80211item_pstr6_t *) &mibattr->data; resultcode = &dot11req.resultcode; /* Set up a dot11req_mibset */ @@ -674,7 +674,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr) resultcode->data = 0; /* now fire the request */ - result = p80211req_dorequest(dev->ml_priv, (u8 *) & dot11req); + result = p80211req_dorequest(dev->ml_priv, (u8 *) &dot11req); /* If the request wasn't successful, report an error and don't * change the netdev address diff --git a/drivers/staging/wlan-ng/p80211netdev.h b/drivers/staging/wlan-ng/p80211netdev.h index 8bd9dfb..3c8c648 100644 --- a/drivers/staging/wlan-ng/p80211netdev.h +++ b/drivers/staging/wlan-ng/p80211netdev.h @@ -179,16 +179,16 @@ typedef struct wlandevice { unsigned int ethconv; /* device methods (init by MSD, used by p80211 */ - int (*open) (struct wlandevice * wlandev); - int (*close) (struct wlandevice * wlandev); - void (*reset) (struct wlandevice * wlandev); - int (*txframe) (struct wlandevice * wlandev, struct sk_buff * skb, - p80211_hdr_t * p80211_hdr, - p80211_metawep_t * p80211_wep); - int (*mlmerequest) (struct wlandevice * wlandev, p80211msg_t * msg); - int (*set_multicast_list) (struct wlandevice * wlandev, - netdevice_t * dev); - void (*tx_timeout) (struct wlandevice * wlandev); + int (*open) (struct wlandevice *wlandev); + int (*close) (struct wlandevice *wlandev); + void (*reset) (struct wlandevice *wlandev); + int (*txframe) (struct wlandevice *wlandev, struct sk_buff *skb, + p80211_hdr_t *p80211_hdr, + p80211_metawep_t *p80211_wep); + int (*mlmerequest) (struct wlandevice *wlandev, p80211msg_t *msg); + int (*set_multicast_list) (struct wlandevice *wlandev, + netdevice_t *dev); + void (*tx_timeout) (struct wlandevice *wlandev); /* 802.11 State */ u8 bssid[WLAN_BSSID_LEN]; @@ -227,16 +227,16 @@ typedef struct wlandevice { } wlandevice_t; /* WEP stuff */ -int wep_change_key(wlandevice_t * wlandev, int keynum, u8 * key, int keylen); -int wep_decrypt(wlandevice_t * wlandev, u8 * buf, u32 len, int key_override, - u8 * iv, u8 * icv); -int wep_encrypt(wlandevice_t * wlandev, u8 * buf, u8 * dst, u32 len, int keynum, - u8 * iv, u8 * icv); - -int wlan_setup(wlandevice_t * wlandev); -int wlan_unsetup(wlandevice_t * wlandev); -int register_wlandev(wlandevice_t * wlandev); -int unregister_wlandev(wlandevice_t * wlandev); -void p80211netdev_rx(wlandevice_t * wlandev, struct sk_buff *skb); -void p80211netdev_hwremoved(wlandevice_t * wlandev); +int wep_change_key(wlandevice_t *wlandev, int keynum, u8 *key, int keylen); +int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, + u8 *iv, u8 *icv); +int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, + u8 *iv, u8 *icv); + +int wlan_setup(wlandevice_t *wlandev); +int wlan_unsetup(wlandevice_t *wlandev); +int register_wlandev(wlandevice_t *wlandev); +int unregister_wlandev(wlandevice_t *wlandev); +void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb); +void p80211netdev_hwremoved(wlandevice_t *wlandev); #endif diff --git a/drivers/staging/wlan-ng/p80211req.c b/drivers/staging/wlan-ng/p80211req.c index c88156c..c2e95f1 100644 --- a/drivers/staging/wlan-ng/p80211req.c +++ b/drivers/staging/wlan-ng/p80211req.c @@ -94,7 +94,7 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev, * Potentially blocks the caller, so it's a good idea to * not call this function from an interrupt context. ----------------------------------------------------------------*/ -int p80211req_dorequest(wlandevice_t * wlandev, u8 * msgbuf) +int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf) { int result = 0; p80211msg_t *msg = (p80211msg_t *) msgbuf; diff --git a/drivers/staging/wlan-ng/p80211req.h b/drivers/staging/wlan-ng/p80211req.h index 5d91767..a95a45a 100644 --- a/drivers/staging/wlan-ng/p80211req.h +++ b/drivers/staging/wlan-ng/p80211req.h @@ -48,6 +48,6 @@ #ifndef _LINUX_P80211REQ_H #define _LINUX_P80211REQ_H -int p80211req_dorequest(wlandevice_t * wlandev, u8 * msgbuf); +int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf); #endif diff --git a/drivers/staging/wlan-ng/p80211types.h b/drivers/staging/wlan-ng/p80211types.h index 2b83ab0..db23551 100644 --- a/drivers/staging/wlan-ng/p80211types.h +++ b/drivers/staging/wlan-ng/p80211types.h @@ -168,10 +168,10 @@ P80211DID_MASK_ISTABLE, \ P80211DID_LSB_ISTABLE) -#define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \ +#define P80211DID_MKID(s, g, i, n, t, a) (P80211DID_MKSECTION(s) | \ P80211DID_MKGROUP(g) | \ - P80211DID_MKITEM(i) | \ - P80211DID_MKINDEX(n) | \ + P80211DID_MKITEM(i) | \ + P80211DID_MKINDEX(n) | \ P80211DID_MKISTABLE(t) | \ (a)) @@ -340,11 +340,11 @@ struct catlistitem; /* metadata items. Some components may choose to use more, */ /* less or different metadata items. */ -typedef void (*p80211_totext_t) (struct catlistitem *, u32 did, u8 * itembuf, +typedef void (*p80211_totext_t) (struct catlistitem *, u32 did, u8 *itembuf, char *textbuf); -typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 * itembuf, +typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 *itembuf, char *textbuf); -typedef u32(*p80211_valid_t) (struct catlistitem *, u32 did, u8 * itembuf); +typedef u32(*p80211_valid_t) (struct catlistitem *, u32 did, u8 *itembuf); /*----------------------------------------------------------------*/ /* Enumeration Lists */ diff --git a/drivers/staging/wlan-ng/p80211wext.c b/drivers/staging/wlan-ng/p80211wext.c index 74d8022..040c9e3 100644 --- a/drivers/staging/wlan-ng/p80211wext.c +++ b/drivers/staging/wlan-ng/p80211wext.c @@ -46,8 +46,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -137,7 +137,7 @@ static int p80211wext_dorequest(wlandevice_t *wlandev, u32 did, u32 data) mibitem.did = did; mibitem.data = data; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); return result; } @@ -174,7 +174,7 @@ static int p80211wext_autojoin(wlandevice_t *wlandev) memcpy(msg.ssid.data.data, ssid, data.length); msg.ssid.data.len = data.length; - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -211,7 +211,7 @@ struct iw_statistics *p80211wext_get_wireless_stats(netdevice_t *dev) if (wlandev->mlmerequest == NULL) return NULL; - retval = wlandev->mlmerequest(wlandev, (p80211msg_t *) & quality); + retval = wlandev->mlmerequest(wlandev, (p80211msg_t *) &quality); wstats->qual.qual = qual_as_percent(quality.link.data); /* overall link quality */ wstats->qual.level = quality.level.data; /* instant signal level */ @@ -271,7 +271,7 @@ static int p80211wext_giwfreq(netdevice_t *dev, msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_dot11phy_dot11PhyDSSSTable_dot11CurrentChannel; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -318,7 +318,7 @@ static int p80211wext_siwfreq(netdevice_t *dev, mibitem.data = p80211_mhz_to_channel(freq->m); memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -399,7 +399,7 @@ static int p80211wext_siwmode(netdevice_t *dev, mibitem.did = DIDmib_p2_p2Static_p2CnfPortType; mibitem.data = (*mode == IW_MODE_ADHOC) ? 0 : 1; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) err = -EFAULT; @@ -621,7 +621,7 @@ static int p80211wext_siwencode(netdevice_t *dev, msg.msgcode = DIDmsg_dot11req_mibset; memcpy(&msg.mibattribute.data, &pstr, sizeof(pstr)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -729,7 +729,7 @@ static int p80211wext_siwessid(netdevice_t *dev, msg.ssid.data.len = length; pr_debug("autojoin_ssid for %s \n", essid); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); pr_debug("autojoin_ssid %d\n", result); if (result) { @@ -773,7 +773,7 @@ static int p80211wext_giwrate(netdevice_t *dev, msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_p2_p2MAC_p2CurrentTxRate; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -824,7 +824,7 @@ static int p80211wext_giwrts(netdevice_t *dev, msg.msgcode = DIDmsg_dot11req_mibget; mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -864,7 +864,7 @@ static int p80211wext_siwrts(netdevice_t *dev, mibitem.data = rts->value; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -889,7 +889,7 @@ static int p80211wext_giwfrag(netdevice_t *dev, mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11FragmentationThreshold; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -931,7 +931,7 @@ static int p80211wext_siwfrag(netdevice_t *dev, mibitem.data = frag->value; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -965,7 +965,7 @@ static int p80211wext_giwretry(netdevice_t *dev, mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11ShortRetryLimit; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -979,7 +979,7 @@ static int p80211wext_giwretry(netdevice_t *dev, mibitem.did = DIDmib_dot11mac_dot11OperationTable_dot11LongRetryLimit; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -994,7 +994,7 @@ static int p80211wext_giwretry(netdevice_t *dev, DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -1055,7 +1055,7 @@ static int p80211wext_siwretry(netdevice_t *dev, mibitem.data = rrq->value /= 1024; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -1069,7 +1069,7 @@ static int p80211wext_siwretry(netdevice_t *dev, memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -1084,7 +1084,7 @@ static int p80211wext_siwretry(netdevice_t *dev, memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -1121,7 +1121,7 @@ static int p80211wext_siwtxpow(netdevice_t *dev, else mibitem.data = rrq->value; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -1147,7 +1147,7 @@ static int p80211wext_giwtxpow(netdevice_t *dev, DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel; memcpy(&msg.mibattribute.data, &mibitem, sizeof(mibitem)); - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) { err = -EFAULT; @@ -1295,7 +1295,7 @@ static int p80211wext_siwscan(netdevice_t *dev, msg.maxchanneltime.data = 250; msg.minchanneltime.data = 200; - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if (result) err = prism2_result2err(msg.resultcode.data); @@ -1414,7 +1414,7 @@ static int p80211wext_giwscan(netdevice_t *dev, msg.msgcode = DIDmsg_dot11req_scan_results; msg.bssindex.data = i; - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); if ((result != 0) || (msg.resultcode.data != P80211ENUM_resultcode_success)) { break; @@ -1489,7 +1489,7 @@ static int p80211wext_set_encodeext(struct net_device *dev, memcpy(wlandev->wep_keys[idx], ext->key, ext->key_len); memset(&msg, 0, sizeof(msg)); - pstr = (p80211item_pstr32_t *) & msg.mibattribute.data; + pstr = (p80211item_pstr32_t *) &msg.mibattribute.data; memcpy(pstr->data.data, ext->key, ext->key_len); pstr->data.len = ext->key_len; switch (idx) { @@ -1513,7 +1513,7 @@ static int p80211wext_set_encodeext(struct net_device *dev, break; } msg.msgcode = DIDmsg_dot11req_mibset; - result = p80211req_dorequest(wlandev, (u8 *) & msg); + result = p80211req_dorequest(wlandev, (u8 *) &msg); pr_debug("result (%d)\n", result); } return result; @@ -1737,7 +1737,7 @@ struct iw_handler_def p80211wext_handler_def = { .get_wireless_stats = p80211wext_get_wireless_stats }; -int p80211wext_event_associated(wlandevice_t * wlandev, int assoc) +int p80211wext_event_associated(wlandevice_t *wlandev, int assoc) { union iwreq_data data; diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c index aaa70ed..3436145 100644 --- a/drivers/staging/wlan-ng/prism2fw.c +++ b/drivers/staging/wlan-ng/prism2fw.c @@ -108,9 +108,9 @@ typedef struct pda { } pda_t; typedef struct imgchunk { - u32 addr; /* start address */ - u32 len; /* in bytes */ - u16 crc; /* CRC value (if it falls at a chunk boundary) */ + u32 addr; /* start address */ + u32 len; /* in bytes */ + u16 crc; /* CRC value (if it falls at a chunk boundary) */ u8 *data; } imgchunk_t; @@ -264,7 +264,7 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev) /* Build the PDA we're going to use. */ if (read_cardpda(&pda, wlandev)) { printk(KERN_ERR "load_cardpda failed, exiting.\n"); - return (1); + return 1; } /* read the card's PRI-SUP */ @@ -286,9 +286,8 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev) /* DIDmsg_dot11req_mibget */ prism2mgmt_mibset_mibget(wlandev, &getmsg); - if (getmsg.resultcode.data != P80211ENUM_resultcode_success) { + if (getmsg.resultcode.data != P80211ENUM_resultcode_success) printk(KERN_ERR "Couldn't fetch PRI-SUP info\n"); - } /* Already in host order */ priid.role = *data++; @@ -301,19 +300,19 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev) result = read_fwfile(rfptr); if (result) { printk(KERN_ERR "Failed to read the data exiting.\n"); - return (1); + return 1; } result = validate_identity(); if (result) { printk(KERN_ERR "Incompatible firmware image.\n"); - return (1); + return 1; } if (startaddr == 0x00000000) { printk(KERN_ERR "Can't RAM download a Flash image!\n"); - return (1); + return 1; } /* Make the image chunks */ @@ -323,20 +322,20 @@ int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev) result = plugimage(fchunk, nfchunks, s3plug, ns3plug, &pda); if (result) { printk(KERN_ERR "Failed to plug data.\n"); - return (1); + return 1; } /* Insert any CRCs */ if (crcimage(fchunk, nfchunks, s3crc, ns3crc)) { printk(KERN_ERR "Failed to insert all CRCs\n"); - return (1); + return 1; } /* Write the image */ result = writeimage(wlandev, fchunk, nfchunks); if (result) { printk(KERN_ERR "Failed to ramwrite image data.\n"); - return (1); + return 1; } /* clear any allocated memory */ @@ -434,9 +433,8 @@ void free_chunks(imgchunk_t *fchunk, unsigned int *nfchunks) { int i; for (i = 0; i < *nfchunks; i++) { - if (fchunk[i].data != NULL) { + if (fchunk[i].data != NULL) kfree(fchunk[i].data); - } } *nfchunks = 0; memset(fchunk, 0, sizeof(*fchunk)); @@ -531,7 +529,7 @@ int mkimage(imgchunk_t *clist, unsigned int *ccnt) if (clist[i].data == NULL) { printk(KERN_ERR "failed to allocate image space, exitting.\n"); - return (1); + return 1; } memset(clist[i].data, 0, clist[i].len); pr_debug("chunk[%d]: addr=0x%06x len=%d\n", @@ -545,15 +543,14 @@ int mkimage(imgchunk_t *clist, unsigned int *ccnt) for (j = 0; j < *ccnt; j++) { cstart = clist[j].addr; cend = cstart + clist[j].len - 1; - if (s3start >= cstart && s3end <= cend) { + if (s3start >= cstart && s3end <= cend) break; - } } if (((unsigned int)j) >= (*ccnt)) { printk(KERN_ERR "s3rec(a=0x%06x,l=%d), no chunk match, exiting.\n", s3start, s3data[i].len); - return (1); + return 1; } coffset = s3start - cstart; memcpy(clist[j].data + coffset, s3data[i].data, s3data[i].len); @@ -586,7 +583,7 @@ int mkpdrlist(pda_t *pda) curroff = 0; while (curroff < (HFA384x_PDA_LEN_MAX / 2) && le16_to_cpu(pda16[curroff + 1]) != HFA384x_PDR_END_OF_PDA) { - pda->rec[pda->nrec] = (hfa384x_pdrec_t *) & (pda16[curroff]); + pda->rec[pda->nrec] = (hfa384x_pdrec_t *) &(pda16[curroff]); if (le16_to_cpu(pda->rec[pda->nrec]->code) == HFA384x_PDR_NICID) { memcpy(&nicid, &pda->rec[pda->nrec]->data.nicid, @@ -623,10 +620,10 @@ int mkpdrlist(pda_t *pda) printk(KERN_ERR "no end record found or invalid lengths in " "PDR data, exiting. %x %d\n", curroff, pda->nrec); - return (1); + return 1; } if (le16_to_cpu(pda16[curroff + 1]) == HFA384x_PDR_END_OF_PDA) { - pda->rec[pda->nrec] = (hfa384x_pdrec_t *) & (pda16[curroff]); + pda->rec[pda->nrec] = (hfa384x_pdrec_t *) &(pda16[curroff]); (pda->nrec)++; } return result; @@ -869,7 +866,7 @@ int read_fwfile(const struct ihex_binrec *record) ptr16 = (u16 *) record->data; /* parse what was an S3 srec and put it in the right array */ - switch(addr) { + switch (addr) { case S3ADDR_START: startaddr = *ptr32; pr_debug(" S7 start addr, record=%d " @@ -890,7 +887,7 @@ int read_fwfile(const struct ihex_binrec *record) s3plug[ns3plug].len); ns3plug++; - if ( ns3plug == S3PLUG_MAX ) { + if (ns3plug == S3PLUG_MAX) { printk(KERN_ERR "S3 plugrec limit reached - aborting\n"); return 1; } @@ -907,7 +904,7 @@ int read_fwfile(const struct ihex_binrec *record) s3crc[ns3crc].len, s3crc[ns3crc].dowrite); ns3crc++; - if ( ns3crc == S3CRC_MAX ) { + if (ns3crc == S3CRC_MAX) { printk(KERN_ERR "S3 crcrec limit reached - aborting\n"); return 1; } @@ -921,12 +918,12 @@ int read_fwfile(const struct ihex_binrec *record) rcnt, s3info[ns3info].len, s3info[ns3info].type); - if ( ((s3info[ns3info].len - 1) * sizeof(u16)) > sizeof(s3info[ns3info].info) ) { + if (((s3info[ns3info].len - 1) * sizeof(u16)) > sizeof(s3info[ns3info].info)) { printk(KERN_ERR " S3 inforec length too long - aborting\n"); return 1; } - tmpinfo = (u16*)&(s3info[ns3info].info.version); + tmpinfo = (u16 *)&(s3info[ns3info].info.version); pr_debug(" info="); for (i = 0; i < s3info[ns3info].len - 1; i++) { tmpinfo[i] = *(ptr16 + 2 + i); @@ -935,7 +932,7 @@ int read_fwfile(const struct ihex_binrec *record) pr_debug("\n"); ns3info++; - if ( ns3info == S3INFO_MAX ) { + if (ns3info == S3INFO_MAX) { printk(KERN_ERR "S3 inforec limit reached - aborting\n"); return 1; } @@ -945,7 +942,7 @@ int read_fwfile(const struct ihex_binrec *record) s3data[ns3data].len = len; s3data[ns3data].data = (uint8_t *) record->data; ns3data++; - if ( ns3data == S3DATA_MAX ) { + if (ns3data == S3DATA_MAX) { printk(KERN_ERR "S3 datarec limit reached - aborting\n"); return 1; } @@ -1023,7 +1020,7 @@ int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk, rstatemsg.enable.data = P80211ENUM_truth_true; rstatemsg.exeaddr.data = startaddr; - msgp = (p80211msg_t *) & rstatemsg; + msgp = (p80211msg_t *) &rstatemsg; result = prism2mgmt_ramdl_state(wlandev, msgp); if (result) { printk(KERN_ERR @@ -1063,7 +1060,7 @@ int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk, ("Sending xxxdl_write message addr=%06x len=%d.\n", currdaddr, currlen); - msgp = (p80211msg_t *) & rwritemsg; + msgp = (p80211msg_t *) &rwritemsg; result = prism2mgmt_ramdl_write(wlandev, msgp); /* Check the results */ @@ -1090,7 +1087,7 @@ int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk, rstatemsg.enable.data = P80211ENUM_truth_false; rstatemsg.exeaddr.data = 0; - msgp = (p80211msg_t *) & rstatemsg; + msgp = (p80211msg_t *) &rstatemsg; result = prism2mgmt_ramdl_state(wlandev, msgp); if (result) { printk(KERN_ERR @@ -1160,10 +1157,7 @@ int validate_identity(void) } /* SEC compat range */ if ((s3info[i].info.compat.role == 1) && - (s3info[i].info.compat.id == 4)) { - - } - + (s3info[i].info.compat.id == 4)) break; case 3: pr_debug("Seq: %#x\n", s3info[i].info.buildseq); @@ -1196,8 +1190,9 @@ int validate_identity(void) pr_debug("Unknown inforec type %d\n", s3info[i].type); } } - // walk through + /* walk through */ - if (trump && (result != 2)) result = 0; + if (trump && (result != 2)) + result = 0; return result; } diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c index 9f7d96c..ad163da 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.c +++ b/drivers/staging/wlan-ng/prism2mgmt.c @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include #include #include @@ -541,7 +541,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp) /*** STATION ***/ /* Set the REQUIRED config items */ /* SSID */ - pstr = (p80211pstrd_t *) & (msg->ssid.data); + pstr = (p80211pstrd_t *) &(msg->ssid.data); prism2mgmt_pstr2bytestr(p2bytestr, pstr); result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID, bytebuf, HFA384x_RID_CNFOWNSSID_LEN); @@ -1034,7 +1034,7 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp) /* Set the ssid */ memset(bytebuf, 0, 256); - pstr = (p80211pstrd_t *) & (msg->ssid.data); + pstr = (p80211pstrd_t *) &(msg->ssid.data); prism2mgmt_pstr2bytestr(p2bytestr, pstr); result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID, bytebuf, @@ -1123,8 +1123,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) if (hw->presniff_port_type != 0) { word = hw->presniff_port_type; result = hfa384x_drvr_setconfig16(hw, - HFA384x_RID_CNFPORTTYPE, - word); + HFA384x_RID_CNFPORTTYPE, + word); if (result) { pr_debug ("failed to restore porttype, result=%d\n", @@ -1156,10 +1156,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) if (wlandev->netdev->type == ARPHRD_ETHER) { /* Save macport 0 state */ result = hfa384x_drvr_getconfig16(hw, - HFA384x_RID_CNFPORTTYPE, - & - (hw-> - presniff_port_type)); + HFA384x_RID_CNFPORTTYPE, + &(hw->presniff_port_type)); if (result) { pr_debug ("failed to read porttype, result=%d\n", @@ -1168,10 +1166,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) } /* Save the wepflags state */ result = hfa384x_drvr_getconfig16(hw, - HFA384x_RID_CNFWEPFLAGS, - & - (hw-> - presniff_wepflags)); + HFA384x_RID_CNFWEPFLAGS, + &(hw->presniff_wepflags)); if (result) { pr_debug ("failed to read wepflags, result=%d\n", @@ -1218,8 +1214,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) /* Set the port type to pIbss */ word = HFA384x_PORTTYPE_PSUEDOIBSS; result = hfa384x_drvr_setconfig16(hw, - HFA384x_RID_CNFPORTTYPE, - word); + HFA384x_RID_CNFPORTTYPE, + word); if (result) { pr_debug ("failed to set porttype %d, result=%d\n", @@ -1235,8 +1231,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp) HFA384x_WEPFLAGS_DISABLE_RXCRYPT; result = hfa384x_drvr_setconfig16(hw, - HFA384x_RID_CNFWEPFLAGS, - word); + HFA384x_RID_CNFWEPFLAGS, + word); } if (result) { diff --git a/drivers/staging/wlan-ng/prism2mgmt.h b/drivers/staging/wlan-ng/prism2mgmt.h index bdf2b3e..07eeceb 100644 --- a/drivers/staging/wlan-ng/prism2mgmt.h +++ b/drivers/staging/wlan-ng/prism2mgmt.h @@ -63,43 +63,43 @@ extern int prism2_reset_holdtime; extern int prism2_reset_settletime; -u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate); +u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate); -void prism2sta_ev_info(wlandevice_t * wlandev, hfa384x_InfFrame_t * inf); -void prism2sta_ev_txexc(wlandevice_t * wlandev, u16 status); -void prism2sta_ev_tx(wlandevice_t * wlandev, u16 status); -void prism2sta_ev_rx(wlandevice_t * wlandev, struct sk_buff *skb); -void prism2sta_ev_alloc(wlandevice_t * wlandev); +void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf); +void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status); +void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status); +void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb); +void prism2sta_ev_alloc(wlandevice_t *wlandev); -int prism2mgmt_mibset_mibget(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_scan(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_scan_results(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_start(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_wlansniff(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_readpda(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_ramdl_state(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_ramdl_write(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_flashdl_state(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_flashdl_write(wlandevice_t * wlandev, void *msgp); -int prism2mgmt_autojoin(wlandevice_t * wlandev, void *msgp); +int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_start(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp); +int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp); /*--------------------------------------------------------------- * conversion functions going between wlan message data types and * Prism2 data types ---------------------------------------------------------------*/ /* byte area conversion functions*/ -void prism2mgmt_pstr2bytearea(u8 * bytearea, p80211pstrd_t * pstr); -void prism2mgmt_bytearea2pstr(u8 * bytearea, p80211pstrd_t * pstr, int len); +void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr); +void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len); /* byte string conversion functions*/ -void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr); -void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr); +void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr); +void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr); /* functions to convert Group Addresses */ -void prism2mgmt_get_grpaddr(u32 did, p80211pstrd_t * pstr, hfa384x_t * priv); +void prism2mgmt_get_grpaddr(u32 did, p80211pstrd_t *pstr, hfa384x_t *priv); int prism2mgmt_set_grpaddr(u32 did, - u8 * prism2buf, p80211pstrd_t * pstr, - hfa384x_t * priv); + u8 *prism2buf, p80211pstrd_t *pstr, + hfa384x_t *priv); int prism2mgmt_get_grpaddr_index(u32 did); void prism2sta_processing_defer(struct work_struct *data); diff --git a/drivers/staging/wlan-ng/prism2mib.c b/drivers/staging/wlan-ng/prism2mib.c index 2fff0a1..0cbbe51 100644 --- a/drivers/staging/wlan-ng/prism2mib.c +++ b/drivers/staging/wlan-ng/prism2mib.c @@ -113,8 +113,7 @@ static int prism2mib_flag(mibrec_t *mib, p80211msg_dot11req_mibset_t *msg, void *data); static int prism2mib_wepdefaultkey(mibrec_t *mib, - int isget, - wlandevice_t * wlandev, + int isget, wlandevice_t *wlandev, hfa384x_t *hw, p80211msg_dot11req_mibset_t *msg, void *data); @@ -726,7 +725,7 @@ static int prism2mib_priv(mibrec_t *mib, if (isget) { hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFWPADATA, - (u8 *) & wpa, + (u8 *) &wpa, sizeof(wpa)); pstr->len = le16_to_cpu(wpa.datalen); memcpy(pstr->data, wpa.data, pstr->len); @@ -736,9 +735,9 @@ static int prism2mib_priv(mibrec_t *mib, result = hfa384x_drvr_setconfig(hw, - HFA384x_RID_CNFWPADATA, - (u8 *) & wpa, - sizeof(wpa)); + HFA384x_RID_CNFWPADATA, + (u8 *) &wpa, + sizeof(wpa)); } break; } diff --git a/drivers/staging/wlan-ng/prism2sta.c b/drivers/staging/wlan-ng/prism2sta.c index 50f301d..32a3db8 100644 --- a/drivers/staging/wlan-ng/prism2sta.c +++ b/drivers/staging/wlan-ng/prism2sta.c @@ -64,7 +64,7 @@ #include #include -#include +#include #include #include #include @@ -1023,13 +1023,13 @@ static void prism2sta_inf_tallies(wlandevice_t *wlandev, cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(u32); if (inf->framelen > 22) { - dst = (u32 *) & hw->tallies; - src32 = (u32 *) & inf->info.commtallies32; + dst = (u32 *) &hw->tallies; + src32 = (u32 *) &inf->info.commtallies32; for (i = 0; i < cnt; i++, dst++, src32++) *dst += le32_to_cpu(*src32); } else { - dst = (u32 *) & hw->tallies; - src16 = (u16 *) & inf->info.commtallies16; + dst = (u32 *) &hw->tallies; + src16 = (u16 *) &inf->info.commtallies16; for (i = 0; i < cnt; i++, dst++, src16++) *dst += le16_to_cpu(*src16); } @@ -1280,9 +1280,8 @@ void prism2sta_processing_defer(struct work_struct *data) HFA384x_RID_CURRENTSSID, result); goto failed; } - prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid, - (p80211pstrd_t *) & - wlandev->ssid); + prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) &ssid, + (p80211pstrd_t *) &wlandev->ssid); /* Collect the port status */ result = hfa384x_drvr_getconfig16(hw, @@ -1368,8 +1367,8 @@ void prism2sta_processing_defer(struct work_struct *data) HFA384x_RID_CURRENTSSID, result); goto failed; } - prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid, - (p80211pstrd_t *) & wlandev->ssid); + prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) &ssid, + (p80211pstrd_t *) &wlandev->ssid); hw->link_status = HFA384x_LINK_CONNECTED; netif_carrier_on(wlandev->netdev); @@ -2028,8 +2027,8 @@ void prism2sta_commsqual_defer(struct work_struct *data) HFA384x_RID_CURRENTSSID, result); goto done; } - prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) & ssid, - (p80211pstrd_t *) & wlandev->ssid); + prism2mgmt_bytestr2pstr((hfa384x_bytestr_t *) &ssid, + (p80211pstrd_t *) &wlandev->ssid); /* Reschedule timer */ mod_timer(&hw->commsqual_timer, jiffies + HZ); -- cgit v0.10.2 From 3f4b4e779714ae2dd55757617a8033ab338fa7f0 Mon Sep 17 00:00:00 2001 From: Andrew Elwell Date: Thu, 18 Feb 2010 23:56:13 +0100 Subject: Staging: wlan-ng: More checkpatch.pl error cleanups Signed-off-by: Andrew Elwell Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index 730d085..d3a85f2 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -1909,18 +1909,19 @@ int hfa384x_drvr_flashdl_enable(hfa384x_t *hw) return -EINVAL; /* Retrieve the buffer loc&size and timeout */ - if ((result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER, - &(hw->bufinfo), - sizeof(hw->bufinfo)))) { + result = hfa384x_drvr_getconfig(hw, HFA384x_RID_DOWNLOADBUFFER, + &(hw->bufinfo), sizeof(hw->bufinfo)); + if (result) return result; - } + hw->bufinfo.page = le16_to_cpu(hw->bufinfo.page); hw->bufinfo.offset = le16_to_cpu(hw->bufinfo.offset); hw->bufinfo.len = le16_to_cpu(hw->bufinfo.len); - if ((result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME, - &(hw->dltimeout)))) { + result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_MAXLOADTIME, + &(hw->dltimeout)); + if (result) return result; - } + hw->dltimeout = le16_to_cpu(hw->dltimeout); pr_debug("flashdl_enable\n"); @@ -3071,9 +3072,9 @@ static void hfa384x_usbctlxq_run(hfa384x_t *hw) hfa384x_ctlxout_callback, hw); hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK; - /* Now submit the URB and update the CTLX's state - */ - if ((result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC)) == 0) { + /* Now submit the URB and update the CTLX's state */ + result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC); + if (result == 0) { /* This CTLX is now running on the active queue */ head->state = CTLX_REQ_SUBMITTED; @@ -3599,7 +3600,8 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev, skblen - sizeof(p80211_caphdr_t)); } - if ((skb = dev_alloc_skb(skblen)) == NULL) { + skb = dev_alloc_skb(skblen); + if (skb == NULL) { printk(KERN_ERR "alloc_skb failed trying to allocate %d bytes\n", skblen); @@ -3870,9 +3872,9 @@ retry: delresp: if (delete_resptimer) { - if ((timer_ok = del_timer(&hw->resptimer)) != 0) { + timer_ok = del_timer(&hw->resptimer); + if (timer_ok != 0) hw->resp_timer_done = 1; - } } spin_unlock_irqrestore(&hw->ctlxq.lock, flags); diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index 5952c67..3ba5eab 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -207,11 +207,10 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC); - if ((foo = wep_encrypt(wlandev, skb->data, p80211_wep->data, - skb->len, - (wlandev->hostwep & - HOSTWEP_DEFAULTKEY_MASK), - p80211_wep->iv, p80211_wep->icv))) { + foo = wep_encrypt(wlandev, skb->data, p80211_wep->data, + skb->len, (wlandev->hostwep &HOSTWEP_DEFAULTKEY_MASK), + p80211_wep->iv, p80211_wep->icv); + if (foo) { printk(KERN_WARNING "Host en-WEP failed, dropping frame (%d).\n", foo); @@ -323,11 +322,12 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, skb->len); return 1; } - if ((foo = wep_decrypt(wlandev, skb->data + payload_offset + 4, + foo = wep_decrypt(wlandev, skb->data + payload_offset + 4, payload_length - 8, -1, skb->data + payload_offset, skb->data + payload_offset + - payload_length - 4))) { + payload_length - 4); + if (foo) { /* de-wep failed, drop skb. */ pr_debug("Host de-WEP failed, dropping frame (%d).\n", foo); diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index e27d72c..763ab11 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -586,7 +586,8 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd) } /* Allocate a buf of size req->len */ - if ((msgbuf = kmalloc(req->len, GFP_KERNEL))) { + msgbuf = kmalloc(req->len, GFP_KERNEL); + if (msgbuf) { if (copy_from_user(msgbuf, (void __user *)req->data, req->len)) result = -EFAULT; else diff --git a/drivers/staging/wlan-ng/p80211wext.c b/drivers/staging/wlan-ng/p80211wext.c index 040c9e3..108a806 100644 --- a/drivers/staging/wlan-ng/p80211wext.c +++ b/drivers/staging/wlan-ng/p80211wext.c @@ -549,14 +549,14 @@ static int p80211wext_siwencode(netdevice_t *dev, } /* Check the Key index first. */ - if ((i = (erq->flags & IW_ENCODE_INDEX))) { - + i = (erq->flags & IW_ENCODE_INDEX); + if (i) { if ((i < 1) || (i > NUM_WEPKEYS)) { err = -EINVAL; goto exit; - } else + } else { i--; - + } /* Set current key number only if no keys are given */ if (erq->flags & IW_ENCODE_NOKEY) { result = -- cgit v0.10.2 From df84f941e9370be6798fa11aa5a77396d8869fdc Mon Sep 17 00:00:00 2001 From: Chihau Chau Date: Thu, 25 Feb 2010 19:57:39 -0300 Subject: Staging: dream: camera: msm_camera: fix code style issues This fixes some code style issues like to add one space after a while or switch statement and before a open parenthesis '(', and to include KERN_ facility level in the printk() functions. Signed-off-by: Chihau Chau Acked-by: Pavel Machek Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/dream/camera/msm_camera.c b/drivers/staging/dream/camera/msm_camera.c index 925e16c..223918f 100644 --- a/drivers/staging/dream/camera/msm_camera.c +++ b/drivers/staging/dream/camera/msm_camera.c @@ -76,14 +76,14 @@ static LIST_HEAD(msm_sensors); list_del_init(&qcmd->list); \ kfree(qcmd); \ }; \ -} while(0) +} while (0) #define MSM_DRAIN_QUEUE(sync, name) do { \ unsigned long flags; \ spin_lock_irqsave(&(sync)->name##_lock, flags); \ MSM_DRAIN_QUEUE_NOSYNC(sync, name); \ spin_unlock_irqrestore(&(sync)->name##_lock, flags); \ -} while(0) +} while (0) static int check_overlap(struct hlist_head *ptype, unsigned long paddr, @@ -868,7 +868,7 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg) return -EFAULT; } - switch(cfgcmd.cmd_type) { + switch (cfgcmd.cmd_type) { case CMD_STATS_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->stats, @@ -1621,7 +1621,8 @@ static int msm_release_control(struct inode *node, struct file *filep) int rc; struct msm_control_device *ctrl_pmsm = filep->private_data; struct msm_device *pmsm = ctrl_pmsm->pmsm; - printk("msm_camera: RELEASE %s\n", filep->f_path.dentry->d_name.name); + printk(KERN_INFO "msm_camera: RELEASE %s\n", + filep->f_path.dentry->d_name.name); rc = __msm_release(pmsm->sync); if (!rc) { MSM_DRAIN_QUEUE(&ctrl_pmsm->ctrl_q, ctrl_status_q); @@ -1635,7 +1636,8 @@ static int msm_release_frame(struct inode *node, struct file *filep) { int rc; struct msm_device *pmsm = filep->private_data; - printk("msm_camera: RELEASE %s\n", filep->f_path.dentry->d_name.name); + printk(KERN_INFO "msm_camera: RELEASE %s\n", + filep->f_path.dentry->d_name.name); rc = __msm_release(pmsm->sync); if (!rc) { MSM_DRAIN_QUEUE(pmsm->sync, prev_frame_q); @@ -1719,7 +1721,7 @@ static void msm_vfe_sync(struct msm_vfe_resp *vdata, qcmd->type = qtype; if (qtype == MSM_CAM_Q_VFE_MSG) { - switch(vdata->type) { + switch (vdata->type) { case VFE_MSG_OUTPUT1: case VFE_MSG_OUTPUT2: qcmd_frame = @@ -1928,7 +1930,8 @@ static int __msm_v4l2_control(struct msm_sync *sync, memcpy(out->value, ctrl->value, ctrl->length); end: - if (rcmd) kfree(rcmd); + if (rcmd) + kfree(rcmd); CDBG("__msm_v4l2_control: end rc = %d\n", rc); return rc; } -- cgit v0.10.2 From b94c765ac31f8eb9c6fe895ba611bb446b799635 Mon Sep 17 00:00:00 2001 From: Chihau Chau Date: Thu, 25 Feb 2010 20:20:09 -0300 Subject: Staging: dream: camera: sk5k3e2fx: fix code style issues This fixes some code style issues about assignments in if conditions. Signed-off-by: Chihau Chau Acked-by: Pavel Machek Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/dream/camera/s5k3e2fx.c b/drivers/staging/dream/camera/s5k3e2fx.c index edba198..2426f5e 100644 --- a/drivers/staging/dream/camera/s5k3e2fx.c +++ b/drivers/staging/dream/camera/s5k3e2fx.c @@ -743,12 +743,12 @@ static int s5k3e2fx_sensor_open_init(const struct msm_camera_sensor_info *data) } /* initialize AF */ - if ((rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr, - 0x3146, 0x3A)) < 0) + rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr, 0x3146, 0x3A); + if (rc < 0) goto init_fail1; - if ((rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr, - 0x3130, 0x03)) < 0) + rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr, 0x3130, 0x03); + if (rc < 0) goto init_fail1; goto init_done; -- cgit v0.10.2