Commit dbdc3bfe authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] misc drivers/atm iomem annotations and NULL noise removal

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4dfc0d48
...@@ -245,7 +245,7 @@ static void __iomem *eni_alloc_mem(struct eni_dev *eni_dev, unsigned long *size) ...@@ -245,7 +245,7 @@ static void __iomem *eni_alloc_mem(struct eni_dev *eni_dev, unsigned long *size)
list = eni_dev->free_list; list = eni_dev->free_list;
len = eni_dev->free_len; len = eni_dev->free_len;
if (*size < MID_MIN_BUF_SIZE) *size = MID_MIN_BUF_SIZE; if (*size < MID_MIN_BUF_SIZE) *size = MID_MIN_BUF_SIZE;
if (*size > MID_MAX_BUF_SIZE) return 0; if (*size > MID_MAX_BUF_SIZE) return NULL;
for (order = 0; (1 << order) < *size; order++); for (order = 0; (1 << order) < *size; order++);
DPRINTK("trying: %ld->%d\n",*size,order); DPRINTK("trying: %ld->%d\n",*size,order);
best_order = 65; /* we don't have more than 2^64 of anything ... */ best_order = 65; /* we don't have more than 2^64 of anything ... */
...@@ -260,7 +260,7 @@ static void __iomem *eni_alloc_mem(struct eni_dev *eni_dev, unsigned long *size) ...@@ -260,7 +260,7 @@ static void __iomem *eni_alloc_mem(struct eni_dev *eni_dev, unsigned long *size)
best_order = list[i].order; best_order = list[i].order;
index = i; index = i;
} }
if (best_order == 65) return 0; if (best_order == 65) return NULL;
start = list[index].start-eni_dev->base_diff; start = list[index].start-eni_dev->base_diff;
list[index] = list[--len]; list[index] = list[--len];
eni_dev->free_len = len; eni_dev->free_len = len;
...@@ -1315,7 +1315,7 @@ static int reserve_or_set_tx(struct atm_vcc *vcc,struct atm_trafprm *txtp, ...@@ -1315,7 +1315,7 @@ static int reserve_or_set_tx(struct atm_vcc *vcc,struct atm_trafprm *txtp,
size = UBR_BUFFER; size = UBR_BUFFER;
} }
new_tx = !eni_vcc->tx; new_tx = !eni_vcc->tx;
mem = 0; /* for gcc */ mem = NULL; /* for gcc */
if (!new_tx) tx = eni_vcc->tx; if (!new_tx) tx = eni_vcc->tx;
else { else {
mem = eni_alloc_mem(eni_dev,&size); mem = eni_alloc_mem(eni_dev,&size);
...@@ -1349,7 +1349,7 @@ static int reserve_or_set_tx(struct atm_vcc *vcc,struct atm_trafprm *txtp, ...@@ -1349,7 +1349,7 @@ static int reserve_or_set_tx(struct atm_vcc *vcc,struct atm_trafprm *txtp,
error = -EINVAL; error = -EINVAL;
if (error) { if (error) {
if (new_tx) { if (new_tx) {
tx->send = 0; tx->send = NULL;
eni_free_mem(eni_dev,mem,size); eni_free_mem(eni_dev,mem,size);
} }
return error; return error;
...@@ -1423,7 +1423,7 @@ static void close_tx(struct atm_vcc *vcc) ...@@ -1423,7 +1423,7 @@ static void close_tx(struct atm_vcc *vcc)
eni_in(MID_TX_DESCRSTART(eni_vcc->tx->index))) eni_in(MID_TX_DESCRSTART(eni_vcc->tx->index)))
schedule(); schedule();
eni_free_mem(eni_dev,eni_vcc->tx->send,eni_vcc->tx->words << 2); eni_free_mem(eni_dev,eni_vcc->tx->send,eni_vcc->tx->words << 2);
eni_vcc->tx->send = 0; eni_vcc->tx->send = NULL;
eni_dev->tx_bw += eni_vcc->tx->reserved; eni_dev->tx_bw += eni_vcc->tx->reserved;
} }
eni_vcc->tx = NULL; eni_vcc->tx = NULL;
...@@ -1444,7 +1444,7 @@ static int start_tx(struct atm_dev *dev) ...@@ -1444,7 +1444,7 @@ static int start_tx(struct atm_dev *dev)
skb_queue_head_init(&eni_dev->tx_queue); skb_queue_head_init(&eni_dev->tx_queue);
eni_out(0,MID_DMA_WR_TX); eni_out(0,MID_DMA_WR_TX);
for (i = 0; i < NR_CHAN; i++) { for (i = 0; i < NR_CHAN; i++) {
eni_dev->tx[i].send = 0; eni_dev->tx[i].send = NULL;
eni_dev->tx[i].index = i; eni_dev->tx[i].index = i;
} }
return 0; return 0;
...@@ -1702,7 +1702,7 @@ static int __devinit get_esi_fpga(struct atm_dev *dev, void __iomem *base) ...@@ -1702,7 +1702,7 @@ static int __devinit get_esi_fpga(struct atm_dev *dev, void __iomem *base)
static int __devinit eni_do_init(struct atm_dev *dev) static int __devinit eni_do_init(struct atm_dev *dev)
{ {
struct midway_eprom *eprom; struct midway_eprom __iomem *eprom;
struct eni_dev *eni_dev; struct eni_dev *eni_dev;
struct pci_dev *pci_dev; struct pci_dev *pci_dev;
unsigned long real_base; unsigned long real_base;
...@@ -1742,8 +1742,7 @@ static int __devinit eni_do_init(struct atm_dev *dev) ...@@ -1742,8 +1742,7 @@ static int __devinit eni_do_init(struct atm_dev *dev)
eni_dev->base_diff = real_base - (unsigned long) base; eni_dev->base_diff = real_base - (unsigned long) base;
/* id may not be present in ASIC Tonga boards - check this @@@ */ /* id may not be present in ASIC Tonga boards - check this @@@ */
if (!eni_dev->asic) { if (!eni_dev->asic) {
eprom = (struct midway_eprom *) (base+EPROM_SIZE-sizeof(struct eprom = (base+EPROM_SIZE-sizeof(struct midway_eprom));
midway_eprom));
if (readl(&eprom->magic) != ENI155_MAGIC) { if (readl(&eprom->magic) != ENI155_MAGIC) {
printk("\n"); printk("\n");
printk(KERN_ERR KERN_ERR DEV_LABEL "(itf %d): bad " printk(KERN_ERR KERN_ERR DEV_LABEL "(itf %d): bad "
......
...@@ -1701,7 +1701,7 @@ he_stop(struct he_dev *he_dev) ...@@ -1701,7 +1701,7 @@ he_stop(struct he_dev *he_dev)
} }
if (he_dev->membase) if (he_dev->membase)
iounmap((void *) he_dev->membase); iounmap(he_dev->membase);
} }
static struct he_tpd * static struct he_tpd *
......
...@@ -3169,7 +3169,7 @@ deinit_card(struct idt77252_dev *card) ...@@ -3169,7 +3169,7 @@ deinit_card(struct idt77252_dev *card)
} }
if (card->membase) if (card->membase)
iounmap((void *) card->membase); iounmap(card->membase);
clear_bit(IDT77252_BIT_INIT, &card->flags); clear_bit(IDT77252_BIT_INIT, &card->flags);
DIPRINTK("%s: Card deinitialized.\n", card->name); DIPRINTK("%s: Card deinitialized.\n", card->name);
...@@ -3803,7 +3803,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) ...@@ -3803,7 +3803,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
deinit_card(card); deinit_card(card);
err_out_iounmap: err_out_iounmap:
iounmap((void *) card->membase); iounmap(card->membase);
err_out_free_card: err_out_free_card:
kfree(card); kfree(card);
......
...@@ -1481,7 +1481,7 @@ static inline struct lanai_vcc *new_lanai_vcc(void) ...@@ -1481,7 +1481,7 @@ static inline struct lanai_vcc *new_lanai_vcc(void)
struct lanai_vcc *lvcc; struct lanai_vcc *lvcc;
lvcc = (struct lanai_vcc *) kmalloc(sizeof(*lvcc), GFP_KERNEL); lvcc = (struct lanai_vcc *) kmalloc(sizeof(*lvcc), GFP_KERNEL);
if (likely(lvcc != NULL)) { if (likely(lvcc != NULL)) {
lvcc->vbase = 0; lvcc->vbase = NULL;
lvcc->rx.atmvcc = lvcc->tx.atmvcc = NULL; lvcc->rx.atmvcc = lvcc->tx.atmvcc = NULL;
lvcc->nref = 0; lvcc->nref = 0;
memset(&lvcc->stats, 0, sizeof lvcc->stats); memset(&lvcc->stats, 0, sizeof lvcc->stats);
...@@ -1565,7 +1565,7 @@ static inline void host_vcc_unbind(struct lanai_dev *lanai, ...@@ -1565,7 +1565,7 @@ static inline void host_vcc_unbind(struct lanai_dev *lanai,
if (lvcc->vbase == 0) if (lvcc->vbase == 0)
return; /* This vcc was never bound */ return; /* This vcc was never bound */
DPRINTK("Unbinding vci %d\n", lvcc->vci); DPRINTK("Unbinding vci %d\n", lvcc->vci);
lvcc->vbase = 0; lvcc->vbase = NULL;
lanai->vccs[lvcc->vci] = NULL; lanai->vccs[lvcc->vci] = NULL;
#ifdef USE_POWERDOWN #ifdef USE_POWERDOWN
if (--lanai->nbound == 0) { if (--lanai->nbound == 0) {
...@@ -2279,7 +2279,7 @@ static int __init lanai_dev_open(struct atm_dev *atmdev) ...@@ -2279,7 +2279,7 @@ static int __init lanai_dev_open(struct atm_dev *atmdev)
lanai->conf1 = reg_read(lanai, Config1_Reg) | CONFIG1_POWERDOWN; lanai->conf1 = reg_read(lanai, Config1_Reg) | CONFIG1_POWERDOWN;
conf1_write(lanai); conf1_write(lanai);
#endif #endif
iounmap((void *) lanai->base); iounmap(lanai->base);
error_pci: error_pci:
pci_disable_device(lanai->pci); pci_disable_device(lanai->pci);
error: error:
...@@ -2309,7 +2309,7 @@ static void lanai_dev_close(struct atm_dev *atmdev) ...@@ -2309,7 +2309,7 @@ static void lanai_dev_close(struct atm_dev *atmdev)
pci_disable_device(lanai->pci); pci_disable_device(lanai->pci);
vcc_table_deallocate(lanai); vcc_table_deallocate(lanai);
service_buffer_deallocate(lanai); service_buffer_deallocate(lanai);
iounmap((void *) lanai->base); iounmap(lanai->base);
kfree(lanai); kfree(lanai);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment