diff options
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/csr1212.c | 2 | ||||
-rw-r--r-- | drivers/ieee1394/dv1394.c | 11 | ||||
-rw-r--r-- | drivers/ieee1394/eth1394.c | 16 | ||||
-rw-r--r-- | drivers/ieee1394/ieee1394_core.h | 6 | ||||
-rw-r--r-- | drivers/ieee1394/nodemgr.c | 5 | ||||
-rw-r--r-- | drivers/ieee1394/pcilynx.c | 2 | ||||
-rw-r--r-- | drivers/ieee1394/sbp2.c | 8 |
7 files changed, 28 insertions, 22 deletions
diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index a6dfeb0b3372..e76cac64c533 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -35,6 +35,7 @@ #include <linux/errno.h> #include <linux/kernel.h> +#include <linux/kmemcheck.h> #include <linux/string.h> #include <asm/bug.h> #include <asm/byteorder.h> @@ -387,6 +388,7 @@ csr1212_new_descriptor_leaf(u8 dtype, u32 specifier_id, if (!kv) return NULL; + kmemcheck_annotate_variable(kv->value.leaf.data[0]); CSR1212_DESCRIPTOR_LEAF_SET_TYPE(kv, dtype); CSR1212_DESCRIPTOR_LEAF_SET_SPECIFIER_ID(kv, specifier_id); diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c index 4c2c02572d21..2cd00b5b45b4 100644 --- a/drivers/ieee1394/dv1394.c +++ b/drivers/ieee1394/dv1394.c @@ -1325,11 +1325,7 @@ static int dv1394_fasync(int fd, struct file *file, int on) struct video_card *video = file_to_video_card(file); - int retval = fasync_helper(fd, file, on, &video->fasync); - - if (retval < 0) - return retval; - return 0; + return fasync_helper(fd, file, on, &video->fasync); } static ssize_t dv1394_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) @@ -1793,12 +1789,13 @@ static int dv1394_open(struct inode *inode, struct file *file) } else { /* look up the card by ID */ unsigned long flags; + int idx = ieee1394_file_to_instance(file); spin_lock_irqsave(&dv1394_cards_lock, flags); if (!list_empty(&dv1394_cards)) { struct video_card *p; list_for_each_entry(p, &dv1394_cards, list) { - if ((p->id) == ieee1394_file_to_instance(file)) { + if ((p->id) == idx) { video = p; break; } @@ -1807,7 +1804,7 @@ static int dv1394_open(struct inode *inode, struct file *file) spin_unlock_irqrestore(&dv1394_cards_lock, flags); if (!video) { - debug_printk("dv1394: OHCI card %d not found", ieee1394_file_to_instance(file)); + debug_printk("dv1394: OHCI card %d not found", idx); return -ENODEV; } diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 4ca103577c0a..f5c586c2bba6 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -361,7 +361,7 @@ static int eth1394_new_node(struct eth1394_host_info *hi, node_info->pdg.sz = 0; node_info->fifo = CSR1212_INVALID_ADDR_SPACE; - ud->device.driver_data = node_info; + dev_set_drvdata(&ud->device, node_info); new_node->ud = ud; priv = netdev_priv(hi->dev); @@ -406,7 +406,7 @@ static int eth1394_remove(struct device *dev) list_del(&old_node->list); kfree(old_node); - node_info = (struct eth1394_node_info*)ud->device.driver_data; + node_info = dev_get_drvdata(&ud->device); spin_lock_irqsave(&node_info->pdg.lock, flags); /* The partial datagram list should be empty, but we'll just @@ -416,7 +416,7 @@ static int eth1394_remove(struct device *dev) spin_unlock_irqrestore(&node_info->pdg.lock, flags); kfree(node_info); - ud->device.driver_data = NULL; + dev_set_drvdata(&ud->device, NULL); return 0; } @@ -688,7 +688,7 @@ static void ether1394_host_reset(struct hpsb_host *host) ether1394_reset_priv(dev, 0); list_for_each_entry(node, &priv->ip_node_list, list) { - node_info = node->ud->device.driver_data; + node_info = dev_get_drvdata(&node->ud->device); spin_lock_irqsave(&node_info->pdg.lock, flags); @@ -872,8 +872,7 @@ static __be16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev, if (!node) return cpu_to_be16(0); - node_info = - (struct eth1394_node_info *)node->ud->device.driver_data; + node_info = dev_get_drvdata(&node->ud->device); /* Update our speed/payload/fifo_offset table */ node_info->maxpayload = maxpayload; @@ -1080,7 +1079,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid, priv->ud_list[NODEID_TO_NODE(srcid)] = ud; } - node_info = (struct eth1394_node_info *)ud->device.driver_data; + node_info = dev_get_drvdata(&ud->device); /* First, did we receive a fragmented or unfragmented datagram? */ hdr->words.word1 = ntohs(hdr->words.word1); @@ -1617,8 +1616,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) if (!node) goto fail; - node_info = - (struct eth1394_node_info *)node->ud->device.driver_data; + node_info = dev_get_drvdata(&node->ud->device); if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) goto fail; diff --git a/drivers/ieee1394/ieee1394_core.h b/drivers/ieee1394/ieee1394_core.h index 21d50f73a210..28b9f58bafd2 100644 --- a/drivers/ieee1394/ieee1394_core.h +++ b/drivers/ieee1394/ieee1394_core.h @@ -5,6 +5,7 @@ #include <linux/fs.h> #include <linux/list.h> #include <linux/types.h> +#include <linux/cdev.h> #include <asm/atomic.h> #include "hosts.h" @@ -155,7 +156,10 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size, */ static inline unsigned char ieee1394_file_to_instance(struct file *file) { - return file->f_path.dentry->d_inode->i_cindex; + int idx = cdev_index(file->f_path.dentry->d_inode); + if (idx < 0) + idx = 0; + return idx; } extern int hpsb_disable_irm; diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index a6d55bebe61a..5122b5a8aa2d 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -10,6 +10,7 @@ #include <linux/bitmap.h> #include <linux/kernel.h> +#include <linux/kmemcheck.h> #include <linux/list.h> #include <linux/slab.h> #include <linux/delay.h> @@ -39,7 +40,10 @@ struct nodemgr_csr_info { struct hpsb_host *host; nodeid_t nodeid; unsigned int generation; + + kmemcheck_bitfield_begin(flags); unsigned int speed_unverified:1; + kmemcheck_bitfield_end(flags); }; @@ -1293,6 +1297,7 @@ static void nodemgr_node_scan_one(struct hpsb_host *host, u8 *speed; ci = kmalloc(sizeof(*ci), GFP_KERNEL); + kmemcheck_annotate_bitfield(ci, flags); if (!ci) return; diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c index 38f712036201..9555fd253865 100644 --- a/drivers/ieee1394/pcilynx.c +++ b/drivers/ieee1394/pcilynx.c @@ -1171,7 +1171,7 @@ static int __devinit add_card(struct pci_dev *dev, error = -ENXIO; - if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) + if (pci_set_dma_mask(dev, DMA_BIT_MASK(32))) FAIL("DMA address limits not supported for PCILynx hardware"); if (pci_enable_device(dev)) FAIL("failed to enable PCILynx hardware"); diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index f599f4934739..52b25f8b111d 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -718,7 +718,7 @@ static int sbp2_remove(struct device *dev) struct scsi_device *sdev; ud = container_of(dev, struct unit_directory, device); - lu = ud->device.driver_data; + lu = dev_get_drvdata(&ud->device); if (!lu) return 0; @@ -746,7 +746,7 @@ static int sbp2_remove(struct device *dev) static int sbp2_update(struct unit_directory *ud) { - struct sbp2_lu *lu = ud->device.driver_data; + struct sbp2_lu *lu = dev_get_drvdata(&ud->device); if (sbp2_reconnect_device(lu) != 0) { /* @@ -815,7 +815,7 @@ static struct sbp2_lu *sbp2_alloc_device(struct unit_directory *ud) atomic_set(&lu->state, SBP2LU_STATE_RUNNING); INIT_WORK(&lu->protocol_work, NULL); - ud->device.driver_data = lu; + dev_set_drvdata(&ud->device, lu); hi = hpsb_get_hostinfo(&sbp2_highlevel, ud->ne->host); if (!hi) { @@ -1052,7 +1052,7 @@ static void sbp2_remove_device(struct sbp2_lu *lu) hpsb_unregister_addrspace(&sbp2_highlevel, hi->host, lu->status_fifo_addr); - lu->ud->device.driver_data = NULL; + dev_set_drvdata(&lu->ud->device, NULL); module_put(hi->host->driver->owner); no_hi: |