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

Commit 1a09404a authored by Michael Buesch's avatar Michael Buesch Committed by David S. Miller
Browse files

[B43]: Fix sparse warnings.



The remaining warning in phy.c will be fixed later.

Signed-off-by: default avatarMichael Buesch <mb@bu3sch.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fb8e4444
Loading
Loading
Loading
Loading
+21 −10
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@


/* The root directory. */
struct dentry *rootdir;
static struct dentry *rootdir;

struct b43_debugfs_fops {
	ssize_t (*read)(struct b43_wldev *dev, char *buf, size_t bufsize);
@@ -76,7 +76,8 @@ struct b43_dfs_file * fops_to_dfs_file(struct b43_wldev *dev,


/* wl->irq_lock is locked */
ssize_t tsf_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
static ssize_t tsf_read_file(struct b43_wldev *dev,
			     char *buf, size_t bufsize)
{
	ssize_t count = 0;
	u64 tsf;
@@ -90,7 +91,8 @@ ssize_t tsf_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
}

/* wl->irq_lock is locked */
int tsf_write_file(struct b43_wldev *dev, const char *buf, size_t count)
static int tsf_write_file(struct b43_wldev *dev,
			  const char *buf, size_t count)
{
	u64 tsf;

@@ -102,7 +104,8 @@ int tsf_write_file(struct b43_wldev *dev, const char *buf, size_t count)
}

/* wl->irq_lock is locked */
ssize_t ucode_regs_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
static ssize_t ucode_regs_read_file(struct b43_wldev *dev,
				    char *buf, size_t bufsize)
{
	ssize_t count = 0;
	int i;
@@ -116,7 +119,8 @@ ssize_t ucode_regs_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
}

/* wl->irq_lock is locked */
ssize_t shm_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
static ssize_t shm_read_file(struct b43_wldev *dev,
			     char *buf, size_t bufsize)
{
	ssize_t count = 0;
	int i;
@@ -135,7 +139,8 @@ ssize_t shm_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
	return count;
}

ssize_t txstat_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
static ssize_t txstat_read_file(struct b43_wldev *dev,
				char *buf, size_t bufsize)
{
	struct b43_txstatus_log *log = &dev->dfsentry->txstatlog;
	ssize_t count = 0;
@@ -182,7 +187,8 @@ ssize_t txstat_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
	return count;
}

ssize_t txpower_g_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
static ssize_t txpower_g_read_file(struct b43_wldev *dev,
				   char *buf, size_t bufsize)
{
	ssize_t count = 0;

@@ -214,7 +220,8 @@ ssize_t txpower_g_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
	return count;
}

int txpower_g_write_file(struct b43_wldev *dev, const char *buf, size_t count)
static int txpower_g_write_file(struct b43_wldev *dev,
				const char *buf, size_t count)
{
	unsigned long flags;
	unsigned long phy_flags;
@@ -262,7 +269,8 @@ int txpower_g_write_file(struct b43_wldev *dev, const char *buf, size_t count)
}

/* wl->irq_lock is locked */
int restart_write_file(struct b43_wldev *dev, const char *buf, size_t count)
static int restart_write_file(struct b43_wldev *dev,
			      const char *buf, size_t count)
{
	int err = 0;

@@ -294,7 +302,8 @@ static ssize_t append_lo_table(ssize_t count, char *buf, const size_t bufsize,
	return count;
}

ssize_t loctls_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
static ssize_t loctls_read_file(struct b43_wldev *dev,
				char *buf, size_t bufsize)
{
	ssize_t count = 0;
	struct b43_txpower_lo_control *lo;
@@ -383,6 +392,8 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
			err = -ENOMEM;
			goto out_unlock;
		}
		/* Sparse warns about the following memset, because it has a big
		 * size value. That warning is bogus, so I will ignore it. --mb */
		memset(buf, 0, bufsize);
		if (dfops->take_irqlock) {
			spin_lock_irq(&dev->wl->irq_lock);
+4 −4
Original line number Diff line number Diff line
@@ -32,14 +32,13 @@
static void b43_led_changestate(struct b43_led *led)
{
	struct b43_wldev *dev = led->dev;
	const int index = b43_led_index(led);
	const u16 mask = (1 << index);
	const int index = led->index;
	u16 ledctl;

	B43_WARN_ON(!(index >= 0 && index < B43_NR_LEDS));
	B43_WARN_ON(!led->blink_interval);
	ledctl = b43_read16(dev, B43_MMIO_GPIO_CONTROL);
	ledctl = (ledctl & mask) ? (ledctl & ~mask) : (ledctl | mask);
	ledctl ^= (1 << index);
	b43_write16(dev, B43_MMIO_GPIO_CONTROL, ledctl);
}

@@ -70,7 +69,7 @@ static void b43_led_blink_start(struct b43_led *led, unsigned long interval)
static void b43_led_blink_stop(struct b43_led *led, int sync)
{
	struct b43_wldev *dev = led->dev;
	const int index = b43_led_index(led);
	const int index = led->index;
	u16 ledctl;

	if (!led->blink_interval)
@@ -139,6 +138,7 @@ int b43_leds_init(struct b43_wldev *dev)

	for (i = 0; i < B43_NR_LEDS; i++) {
		led = &(dev->leds[i]);
		led->index = i;
		led->dev = dev;
		setup_timer(&led->blink_timer,
			    b43_led_blink, (unsigned long)led);
+4 −4
Original line number Diff line number Diff line
@@ -5,14 +5,14 @@
#include <linux/timer.h>

struct b43_led {
	u8 behaviour:7;
	u8 activelow:1;

	u8 behaviour;
	bool activelow;
	/* Index in the "leds" array in b43_wldev */
	u8 index;
	struct b43_wldev *dev;
	struct timer_list blink_timer;
	unsigned long blink_interval;
};
#define b43_led_index(led)	((int)((led) - (led)->dev->leds))

/* Delay between state changes when blinking in jiffies */
#define B43_LEDBLINK_SLOW		(HZ / 1)
+2 −3
Original line number Diff line number Diff line
@@ -1062,7 +1062,7 @@ static void handle_irq_noise(struct b43_wldev *dev)
	B43_WARN_ON(!dev->noisecalc.calculation_running);
	if (dev->noisecalc.channel_at_start != phy->channel)
		goto drop_calculation;
	*((u32 *) noise) = cpu_to_le32(b43_jssi_read(dev));
	*((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev));
	if (noise[0] == 0x7F || noise[1] == 0x7F ||
	    noise[2] == 0x7F || noise[3] == 0x7F)
		goto generate_new;
@@ -1598,8 +1598,7 @@ static int do_request_fw(struct b43_wldev *dev,
			 const char *name,
			 const struct firmware **fw)
{
	const size_t plen = sizeof(modparam_fwpostfix) + 32;
	char path[plen];
	char path[sizeof(modparam_fwpostfix) + 32];
	struct b43_fw_header *hdr;
	u32 size;
	int err;
+3 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@

*/

#include "pcmcia.h"

#include <linux/ssb/ssb.h>

#include <pcmcia/cs_types.h>
@@ -30,6 +32,7 @@
#include <pcmcia/ds.h>
#include <pcmcia/cisreg.h>


static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = {
	PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448),
	PCMCIA_DEVICE_NULL,
Loading