Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d14c7c1d authored by Andrey Borzenkov's avatar Andrey Borzenkov Committed by John W. Linville
Browse files

orinoco: checkpatch cleanup



Fix errors and obvious warnings reported by checkpatch in all files
except orinoco.c. Orinoco.c is part of different patch series of Dave.

Signed-off-by: default avatarAndrey Borzenkov <arvidjaar@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent aa6320d3
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state)
	orinoco_unlock(priv, &flags);

	disable_irq(dev->irq);
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 0);
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
			  macio_get_of_node(mdev), 0, 0);

	return 0;
}
@@ -75,7 +76,8 @@ airport_resume(struct macio_dev *mdev)

	printk(KERN_DEBUG "%s: Airport waking up\n", dev->name);

	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 1);
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
			  macio_get_of_node(mdev), 0, 1);
	msleep(200);

	enable_irq(dev->irq);
@@ -127,7 +129,8 @@ airport_detach(struct macio_dev *mdev)

	macio_release_resource(mdev, 0);

	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 0);
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
			  macio_get_of_node(mdev), 0, 0);
	ssleep(1);

	macio_set_drvdata(mdev, NULL);
@@ -153,9 +156,11 @@ static int airport_hard_reset(struct orinoco_private *priv)
	 * off. */
	disable_irq(dev->irq);

	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(card->mdev), 0, 0);
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
			  macio_get_of_node(card->mdev), 0, 0);
	ssleep(1);
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(card->mdev), 0, 1);
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
			  macio_get_of_node(card->mdev), 0, 1);
	ssleep(1);

	enable_irq(dev->irq);
@@ -216,7 +221,8 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
	hermes_struct_init(hw, card->vaddr, HERMES_16BIT_REGSPACING);

	/* Power up card */
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE, macio_get_of_node(mdev), 0, 1);
	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
			  macio_get_of_node(mdev), 0, 1);
	ssleep(1);

	/* Reset it before we get the interrupt */
@@ -258,8 +264,7 @@ static struct of_device_id airport_match[] =

MODULE_DEVICE_TABLE(of, airport_match);

static struct macio_driver airport_driver = 
{
static struct macio_driver airport_driver = {
	.name 		= DRIVER_NAME,
	.match_table	= airport_match,
	.probe		= airport_attach,
+56 −46
Original line number Diff line number Diff line
@@ -45,7 +45,8 @@

#include "hermes.h"

MODULE_DESCRIPTION("Low-level driver helper for Lucent Hermes chipset and Prism II HFA384x wireless MAC controller");
MODULE_DESCRIPTION("Low-level driver helper for Lucent Hermes chipset"
		   " and Prism II HFA384x wireless MAC controller");
MODULE_AUTHOR("Pavel Roskin <proski@gnu.org>"
	" & David Gibson <hermes@gibson.dropbear.id.au>");
MODULE_LICENSE("Dual MPL/GPL");
@@ -100,9 +101,8 @@ static int hermes_issue_cmd(hermes_t *hw, u16 cmd, u16 param0,
		udelay(1);
		reg = hermes_read_regn(hw, CMD);
	}
	if (reg & HERMES_CMD_BUSY) {
	if (reg & HERMES_CMD_BUSY)
		return -EBUSY;
	}

	hermes_write_regn(hw, PARAM2, param2);
	hermes_write_regn(hw, PARAM1, param1);
@@ -199,8 +199,8 @@ int hermes_init(hermes_t *hw)
	k = CMD_BUSY_TIMEOUT;
	reg = hermes_read_regn(hw, CMD);
	while (k && (reg & HERMES_CMD_BUSY)) {
		if (reg == 0xffff) /* Special case - the card has probably been removed,
				      so don't wait for the timeout */
		if (reg == 0xffff) /* Special case - the card has probably been
				      removed, so don't wait for the timeout */
			return -ENODEV;

		k--;
@@ -228,7 +228,10 @@ EXPORT_SYMBOL(hermes_init);
/* Issue a command to the chip, and (busy!) wait for it to
 * complete.
 *
 * Returns: < 0 on internal error, 0 on success, > 0 on error returned by the firmware
 * Returns:
 *     < 0 on internal error
 *       0 on success
 *     > 0 on error returned by the firmware
 *
 * Callable from any context, but locking is your problem. */
int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0,
@@ -306,9 +309,8 @@ int hermes_allocate(hermes_t *hw, u16 size, u16 *fid)
		return -EINVAL;

	err = hermes_docmd_wait(hw, HERMES_CMD_ALLOC, size, NULL);
	if (err) {
	if (err)
		return err;
	}

	reg = hermes_read_regn(hw, EVSTAT);
	k = ALLOC_COMPL_TIMEOUT;
@@ -341,7 +343,10 @@ EXPORT_SYMBOL(hermes_allocate);

/* Set up a BAP to read a particular chunk of data from card's internal buffer.
 *
 * Returns: < 0 on internal failure (errno), 0 on success, >0 on error
 * Returns:
 *     < 0 on internal failure (errno)
 *       0 on success
 *     > 0 on error
 * from firmware
 *
 * Callable from any context */
@@ -386,9 +391,8 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset)
		       (reg & HERMES_OFFSET_BUSY) ? "timeout" : "error",
		       reg, id, offset);

		if (reg & HERMES_OFFSET_BUSY) {
		if (reg & HERMES_OFFSET_BUSY)
			return -ETIMEDOUT;
		}

		return -EIO;		/* error or wrong offset */
	}
@@ -400,7 +404,10 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset)
 * BAP. Synchronization/serialization is the caller's problem.  len
 * must be even.
 *
 * Returns: < 0 on internal failure (errno), 0 on success, > 0 on error from firmware
 * Returns:
 *     < 0 on internal failure (errno)
 *       0 on success
 *     > 0 on error from firmware
 */
int hermes_bap_pread(hermes_t *hw, int bap, void *buf, int len,
		     u16 id, u16 offset)
@@ -426,7 +433,10 @@ EXPORT_SYMBOL(hermes_bap_pread);
/* Write a block of data to the chip's buffer, via the
 * BAP. Synchronization/serialization is the caller's problem.
 *
 * Returns: < 0 on internal failure (errno), 0 on success, > 0 on error from firmware
 * Returns:
 *     < 0 on internal failure (errno)
 *       0 on success
 *     > 0 on error from firmware
 */
int hermes_bap_pwrite(hermes_t *hw, int bap, const void *buf, int len,
		      u16 id, u16 offset)
+20 −15
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@
 * Copyright (C) 2000, David Gibson, Linuxcare Australia.
 * (C) Copyright David Gibson, IBM Corp. 2001-2003.
 *
 * Portions taken from hfa384x.h, Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
 * Portions taken from hfa384x.h.
 * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
 *
 * This file distributed under the GPL, version 2.
 */
@@ -31,7 +32,7 @@
*/

#include <linux/if_ether.h>
#include <asm/io.h>
#include <linux/io.h>

/*
 * Limits and constants
@@ -388,7 +389,8 @@ typedef struct hermes {
#define hermes_write_reg(hw, off, val) \
	(iowrite16((val), (hw)->iobase + ((off) << (hw)->reg_spacing)))
#define hermes_read_regn(hw, name) hermes_read_reg((hw), HERMES_##name)
#define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, (val))
#define hermes_write_regn(hw, name, val) \
	hermes_write_reg((hw), HERMES_##name, (val))

/* Function prototypes */
void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing);
@@ -445,7 +447,8 @@ static inline int hermes_inquire(hermes_t *hw, u16 rid)
#define HERMES_RECLEN_TO_BYTES(n) (((n)-1) * 2)

/* Note that for the next two, the count is in 16-bit words, not bytes */
static inline void hermes_read_words(struct hermes *hw, int off, void *buf, unsigned count)
static inline void hermes_read_words(struct hermes *hw, int off,
				     void *buf, unsigned count)
{
	off = off << hw->reg_spacing;
	ioread16_rep(hw->iobase + off, buf, count);
@@ -460,7 +463,8 @@ static inline void hermes_write_bytes(struct hermes *hw, int off,
		iowrite8(buf[count - 1], hw->iobase + off);
}

static inline void hermes_clear_words(struct hermes *hw, int off, unsigned count)
static inline void hermes_clear_words(struct hermes *hw, int off,
				      unsigned count)
{
	unsigned i;

@@ -473,7 +477,8 @@ static inline void hermes_clear_words(struct hermes *hw, int off, unsigned count
#define HERMES_READ_RECORD(hw, bap, rid, buf) \
	(hermes_read_ltv((hw), (bap), (rid), sizeof(*buf), NULL, (buf)))
#define HERMES_WRITE_RECORD(hw, bap, rid, buf) \
	(hermes_write_ltv((hw),(bap),(rid),HERMES_BYTES_TO_RECLEN(sizeof(*buf)),(buf)))
	(hermes_write_ltv((hw), (bap), (rid), \
			  HERMES_BYTES_TO_RECLEN(sizeof(*buf)), (buf)))

static inline int hermes_read_wordrec(hermes_t *hw, int bap, u16 rid, u16 *word)
{
+10 −7
Original line number Diff line number Diff line
@@ -18,9 +18,9 @@
#include "hermes.h"

/* To enable debug messages */
//#define ORINOCO_DEBUG		3
/*#define ORINOCO_DEBUG		3*/

#define WIRELESS_SPY		// enable iwspy support
#define WIRELESS_SPY		/* enable iwspy support */

#define MAX_SCAN_LEN		4096

@@ -168,7 +168,10 @@ struct orinoco_private {

#ifdef ORINOCO_DEBUG
extern int orinoco_debug;
#define DEBUG(n, args...) do { if (orinoco_debug>(n)) printk(KERN_DEBUG args); } while(0)
#define DEBUG(n, args...) do { \
	if (orinoco_debug > (n)) \
		printk(KERN_DEBUG args); \
} while (0)
#else
#define DEBUG(n, args...) do { } while (0)
#endif	/* ORINOCO_DEBUG */
+17 −14
Original line number Diff line number Diff line
@@ -30,7 +30,8 @@
/********************************************************************/

MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
MODULE_DESCRIPTION("Driver for PCMCIA Lucent Orinoco, Prism II based and similar wireless cards");
MODULE_DESCRIPTION("Driver for PCMCIA Lucent Orinoco,"
		   " Prism II based and similar wireless cards");
MODULE_LICENSE("Dual MPL/GPL");

/* Module parameters */
@@ -162,7 +163,9 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
 */

#define CS_CHECK(fn, ret) do { \
		last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
	last_fn = (fn); \
	if ((last_ret = (ret)) != 0) \
		goto cs_failed; \
} while (0)

static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
@@ -307,8 +310,8 @@ orinoco_cs_config(struct pcmcia_device *link)
	 * initialized and arranged in a linked list at link->dev_node. */
	strcpy(card->node.dev_name, dev->name);
	link->dev_node = &card->node; /* link->dev_node being non-NULL is also
                                    used to indicate that the
                                    net_device has been registered */
				       * used to indicate that the
				       * net_device has been registered */

	/* Finally, report what we've done */
	printk(KERN_DEBUG "%s: " DRIVER_NAME " at %s, irq %d, io "
Loading