Skip to content

Commit

Permalink
Staging: Merge two branches of coding style fixes together
Browse files Browse the repository at this point in the history
Turns out that multiple people sent pretty much the same patch
for the same staging drivers.  Commit these in two different
branches and merge them together to get a more complete coverage
of the cleanup and properly credit everyone for the work that they
did.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Mar 4, 2010
2 parents 3a8954e + b94c765 commit b02957d
Show file tree
Hide file tree
Showing 16 changed files with 149 additions and 123 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1612,7 +1612,7 @@ static ssize_t comedi_write(struct file *file, const char *buf, size_t nbytes,
}

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;
Expand Down
16 changes: 7 additions & 9 deletions drivers/staging/comedi/drivers/ni_660x.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ 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 */

#define MAX_DMA_CHANNEL 4

/* See Register-Level Programmer Manual page 3.1 */
Expand Down Expand Up @@ -200,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] = {
Expand Down Expand Up @@ -1082,13 +1081,12 @@ static int ni_660x_attach(struct comedi_device *dev,
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));
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));
if (private(dev)->counter_dev == NULL)
return -ENOMEM;
for (i = 0; i < NI_660X_MAX_NUM_COUNTERS; ++i) {
Expand Down
13 changes: 10 additions & 3 deletions drivers/staging/comedi/drivers/ni_labpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,9 +628,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
/*
* Could provide command support, except it only has a
* one sample hardware buffer for analog output and no
* underrun flag. */
* underrun flag.
*/
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_GROUND;
s->n_chan = NUM_AO_CHAN;
Expand Down Expand Up @@ -1149,6 +1151,7 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
/* initialize software conversion 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 */
Expand Down Expand Up @@ -1403,7 +1406,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)) {
Expand Down Expand Up @@ -1523,6 +1529,7 @@ static void labpc_drain_dma(struct comedi_device *dev)
/* write data to comedi buffer */
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;

Expand Down
13 changes: 7 additions & 6 deletions drivers/staging/comedi/drivers/pcmad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <linux/interrupt.h>
Expand Down Expand Up @@ -134,7 +134,7 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it)
unsigned long iobase;

iobase = it->options[0];
printk(KERN_NOTICE "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(KERN_CONT "I/O port conflict\n");
return -EIO;
Expand Down Expand Up @@ -166,10 +166,11 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it)

static int pcmad_detach(struct comedi_device *dev)
{
printk(KERN_NOTICE "comedi%d: pcmad: remove\n", dev->minor);
printk(KERN_INFO "comedi%d: pcmad: remove\n", dev->minor);

if (dev->irq)
free_irq(dev->irq, dev);

if (dev->iobase)
release_region(dev->iobase, PCMAD_SIZE);

Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/comedi/drivers/poc.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = this_board->name;

if (iobase == 0) {
printk(KERN_WARNING "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(KERN_WARNING "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;
Expand Down
8 changes: 5 additions & 3 deletions drivers/staging/dream/camera/msm_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -1619,7 +1619,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(KERN_INFO "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);
Expand All @@ -1633,7 +1634,8 @@ static int msm_release_frame(struct inode *node, struct file *filep)
{
int rc;
struct msm_device *pmsm = filep->private_data;
printk(KERN_INFO "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);
Expand Down
6 changes: 2 additions & 4 deletions drivers/staging/dream/camera/s5k3e2fx.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,13 +743,11 @@ static int s5k3e2fx_sensor_open_init(const struct msm_camera_sensor_info *data)
}

/* initialize AF */
rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
0x3146, 0x3A)
rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr, 0x3146, 0x3A);
if (rc < 0)
goto init_fail1;

rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr,
0x3130, 0x03)
rc = s5k3e2fx_i2c_write_b(s5k3e2fx_client->addr, 0x3130, 0x03);
if (rc < 0)
goto init_fail1;

Expand Down
106 changes: 69 additions & 37 deletions drivers/staging/wlan-ng/hfa384x.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@
#include <linux/if_ether.h>

/*--- 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)
Expand Down Expand Up @@ -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 --------------------------*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand All @@ -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)
/*--------------------------------------------------------------------
Expand Down Expand Up @@ -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
----------------------------------------------------------------------
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -1387,6 +1419,6 @@ int
hfa384x_cmd_download(hfa384x_t *hw,
u16 mode, u16 lowaddr, u16 highaddr, u16 codelen);

#endif /* __KERNEL__ */
#endif /*__KERNEL__ */

#endif /* _HFA384x_H */
#endif /*_HFA384x_H */
Loading

0 comments on commit b02957d

Please sign in to comment.