From 49f19ce401edfff937c448dd74c22497da361889 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Thu, 5 Oct 2006 20:31:10 -0500 Subject: [PATCH] powerpc: irq change build breaks Fix up some of the buildbreaks from the irq handler changes. Signed-off-by: Olof Johansson Signed-off-by: Linus Torvalds --- drivers/macintosh/via-cuda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index 64a07ccfe36..df66291b132 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c @@ -437,7 +437,7 @@ cuda_poll(void) * disable_irq(), would that work on m68k ? --BenH */ local_irq_save(flags); - cuda_interrupt(0, NULL, NULL); + cuda_interrupt(0, NULL); local_irq_restore(flags); } -- cgit v1.2.3 From d83682b3971d6707d6d668b3b62d416ab7dd1ab3 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Fri, 6 Oct 2006 16:38:22 +0200 Subject: [S390] ap bus poll thread priority. The ap bus is supposed to have a low priority. We must use 19 instead of -20, which is just the opposite. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- drivers/s390/crypto/ap_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index cd30f37fcea..c5ccd20b110 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -1062,7 +1062,7 @@ static int ap_poll_thread(void *data) unsigned long flags; int requests; - set_user_nice(current, -20); + set_user_nice(current, 19); while (1) { if (need_resched()) { schedule(); -- cgit v1.2.3 From 2d103d5a80846e96e1cb1ba5e635e8c37d30ada8 Mon Sep 17 00:00:00 2001 From: Melissa Howland Date: Fri, 6 Oct 2006 16:38:26 +0200 Subject: [S390] monwriter buffer limit. Make max_bufs a global (per linux guest) limit. Signed-off-by: Melissa Howland Signed-off-by: Martin Schwidefsky --- drivers/s390/char/monwriter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c index 1e3939aeb8a..4362ff26024 100644 --- a/drivers/s390/char/monwriter.c +++ b/drivers/s390/char/monwriter.c @@ -26,6 +26,7 @@ #define MONWRITE_MAX_DATALEN 4024 static int mon_max_bufs = 255; +static int mon_buf_count; struct mon_buf { struct list_head list; @@ -40,7 +41,6 @@ struct mon_private { size_t hdr_to_read; size_t data_to_read; struct mon_buf *current_buf; - int mon_buf_count; }; /* @@ -99,13 +99,13 @@ static int monwrite_new_hdr(struct mon_private *monpriv) rc = monwrite_diag(monhdr, monbuf->data, APPLDATA_STOP_REC); list_del(&monbuf->list); - monpriv->mon_buf_count--; + mon_buf_count--; kfree(monbuf->data); kfree(monbuf); monbuf = NULL; } } else { - if (monpriv->mon_buf_count >= mon_max_bufs) + if (mon_buf_count >= mon_max_bufs) return -ENOSPC; monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL); if (!monbuf) @@ -118,7 +118,7 @@ static int monwrite_new_hdr(struct mon_private *monpriv) } monbuf->hdr = *monhdr; list_add_tail(&monbuf->list, &monpriv->list); - monpriv->mon_buf_count++; + mon_buf_count++; } monpriv->current_buf = monbuf; return 0; @@ -186,7 +186,7 @@ static int monwrite_close(struct inode *inode, struct file *filp) if (entry->hdr.mon_function != MONWRITE_GEN_EVENT) monwrite_diag(&entry->hdr, entry->data, APPLDATA_STOP_REC); - monpriv->mon_buf_count--; + mon_buf_count--; list_del(&entry->list); kfree(entry->data); kfree(entry); -- cgit v1.2.3 From 7e8ae7bfe8354b1f1b98c5cd29db8965ca1e6391 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Fri, 6 Oct 2006 16:38:29 +0200 Subject: [S390] cio: 0 is a valid chpid. In order to determine chpid validity, we need to check whether the corresponding path is specified in the pim. Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/chsc.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 3bb4e472d73..07c7f19339d 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -200,11 +200,13 @@ css_get_ssd_info(struct subchannel *sch) spin_unlock_irq(&sch->lock); free_page((unsigned long)page); if (!ret) { - int j, chpid; + int j, chpid, mask; /* Allocate channel path structures, if needed. */ for (j = 0; j < 8; j++) { + mask = 0x80 >> j; chpid = sch->ssd_info.chpid[j]; - if (chpid && (get_chp_status(chpid) < 0)) + if ((sch->schib.pmcw.pim & mask) && + (get_chp_status(chpid) < 0)) new_channel_path(chpid); } } @@ -222,13 +224,15 @@ s390_subchannel_remove_chpid(struct device *dev, void *data) sch = to_subchannel(dev); chpid = data; - for (j = 0; j < 8; j++) - if (sch->schib.pmcw.chpid[j] == chpid->id) + for (j = 0; j < 8; j++) { + mask = 0x80 >> j; + if ((sch->schib.pmcw.pim & mask) && + (sch->schib.pmcw.chpid[j] == chpid->id)) break; + } if (j >= 8) return 0; - mask = 0x80 >> j; spin_lock_irq(&sch->lock); stsch(sch->schid, &schib); @@ -620,7 +624,7 @@ __chp_add_new_sch(struct subchannel_id schid) static int __chp_add(struct subchannel_id schid, void *data) { - int i; + int i, mask; struct channel_path *chp; struct subchannel *sch; @@ -630,8 +634,10 @@ __chp_add(struct subchannel_id schid, void *data) /* Check if the subchannel is now available. */ return __chp_add_new_sch(schid); spin_lock_irq(&sch->lock); - for (i=0; i<8; i++) - if (sch->schib.pmcw.chpid[i] == chp->id) { + for (i=0; i<8; i++) { + mask = 0x80 >> i; + if ((sch->schib.pmcw.pim & mask) && + (sch->schib.pmcw.chpid[i] == chp->id)) { if (stsch(sch->schid, &sch->schib) != 0) { /* Endgame. */ spin_unlock_irq(&sch->lock); @@ -639,6 +645,7 @@ __chp_add(struct subchannel_id schid, void *data) } break; } + } if (i==8) { spin_unlock_irq(&sch->lock); return 0; @@ -646,7 +653,7 @@ __chp_add(struct subchannel_id schid, void *data) sch->lpm = ((sch->schib.pmcw.pim & sch->schib.pmcw.pam & sch->schib.pmcw.pom) - | 0x80 >> i) & sch->opm; + | mask) & sch->opm; if (sch->driver && sch->driver->verify) sch->driver->verify(&sch->dev); -- cgit v1.2.3 From 5a489b9846f688db7e69aa7ccb23c53459a9c20e Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Fri, 6 Oct 2006 16:38:35 +0200 Subject: [S390] irq change build fixes. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- drivers/s390/block/dasd_diag.c | 2 +- drivers/s390/char/ctrlchar.c | 2 +- drivers/s390/char/keyboard.c | 2 +- drivers/s390/char/sclp.c | 4 ++-- drivers/s390/cio/cio.c | 6 +++++- drivers/s390/net/iucv.c | 4 ++-- 6 files changed, 12 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 222a8a71a5e..53db58a6861 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -218,7 +218,7 @@ dasd_diag_term_IO(struct dasd_ccw_req * cqr) /* Handle external interruption. */ static void -dasd_ext_handler(struct pt_regs *regs, __u16 code) +dasd_ext_handler(__u16 code) { struct dasd_ccw_req *cqr, *next; struct dasd_device *device; diff --git a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c index d83eb6358ba..49e9628d929 100644 --- a/drivers/s390/char/ctrlchar.c +++ b/drivers/s390/char/ctrlchar.c @@ -20,7 +20,7 @@ static int ctrlchar_sysrq_key; static void ctrlchar_handle_sysrq(void *tty) { - handle_sysrq(ctrlchar_sysrq_key, NULL, (struct tty_struct *) tty); + handle_sysrq(ctrlchar_sysrq_key, (struct tty_struct *) tty); } static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL); diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index 3be06569180..e3491a5f521 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c @@ -304,7 +304,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode) if (kbd->sysrq) { if (kbd->sysrq == K(KT_LATIN, '-')) { kbd->sysrq = 0; - handle_sysrq(value, NULL, kbd->tty); + handle_sysrq(value, kbd->tty); return; } if (value == '-') { diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index 31e335751d6..8a056df09d6 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c @@ -324,7 +324,7 @@ __sclp_find_req(u32 sccb) * Prepare read event data request if necessary. Start processing of next * request on queue. */ static void -sclp_interrupt_handler(struct pt_regs *regs, __u16 code) +sclp_interrupt_handler(__u16 code) { struct sclp_req *req; u32 finished_sccb; @@ -743,7 +743,7 @@ EXPORT_SYMBOL(sclp_reactivate); /* Handler for external interruption used during initialization. Modify * request state to done. */ static void -sclp_check_handler(struct pt_regs *regs, __u16 code) +sclp_check_handler(__u16 code) { u32 finished_sccb; diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 2e2882daefb..f18b1623cad 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "airq.h" #include "cio.h" @@ -606,15 +607,17 @@ do_IRQ (struct pt_regs *regs) struct tpi_info *tpi_info; struct subchannel *sch; struct irb *irb; + struct pt_regs *old_regs; irq_enter (); + old_regs = set_irq_regs(regs); asm volatile ("mc 0,0"); if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer) /** * Make sure that the i/o interrupt did not "overtake" * the last HZ timer interrupt. */ - account_ticks(regs); + account_ticks(); /* * Get interrupt information from lowcore */ @@ -652,6 +655,7 @@ do_IRQ (struct pt_regs *regs) * out of the sie which costs more cycles than it saves. */ } while (!MACHINE_IS_VM && tpi (NULL) != 0); + set_irq_regs(old_regs); irq_exit (); } diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c index 809dd8d7f47..1476ce2b437 100644 --- a/drivers/s390/net/iucv.c +++ b/drivers/s390/net/iucv.c @@ -116,7 +116,7 @@ static DEFINE_SPINLOCK(iucv_irq_queue_lock); *Internal function prototypes */ static void iucv_tasklet_handler(unsigned long); -static void iucv_irq_handler(struct pt_regs *, __u16); +static void iucv_irq_handler(__u16); static DECLARE_TASKLET(iucv_tasklet,iucv_tasklet_handler,0); @@ -2251,7 +2251,7 @@ iucv_sever(__u16 pathid, __u8 user_data[16]) * Places the interrupt buffer on a queue and schedules iucv_tasklet_handler(). */ static void -iucv_irq_handler(struct pt_regs *regs, __u16 code) +iucv_irq_handler(__u16 code) { iucv_irqdata *irqdata; -- cgit v1.2.3 From 2033b0c330d50d3f1cccd207147a10ad7f4f47f8 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Fri, 6 Oct 2006 16:38:42 +0200 Subject: [PATCH] sysrq: irq change build fix. drivers/char/sysrq.c: In function `sysrq_handle_crashdump': drivers/char/sysrq.c:98: warning: implicit declaration of function `get_irq_regs' Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- drivers/char/sysrq.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 4c0e0868570..5f49280779f 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -38,6 +38,7 @@ #include #include +#include /* Whether we react on sysrq keys or just ignore them */ int sysrq_enabled = 1; -- cgit v1.2.3 From da66b719d16f6ea3801b859c1ff35d5cd05c517d Mon Sep 17 00:00:00 2001 From: David Brownell Date: Fri, 6 Oct 2006 00:43:51 -0700 Subject: [PATCH] ohci: don't play with IRQ regs This is a more correct fix for the way the ohci hcd was referencing pt_regs in the unlink paths. Signed-off-by: David Brownell Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/usb/host/ohci-q.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index e08d1a2664e..fe1fe2f97cb 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c @@ -925,7 +925,7 @@ rescan_all: /* only take off EDs that the HC isn't using, accounting for * frame counter wraps and EDs with partially retired TDs */ - if (likely (get_irq_regs() && HC_IS_RUNNING(ohci_to_hcd(ohci)->state))) { + if (likely (HC_IS_RUNNING(ohci_to_hcd(ohci)->state))) { if (tick_before (tick, ed->tick)) { skip_ed: last = &ed->ed_next; -- cgit v1.2.3 From 45e02b5b52e43aa7a674f64ca3470b9ee51fc9fd Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Fri, 6 Oct 2006 00:44:02 -0700 Subject: [PATCH] swarm: Actually initialize the IDE driver This is required for the SWARM GenBus IDE interface to be recognized. Signed-off-by: Maciej W. Rozycki Cc: Ralf Baechle Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/ide/mips/swarm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c index 66f6064f464..09c9e7936b0 100644 --- a/drivers/ide/mips/swarm.c +++ b/drivers/ide/mips/swarm.c @@ -4,6 +4,7 @@ * Author: Manish Lachwani, mlachwani@mvista.com * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved. * Author: Maciej W. Rozycki + * Copyright (c) 2006 Maciej W. Rozycki * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -127,6 +128,7 @@ static int __devinit swarm_ide_probe(struct device *dev) memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); hwif->irq = hwif->hw.irq; + probe_hwif_init(hwif); dev_set_drvdata(dev, hwif); return 0; -- cgit v1.2.3 From ec5a19dd935eb3793e1f6ed491e8035b3d7b1df9 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 6 Oct 2006 00:44:03 -0700 Subject: [PATCH] mmc: multi sector write transfers SD cards extend the protocol by allowing the host to query a card how many blocks were successfully stored on the medium. This allows us to safely write chunks of blocks at once. Signed-off-by: Pierre Ossman Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mmc/mmc_block.c | 104 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 95 insertions(+), 9 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index c1293f1bda8..f9027c8db79 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -154,6 +155,71 @@ static int mmc_blk_prep_rq(struct mmc_queue *mq, struct request *req) return stat; } +static u32 mmc_sd_num_wr_blocks(struct mmc_card *card) +{ + int err; + u32 blocks; + + struct mmc_request mrq; + struct mmc_command cmd; + struct mmc_data data; + unsigned int timeout_us; + + struct scatterlist sg; + + memset(&cmd, 0, sizeof(struct mmc_command)); + + cmd.opcode = MMC_APP_CMD; + cmd.arg = card->rca << 16; + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; + + err = mmc_wait_for_cmd(card->host, &cmd, 0); + if ((err != MMC_ERR_NONE) || !(cmd.resp[0] & R1_APP_CMD)) + return (u32)-1; + + memset(&cmd, 0, sizeof(struct mmc_command)); + + cmd.opcode = SD_APP_SEND_NUM_WR_BLKS; + cmd.arg = 0; + cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC; + + memset(&data, 0, sizeof(struct mmc_data)); + + data.timeout_ns = card->csd.tacc_ns * 100; + data.timeout_clks = card->csd.tacc_clks * 100; + + timeout_us = data.timeout_ns / 1000; + timeout_us += data.timeout_clks * 1000 / + (card->host->ios.clock / 1000); + + if (timeout_us > 100000) { + data.timeout_ns = 100000000; + data.timeout_clks = 0; + } + + data.blksz = 4; + data.blocks = 1; + data.flags = MMC_DATA_READ; + data.sg = &sg; + data.sg_len = 1; + + memset(&mrq, 0, sizeof(struct mmc_request)); + + mrq.cmd = &cmd; + mrq.data = &data; + + sg_init_one(&sg, &blocks, 4); + + mmc_wait_for_req(card->host, &mrq); + + if (cmd.error != MMC_ERR_NONE || data.error != MMC_ERR_NONE) + return (u32)-1; + + blocks = ntohl(blocks); + + return blocks; +} + static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) { struct mmc_blk_data *md = mq->data; @@ -184,10 +250,13 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) /* * If the host doesn't support multiple block writes, force - * block writes to single block. + * block writes to single block. SD cards are excepted from + * this rule as they support querying the number of + * successfully written sectors. */ if (rq_data_dir(req) != READ && - !(card->host->caps & MMC_CAP_MULTIWRITE)) + !(card->host->caps & MMC_CAP_MULTIWRITE) && + !mmc_card_sd(card)) brq.data.blocks = 1; if (brq.data.blocks > 1) { @@ -276,24 +345,41 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) return 1; cmd_err: - mmc_card_release_host(card); - ret = 1; - /* - * For writes and where the host claims to support proper - * error reporting, we first ok the successful blocks. + /* + * If this is an SD card and we're writing, we can first + * mark the known good sectors as ok. + * + * If the card is not SD, we can still ok written sectors + * if the controller can do proper error reporting. * * For reads we just fail the entire chunk as that should * be safe in all cases. */ - if (rq_data_dir(req) != READ && - (card->host->caps & MMC_CAP_MULTIWRITE)) { + if (rq_data_dir(req) != READ && mmc_card_sd(card)) { + u32 blocks; + unsigned int bytes; + + blocks = mmc_sd_num_wr_blocks(card); + if (blocks != (u32)-1) { + if (card->csd.write_partial) + bytes = blocks << md->block_bits; + else + bytes = blocks << 9; + spin_lock_irq(&md->lock); + ret = end_that_request_chunk(req, 1, bytes); + spin_unlock_irq(&md->lock); + } + } else if (rq_data_dir(req) != READ && + (card->host->caps & MMC_CAP_MULTIWRITE)) { spin_lock_irq(&md->lock); ret = end_that_request_chunk(req, 1, brq.data.bytes_xfered); spin_unlock_irq(&md->lock); } + mmc_card_release_host(card); + spin_lock_irq(&md->lock); while (ret) { ret = end_that_request_chunk(req, 0, -- cgit v1.2.3 From 5842730de179405d80649231faa0b3f254477434 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 6 Oct 2006 00:44:04 -0700 Subject: [PATCH] md: fix bug where new drives added to an md array sometimes don't sync properly This fixes a bug introduced in 2.6.18. If a drive is added to a raid1 using older tools (mdadm-1.x or raidtools) then it will be included in the array without any resync happening. It has been submitted for 2.6.18.1. Signed-off-by: Neil Brown Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/md.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/md/md.c b/drivers/md/md.c index cb8281605be..57fa64f93e5 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -3849,6 +3849,7 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev) } clear_bit(In_sync, &rdev->flags); rdev->desc_nr = -1; + rdev->saved_raid_disk = -1; err = bind_rdev_to_array(rdev, mddev); if (err) goto abort_export; -- cgit v1.2.3 From 8c1addbc752660e95bbf2128d66b8e5bb38d5fc7 Mon Sep 17 00:00:00 2001 From: Tony Luck Date: Fri, 6 Oct 2006 10:09:41 -0700 Subject: [IA64] Fix breakage from irq change A few missed spots in ia64-land from this gigantic commit: 7d12e780e003f93433d49ce78cfedf4b4c52adc5 Signed-off-by: Tony Luck --- drivers/serial/sn_console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 709f93a6c18..956b2cf08e1 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c @@ -674,7 +674,7 @@ static void sn_sal_timer_poll(unsigned long data) if (!port->sc_port.irq) { spin_lock_irqsave(&port->sc_port.lock, flags); if (sn_process_input) - sn_receive_chars(port, NULL, flags); + sn_receive_chars(port, flags); sn_transmit_chars(port, TRANSMIT_RAW); spin_unlock_irqrestore(&port->sc_port.lock, flags); mod_timer(&port->sc_timer, -- cgit v1.2.3 From c31f28e778ab299a5035ea2bda64f245b8915d7c Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 14:56:04 -0400 Subject: drivers/net: eliminate irq handler impossible checks, needless casts - Eliminate check for irq handler 'dev_id==NULL' where the condition never occurs. - Eliminate needless casts to/from void* Signed-off-by: Jeff Garzik --- drivers/net/3c509.c | 7 +------ drivers/net/3c523.c | 7 ++----- drivers/net/3c527.c | 5 ----- drivers/net/8390.c | 8 +------- drivers/net/atp.c | 6 +----- drivers/net/de600.c | 6 ------ drivers/net/declance.c | 4 ++-- drivers/net/dgrs.c | 4 ++-- drivers/net/eepro.c | 8 +------- drivers/net/eexpress.c | 7 ------- drivers/net/irda/ali-ircc.c | 10 ++-------- drivers/net/irda/donauboe.c | 11 +---------- drivers/net/irda/irport.c | 8 ++------ drivers/net/irda/irport.h | 2 +- drivers/net/irda/nsc-ircc.c | 9 ++------- drivers/net/irda/w83977af_ir.c | 9 ++------- drivers/net/lance.c | 5 ----- drivers/net/pcmcia/axnet_cs.c | 8 +------- drivers/net/pcnet32.c | 7 ------- drivers/net/plip.c | 5 ----- drivers/net/saa9730.c | 2 +- drivers/net/sb1000.c | 8 +------- drivers/net/skfp/skfddi.c | 7 +------ drivers/net/sonic.c | 7 +------ drivers/net/sunhme.c | 4 ++-- drivers/net/sunlance.c | 2 +- drivers/net/sunqe.c | 2 +- drivers/net/tokenring/smctr.c | 7 ------- drivers/net/tokenring/tms380tr.c | 5 ----- drivers/net/tulip/de4x5.c | 6 +----- drivers/net/wan/cycx_main.c | 4 ++-- drivers/net/wan/sdla.c | 8 +------- drivers/net/wireless/orinoco.c | 2 +- drivers/net/wireless/wavelan_cs.c | 11 +---------- drivers/net/wireless/wl3501_cs.c | 15 ++++----------- drivers/net/yellowfin.c | 7 ------- drivers/net/znet.c | 5 ----- 37 files changed, 39 insertions(+), 199 deletions(-) (limited to 'drivers') diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 7ad0a54779c..f791bf026e5 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -912,16 +912,11 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev) static irqreturn_t el3_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct el3_private *lp; int ioaddr, status; int i = max_interrupt_work; - if (dev == NULL) { - printk ("el3_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - lp = netdev_priv(dev); spin_lock(&lp->lock); diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 1c97271112d..91849469b4f 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c @@ -902,14 +902,11 @@ static void *alloc_rfa(struct net_device *dev, void *ptr) static irqreturn_t elmc_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; unsigned short stat; struct priv *p; - if (dev == NULL) { - printk(KERN_ERR "elmc-interrupt: irq %d for unknown device.\n", irq); - return IRQ_NONE; - } else if (!netif_running(dev)) { + if (!netif_running(dev)) { /* The 3c523 has this habit of generating interrupts during the reset. I'm not sure if the ni52 has this same problem, but it's really annoying if we haven't finished initializing it. I was diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index d516c3225ca..f4aca5386ad 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c @@ -1324,11 +1324,6 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id) int rx_event = 0; int tx_event = 0; - if (dev == NULL) { - printk(KERN_WARNING "%s: irq %d for unknown device.\n", cardname, irq); - return IRQ_NONE; - } - ioaddr = dev->base_addr; lp = netdev_priv(dev); diff --git a/drivers/net/8390.c b/drivers/net/8390.c index fa3442cb1a4..3d1c599ac3c 100644 --- a/drivers/net/8390.c +++ b/drivers/net/8390.c @@ -406,14 +406,8 @@ irqreturn_t ei_interrupt(int irq, void *dev_id) int interrupts, nr_serviced = 0; struct ei_device *ei_local; - if (dev == NULL) - { - printk ("net_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - e8390_base = dev->base_addr; - ei_local = (struct ei_device *) netdev_priv(dev); + ei_local = netdev_priv(dev); /* * Protect the irq test too. diff --git a/drivers/net/atp.c b/drivers/net/atp.c index 062f80e2087..2d306fcb7f3 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c @@ -598,17 +598,13 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev) Handle the network interface interrupts. */ static irqreturn_t atp_interrupt(int irq, void *dev_instance) { - struct net_device *dev = (struct net_device *)dev_instance; + struct net_device *dev = dev_instance; struct net_local *lp; long ioaddr; static int num_tx_since_rx; int boguscount = max_interrupt_work; int handled = 0; - if (dev == NULL) { - printk(KERN_ERR "ATP_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } ioaddr = dev->base_addr; lp = netdev_priv(dev); diff --git a/drivers/net/de600.c b/drivers/net/de600.c index d9b006c9e36..690bb40b353 100644 --- a/drivers/net/de600.c +++ b/drivers/net/de600.c @@ -265,12 +265,6 @@ static irqreturn_t de600_interrupt(int irq, void *dev_id) int retrig = 0; int boguscount = 0; - /* This might just as well be deleted now, no crummy drivers present :-) */ - if ((dev == NULL) || (DE600_IRQ != irq)) { - printk(KERN_ERR "%s: bogus interrupt %d\n", dev?dev->name:"DE-600", irq); - return IRQ_NONE; - } - spin_lock(&de600_lock); select_nic(); diff --git a/drivers/net/declance.c b/drivers/net/declance.c index e179aa1c1ba..00e2a8a134d 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c @@ -696,7 +696,7 @@ out: static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; printk("%s: DMA error\n", dev->name); return IRQ_HANDLED; @@ -704,7 +704,7 @@ static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id) static irqreturn_t lance_interrupt(const int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct lance_private *lp = netdev_priv(dev); volatile struct lance_regs *ll = lp->ll; int csr0; diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c index 6b1234b09fb..a79520295fd 100644 --- a/drivers/net/dgrs.c +++ b/drivers/net/dgrs.c @@ -897,8 +897,8 @@ static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd) static irqreturn_t dgrs_intr(int irq, void *dev_id) { - struct net_device *dev0 = (struct net_device *) dev_id; - DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv; + struct net_device *dev0 = dev_id; + DGRS_PRIV *priv0 = dev0->priv; I596_CB *cbp; int cmd; int i; diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index aae454aaa1c..fd6e97891e7 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c @@ -1198,17 +1198,11 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev) static irqreturn_t eepro_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; - /* (struct net_device *)(irq2dev_map[irq]);*/ + struct net_device *dev = dev_id; struct eepro_local *lp; int ioaddr, status, boguscount = 20; int handled = 0; - if (dev == NULL) { - printk (KERN_ERR "eepro_interrupt(): irq %d for unknown device.\\n", irq); - return IRQ_NONE; - } - lp = netdev_priv(dev); spin_lock(&lp->lock); diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index 05ca730fe81..e14be020e56 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c @@ -796,13 +796,6 @@ static irqreturn_t eexp_irq(int irq, void *dev_info) unsigned short ioaddr,status,ack_cmd; unsigned short old_read_ptr, old_write_ptr; - if (dev==NULL) - { - printk(KERN_WARNING "eexpress: irq %d for unknown device\n", - irq); - return IRQ_NONE; - } - lp = netdev_priv(dev); ioaddr = dev->base_addr; diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c index 971e2dee1e6..cebf8c374bc 100644 --- a/drivers/net/irda/ali-ircc.c +++ b/drivers/net/irda/ali-ircc.c @@ -662,19 +662,13 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info) */ static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct ali_ircc_cb *self; int ret; IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); - if (!dev) { - IRDA_WARNING("%s: irq %d for unknown device.\n", - ALI_IRCC_DRIVER_NAME, irq); - return IRQ_NONE; - } - - self = (struct ali_ircc_cb *) dev->priv; + self = dev->priv; spin_lock(&self->lock); diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 7a9128181e6..636d0630fe0 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c @@ -657,12 +657,6 @@ toshoboe_makemttpacket (struct toshoboe_cb *self, void *buf, int mtt) return xbofs; } -static int toshoboe_invalid_dev(int irq) -{ - printk (KERN_WARNING DRIVER_NAME ": irq %d for unknown device.\n", irq); - return 1; -} - #ifdef USE_PROBE /***********************************************************************/ /* Probe code */ @@ -711,12 +705,9 @@ stuff_byte (__u8 byte, __u8 * buf) static irqreturn_t toshoboe_probeinterrupt (int irq, void *dev_id) { - struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; + struct toshoboe_cb *self = dev_id; __u8 irqstat; - if (self == NULL && toshoboe_invalid_dev(irq)) - return IRQ_NONE; - irqstat = INB (OBOE_ISR); /* was it us */ diff --git a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c index 6ea78ececca..654a68b490a 100644 --- a/drivers/net/irda/irport.c +++ b/drivers/net/irda/irport.c @@ -766,18 +766,14 @@ static inline void irport_receive(struct irport_cb *self) */ static irqreturn_t irport_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct irport_cb *self; int boguscount = 0; int iobase; int iir, lsr; int handled = 0; - if (!dev) { - IRDA_WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq); - return IRQ_NONE; - } - self = (struct irport_cb *) dev->priv; + self = dev->priv; spin_lock(&self->lock); diff --git a/drivers/net/irda/irport.h b/drivers/net/irda/irport.h index 4393168347e..3f46b84c6c8 100644 --- a/drivers/net/irda/irport.h +++ b/drivers/net/irda/irport.h @@ -74,7 +74,7 @@ struct irport_cb { /* For piggyback drivers */ void *priv; void (*change_speed)(void *priv, __u32 speed); - int (*interrupt)(int irq, void *dev_id); + irqreturn_t (*interrupt)(int irq, void *dev_id); }; #endif /* IRPORT_H */ diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index ea12e999814..29b5ccd29d0 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c @@ -2068,17 +2068,12 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase, */ static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct nsc_ircc_cb *self; __u8 bsr, eir; int iobase; - if (!dev) { - IRDA_WARNING("%s: irq %d for unknown device.\n", - driver_name, irq); - return IRQ_NONE; - } - self = (struct nsc_ircc_cb *) dev->priv; + self = dev->priv; spin_lock(&self->lock); diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index b4fb92a7baa..4212657fa4f 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c @@ -1113,17 +1113,12 @@ static __u8 w83977af_fir_interrupt(struct w83977af_ir *self, int isr) */ static irqreturn_t w83977af_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct w83977af_ir *self; __u8 set, icr, isr; int iobase; - if (!dev) { - printk(KERN_WARNING "%s: irq %d for unknown device.\n", - driver_name, irq); - return IRQ_NONE; - } - self = (struct w83977af_ir *) dev->priv; + self = dev->priv; iobase = self->io.fir_base; diff --git a/drivers/net/lance.c b/drivers/net/lance.c index 7afac47e59a..6efbd499d75 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c @@ -1019,11 +1019,6 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id) int csr0, ioaddr, boguscnt=10; int must_restart; - if (dev == NULL) { - printk ("lance_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - ioaddr = dev->base_addr; lp = dev->priv; diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index e5f36691091..5ddd5742f77 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c @@ -1201,14 +1201,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) struct ei_device *ei_local; int handled = 0; - if (dev == NULL) - { - printk ("net_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - e8390_base = dev->base_addr; - ei_local = (struct ei_device *) netdev_priv(dev); + ei_local = netdev_priv(dev); /* * Protect the irq test too. diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index c73e2f21077..36f9d988278 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -2569,13 +2569,6 @@ pcnet32_interrupt(int irq, void *dev_id) u16 csr0; int boguscnt = max_interrupt_work; - if (!dev) { - if (pcnet32_debug & NETIF_MSG_INTR) - printk(KERN_DEBUG "%s(): irq %d for unknown device\n", - __FUNCTION__, irq); - return IRQ_NONE; - } - ioaddr = dev->base_addr; lp = dev->priv; diff --git a/drivers/net/plip.c b/drivers/net/plip.c index c0b333d2917..71afb274498 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c @@ -909,11 +909,6 @@ plip_interrupt(int irq, void *dev_id) struct plip_local *rcv; unsigned char c0; - if (dev == NULL) { - printk(KERN_DEBUG "plip_interrupt: irq %d for unknown device.\n", irq); - return; - } - nl = netdev_priv(dev); rcv = &nl->rcv_data; diff --git a/drivers/net/saa9730.c b/drivers/net/saa9730.c index c9efad8a917..b269513cde4 100644 --- a/drivers/net/saa9730.c +++ b/drivers/net/saa9730.c @@ -747,7 +747,7 @@ static int lan_saa9730_rx(struct net_device *dev) static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct lan_saa9730_private *lp = netdev_priv(dev); if (lan_saa9730_debug > 5) diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c index dc30dee5537..b9fa4fbb139 100644 --- a/drivers/net/sb1000.c +++ b/drivers/net/sb1000.c @@ -1084,19 +1084,13 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id) char *name; unsigned char st; int ioaddr[2]; - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct sb1000_private *lp = netdev_priv(dev); const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00}; const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; const int MaxRxErrorCount = 6; - if (dev == NULL) { - printk(KERN_ERR "sb1000_interrupt(): irq %d for unknown device.\n", - irq); - return IRQ_NONE; - } - ioaddr[0] = dev->base_addr; /* mem_start holds the second I/O address */ ioaddr[1] = dev->mem_start; diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c index 06ea2626c6f..9733a11c614 100644 --- a/drivers/net/skfp/skfddi.c +++ b/drivers/net/skfp/skfddi.c @@ -616,15 +616,10 @@ static int skfp_close(struct net_device *dev) irqreturn_t skfp_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct s_smc *smc; /* private board structure pointer */ skfddi_priv *bp; - if (dev == NULL) { - printk("%s: irq %d for unknown device\n", dev->name, irq); - return IRQ_NONE; - } - smc = netdev_priv(dev); bp = &smc->os; diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c index cfece9676af..ed7aa0a5acc 100644 --- a/drivers/net/sonic.c +++ b/drivers/net/sonic.c @@ -295,15 +295,10 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) */ static irqreturn_t sonic_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; + struct net_device *dev = dev_id; struct sonic_local *lp = netdev_priv(dev); int status; - if (dev == NULL) { - printk(KERN_ERR "sonic_interrupt: irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT)) return IRQ_NONE; diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 45d07faf7b9..9d7cd130c19 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c @@ -2095,8 +2095,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *) dev_id; - struct happy_meal *hp = dev->priv; + struct net_device *dev = dev_id; + struct happy_meal *hp = netdev_priv(dev); u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); HMD(("happy_meal_interrupt: status=%08x ", happy_status)); diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 9207e19cac3..5b00d79b557 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c @@ -822,7 +822,7 @@ out: static irqreturn_t lance_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct lance_private *lp = netdev_priv(dev); int csr0; diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index 020e7817059..7874eb1ef04 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c @@ -468,7 +468,7 @@ static void qe_tx_reclaim(struct sunqe *qep); */ static irqreturn_t qec_interrupt(int irq, void *dev_id) { - struct sunqec *qecp = (struct sunqec *) dev_id; + struct sunqec *qecp = dev_id; u32 qec_status; int channel = 0; diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c index 9bd4cba8787..46dabdb1207 100644 --- a/drivers/net/tokenring/smctr.c +++ b/drivers/net/tokenring/smctr.c @@ -1990,15 +1990,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id) __u8 isb_type, isb_subtype; __u16 isb_index; - if(dev == NULL) - { - printk(KERN_CRIT "%s: irq %d for unknown device.\n", dev->name, irq); - return IRQ_NONE; - } - ioaddr = dev->base_addr; tp = netdev_priv(dev); - if(tp->status == NOT_INITIALIZED) return IRQ_NONE; diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c index c0ab6e44eb1..ea797ca2b98 100644 --- a/drivers/net/tokenring/tms380tr.c +++ b/drivers/net/tokenring/tms380tr.c @@ -751,11 +751,6 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id) unsigned short irq_type; int handled = 0; - if(dev == NULL) { - printk(KERN_INFO "%s: irq %d for unknown device.\n", dev->name, irq); - return IRQ_NONE; - } - tp = netdev_priv(dev); irq_type = SIFREADW(SIFSTS); diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index e17f9779ead..3f4b6408b75 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c @@ -1540,16 +1540,12 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev) static irqreturn_t de4x5_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct de4x5_private *lp; s32 imr, omr, sts, limit; u_long iobase; unsigned int handled = 0; - if (dev == NULL) { - printk ("de4x5_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } lp = netdev_priv(dev); spin_lock(&lp->lock); iobase = dev->base_addr; diff --git a/drivers/net/wan/cycx_main.c b/drivers/net/wan/cycx_main.c index 12363e056b6..6e5f1c89851 100644 --- a/drivers/net/wan/cycx_main.c +++ b/drivers/net/wan/cycx_main.c @@ -303,9 +303,9 @@ out: return ret; */ static irqreturn_t cycx_isr(int irq, void *dev_id) { - struct cycx_device *card = (struct cycx_device *)dev_id; + struct cycx_device *card = dev_id; - if (!card || card->wandev.state == WAN_UNCONFIGURED) + if (card->wandev.state == WAN_UNCONFIGURED) goto out; if (card->in_isr) { diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index 5715d25271f..6a485f0556f 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c @@ -875,13 +875,7 @@ static irqreturn_t sdla_isr(int irq, void *dev_id) dev = dev_id; - if (dev == NULL) - { - printk(KERN_WARNING "sdla_isr(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } - - flp = dev->priv; + flp = netdev_priv(dev); if (!flp->initialized) { diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 793da5f6934..b779c7dcc1a 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c @@ -1954,7 +1954,7 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw) irqreturn_t orinoco_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct orinoco_private *priv = netdev_priv(dev); hermes_t *hw = &priv->hw; int count = MAX_IRQLOOPS_PER_IRQ; diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index cadfe132db8..aafb301041b 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c @@ -4119,21 +4119,12 @@ static irqreturn_t wavelan_interrupt(int irq, void * dev_id) { - struct net_device * dev; + struct net_device * dev = dev_id; net_local * lp; kio_addr_t base; int status0; u_int tx_status; - if ((dev = dev_id) == NULL) - { -#ifdef DEBUG_INTERRUPT_ERROR - printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n", - irq); -#endif - return IRQ_NONE; - } - #ifdef DEBUG_INTERRUPT_TRACE printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name); #endif diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index a1430352169..5b98a787698 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -1155,25 +1155,18 @@ static inline void wl3501_ack_interrupt(struct wl3501_card *this) */ static irqreturn_t wl3501_interrupt(int irq, void *dev_id) { - struct net_device *dev = (struct net_device *)dev_id; + struct net_device *dev = dev_id; struct wl3501_card *this; - int handled = 1; - if (!dev) - goto unknown; - this = dev->priv; + this = netdev_priv(dev); spin_lock(&this->lock); wl3501_ack_interrupt(this); wl3501_block_interrupt(this); wl3501_rx_interrupt(dev); wl3501_unblock_interrupt(this); spin_unlock(&this->lock); -out: - return IRQ_RETVAL(handled); -unknown: - handled = 0; - printk(KERN_ERR "%s: irq %d for unknown device.\n", __FUNCTION__, irq); - goto out; + + return IRQ_HANDLED; } static int wl3501_reset_board(struct wl3501_card *this) diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index ac600212d9a..2412ce4917f 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c @@ -896,13 +896,6 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance) int boguscnt = max_interrupt_work; unsigned int handled = 0; -#ifndef final_version /* Can never occur. */ - if (dev == NULL) { - printk (KERN_ERR "yellowfin_interrupt(): irq %d for unknown device.\n", irq); - return IRQ_NONE; - } -#endif - yp = netdev_priv(dev); ioaddr = yp->base; diff --git a/drivers/net/znet.c b/drivers/net/znet.c index 2068a109a86..b24b0727108 100644 --- a/drivers/net/znet.c +++ b/drivers/net/znet.c @@ -610,11 +610,6 @@ static irqreturn_t znet_interrupt(int irq, void *dev_id) int boguscnt = 20; int handled = 0; - if (dev == NULL) { - printk(KERN_WARNING "znet_interrupt(): IRQ %d for unknown device.\n", irq); - return IRQ_NONE; - } - spin_lock (&znet->lock); ioaddr = dev->base_addr; -- cgit v1.2.3 From c7bec5aba52392aa8d675b8722735caf4a8b7265 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 15:00:58 -0400 Subject: Various drivers' irq handlers: kill dead code, needless casts - Eliminate casts to/from void* - Eliminate checks for conditions that never occur. These typically fall into two classes: 1) Checking for 'dev_id == NULL', then it is never called with NULL as an argument. 2) Checking for invalid irq number, when the only caller (the system) guarantees the irq handler is called with the proper 'irq' number argument. Signed-off-by: Jeff Garzik --- drivers/atm/ambassador.c | 7 +------ drivers/atm/horizon.c | 9 --------- drivers/atm/lanai.c | 4 +--- drivers/block/DAC960.c | 14 +++++++------- drivers/cdrom/mcdx.c | 4 ---- drivers/char/rio/func.h | 2 +- drivers/char/rio/rio_linux.c | 4 ++-- drivers/char/rio/riointr.c | 2 +- drivers/char/riscom8.c | 7 +++---- drivers/char/specialix.c | 2 +- drivers/media/video/zoran_device.c | 2 +- drivers/pcmcia/at91_cf.c | 2 +- drivers/pcmcia/hd64465_ss.c | 7 +++---- drivers/scsi/NCR53c406a.c | 8 ++++---- drivers/scsi/aha152x.c | 7 +------ drivers/scsi/aic7xxx_old.c | 12 ++++++------ drivers/scsi/dc395x.c | 2 +- drivers/scsi/qlogicfas408.c | 6 +++--- drivers/scsi/tmscsim.c | 8 ++++---- drivers/scsi/ultrastor.c | 8 ++++---- drivers/serial/68360serial.c | 2 +- drivers/serial/jsm/jsm_neo.c | 2 +- drivers/serial/mpc52xx_uart.c | 10 +--------- drivers/serial/netx-serial.c | 2 +- drivers/serial/pxa.c | 2 +- drivers/sn/ioc3.c | 2 +- drivers/spi/pxa2xx_spi.c | 2 +- 27 files changed, 52 insertions(+), 87 deletions(-) (limited to 'drivers') diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index 8ff5c4e5082..323592de047 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c @@ -862,15 +862,10 @@ static inline void interrupts_off (amb_dev * dev) { /********** interrupt handling **********/ static irqreturn_t interrupt_handler(int irq, void *dev_id) { - amb_dev * dev = (amb_dev *) dev_id; + amb_dev * dev = dev_id; PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id); - if (!dev_id) { - PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); - return IRQ_NONE; - } - { u32 interrupt = rd_plain (dev, offsetof(amb_mem, interrupt)); diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 33e9ee47392..f59349206dd 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c @@ -1389,15 +1389,6 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id) { PRINTD (DBG_FLOW, "interrupt_handler: %p", dev_id); - if (!dev_id) { - PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); - return IRQ_NONE; - } - if (irq != dev->irq) { - PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); - return IRQ_NONE; - } - // definitely for us irq_ok = 0; while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF) diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 8895f026bea..267825501df 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1892,11 +1892,9 @@ static inline void lanai_int_1(struct lanai_dev *lanai, u32 reason) static irqreturn_t lanai_int(int irq, void *devid) { - struct lanai_dev *lanai = (struct lanai_dev *) devid; + struct lanai_dev *lanai = devid; u32 reason; - (void) irq; /* unused variables */ - #ifdef USE_POWERDOWN /* * If we're powered down we shouldn't be generating any interrupts - diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 3e8ab84b944..742d0740310 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -5254,7 +5254,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command) static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5295,7 +5295,7 @@ static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5337,7 +5337,7 @@ static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V2_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5379,7 +5379,7 @@ static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5417,7 +5417,7 @@ static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; DAC960_V1_StatusMailbox_T *NextStatusMailbox; unsigned long flags; @@ -5455,7 +5455,7 @@ static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; unsigned long flags; @@ -5493,7 +5493,7 @@ static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, static irqreturn_t DAC960_P_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier) { - DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; + DAC960_Controller_T *Controller = DeviceIdentifier; void __iomem *ControllerBaseAddress = Controller->BaseAddress; unsigned long flags; diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c index 60e1978ec0e..f574962f428 100644 --- a/drivers/cdrom/mcdx.c +++ b/drivers/cdrom/mcdx.c @@ -850,10 +850,6 @@ static irqreturn_t mcdx_intr(int irq, void *dev_id) struct s_drive_stuff *stuffp = dev_id; unsigned char b; - if (stuffp == NULL) { - xwarn("mcdx: no device for intr %d\n", irq); - return IRQ_NONE; - } #ifdef AK2 if (!stuffp->busy && stuffp->pending) stuffp->int_err = 1; diff --git a/drivers/char/rio/func.h b/drivers/char/rio/func.h index 6b039186856..9e7283bd81a 100644 --- a/drivers/char/rio/func.h +++ b/drivers/char/rio/func.h @@ -88,7 +88,7 @@ void RIOHostReset(unsigned int, struct DpRam __iomem *, unsigned int); /* riointr.c */ void RIOTxEnable(char *); -void RIOServiceHost(struct rio_info *, struct Host *, int); +void RIOServiceHost(struct rio_info *, struct Host *); int riotproc(struct rio_info *, struct ttystatics *, int, int); /* rioparam.c */ diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index 3bea594600d..c382df0f82f 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c @@ -368,7 +368,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr) struct Host *HostP; func_enter(); - HostP = (struct Host *) ptr; /* &p->RIOHosts[(long)ptr]; */ + HostP = ptr; /* &p->RIOHosts[(long)ptr]; */ rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec); /* AAargh! The order in which to do these things is essential and @@ -402,7 +402,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr) return IRQ_HANDLED; } - RIOServiceHost(p, HostP, irq); + RIOServiceHost(p, HostP); rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type); diff --git a/drivers/char/rio/riointr.c b/drivers/char/rio/riointr.c index 0bd09040a5c..eeda40c5e18 100644 --- a/drivers/char/rio/riointr.c +++ b/drivers/char/rio/riointr.c @@ -181,7 +181,7 @@ static int RupIntr; static int RxIntr; static int TxIntr; -void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From) +void RIOServiceHost(struct rio_info *p, struct Host *HostP) { rio_spin_lock(&HostP->HostLock); if ((HostP->Flags & RUN_STATE) != RC_RUNNING) { diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index be68cfb0ae6..5ab32b38f45 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c @@ -559,11 +559,10 @@ static irqreturn_t rc_interrupt(int irq, void * dev_id) int handled = 0; bp = IRQ_to_board[irq]; - - if (!bp || !(bp->flags & RC_BOARD_ACTIVE)) { + + if (!(bp->flags & RC_BOARD_ACTIVE)) return IRQ_NONE; - } - + while ((++loop < 16) && ((status = ~(rc_in(bp, RC_BSR))) & (RC_BSR_TOUT | RC_BSR_TINT | RC_BSR_MINT | RC_BSR_RINT))) { diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 6022495571a..d0b88d0e87f 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -912,7 +912,7 @@ static irqreturn_t sx_interrupt(int irq, void *dev_id) spin_lock_irqsave(&bp->lock, flags); dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1); - if (!bp || !(bp->flags & SX_BOARD_ACTIVE)) { + if (!(bp->flags & SX_BOARD_ACTIVE)) { dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq); spin_unlock_irqrestore(&bp->lock, flags); func_exit(); diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c index d9d5020a222..168e431d7c7 100644 --- a/drivers/media/video/zoran_device.c +++ b/drivers/media/video/zoran_device.c @@ -1415,7 +1415,7 @@ zoran_irq (int irq, struct zoran *zr; unsigned long flags; - zr = (struct zoran *) dev_id; + zr = dev_id; count = 0; if (zr->testing) { diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c index 991e084db2d..7f5df9a9f39 100644 --- a/drivers/pcmcia/at91_cf.c +++ b/drivers/pcmcia/at91_cf.c @@ -66,7 +66,7 @@ static int at91_cf_ss_init(struct pcmcia_socket *s) static irqreturn_t at91_cf_irq(int irq, void *_cf) { - struct at91_cf_socket *cf = (struct at91_cf_socket *) _cf; + struct at91_cf_socket *cf = _cf; if (irq == cf->board->det_pin) { unsigned present = at91_cf_present(cf); diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c index db3c26b5de1..caca0dc9d30 100644 --- a/drivers/pcmcia/hd64465_ss.c +++ b/drivers/pcmcia/hd64465_ss.c @@ -650,7 +650,7 @@ static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) */ static int hs_irq_demux(int irq, void *dev) { - hs_socket_t *sp = (hs_socket_t *)dev; + hs_socket_t *sp = dev; u_int cscr; DPRINTK("hs_irq_demux(irq=%d)\n", irq); @@ -673,11 +673,10 @@ static int hs_irq_demux(int irq, void *dev) static irqreturn_t hs_interrupt(int irq, void *dev) { - hs_socket_t *sp = (hs_socket_t *)dev; + hs_socket_t *sp = dev; u_int events = 0; u_int cscr; - - + cscr = hs_in(sp, CSCR); DPRINTK("hs_interrupt, cscr=%04x\n", cscr); diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c index 3896278594c..d4613815f68 100644 --- a/drivers/scsi/NCR53c406a.c +++ b/drivers/scsi/NCR53c406a.c @@ -168,7 +168,7 @@ enum Phase { }; /* Static function prototypes */ -static void NCR53c406a_intr(int, void *); +static void NCR53c406a_intr(void *); static irqreturn_t do_NCR53c406a_intr(int, void *); static void chip_init(void); static void calc_port_addr(void); @@ -685,7 +685,7 @@ static void wait_intr(void) return; } - NCR53c406a_intr(0, NULL, NULL); + NCR53c406a_intr(NULL); } #endif @@ -767,12 +767,12 @@ static irqreturn_t do_NCR53c406a_intr(int unused, void *dev_id) struct Scsi_Host *dev = dev_id; spin_lock_irqsave(dev->host_lock, flags); - NCR53c406a_intr(0, dev_id); + NCR53c406a_intr(dev_id); spin_unlock_irqrestore(dev->host_lock, flags); return IRQ_HANDLED; } -static void NCR53c406a_intr(int unused, void *dev_id) +static void NCR53c406a_intr(void *dev_id) { DEB(unsigned char fifo_size; ) diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index e04c2bc1932..a0d1cee0be7 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -759,12 +759,7 @@ static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, Scsi_Cmnd *SCp) static irqreturn_t swintr(int irqno, void *dev_id) { - struct Scsi_Host *shpnt = (struct Scsi_Host *)dev_id; - - if (!shpnt) { - printk(KERN_ERR "aha152x: catched software interrupt %d for unknown controller.\n", irqno); - return IRQ_NONE; - } + struct Scsi_Host *shpnt = dev_id; HOSTDATA(shpnt)->swint++; diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index 7f0adf9c4c7..bcd7fffab90 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c @@ -6345,12 +6345,12 @@ aic7xxx_handle_command_completion_intr(struct aic7xxx_host *p) * SCSI controller interrupt handler. *-F*************************************************************************/ static void -aic7xxx_isr(int irq, void *dev_id) +aic7xxx_isr(void *dev_id) { struct aic7xxx_host *p; unsigned char intstat; - p = (struct aic7xxx_host *)dev_id; + p = dev_id; /* * Just a few sanity checks. Make sure that we have an int pending. @@ -6489,7 +6489,7 @@ do_aic7xxx_isr(int irq, void *dev_id) p->flags |= AHC_IN_ISR; do { - aic7xxx_isr(irq, dev_id); + aic7xxx_isr(dev_id); } while ( (aic_inb(p, INTSTAT) & INT_PEND) ); aic7xxx_done_cmds_complete(p); aic7xxx_run_waiting_queues(p); @@ -10377,7 +10377,7 @@ static int __aic7xxx_bus_device_reset(struct scsi_cmnd *cmd) hscb = scb->hscb; - aic7xxx_isr(p->irq, (void *)p); + aic7xxx_isr(p); aic7xxx_done_cmds_complete(p); /* If the command was already complete or just completed, then we didn't * do a reset, return FAILED */ @@ -10608,7 +10608,7 @@ static int __aic7xxx_abort(struct scsi_cmnd *cmd) else return FAILED; - aic7xxx_isr(p->irq, (void *)p); + aic7xxx_isr(p); aic7xxx_done_cmds_complete(p); /* If the command was already complete or just completed, then we didn't * do a reset, return FAILED */ @@ -10863,7 +10863,7 @@ static int aic7xxx_reset(struct scsi_cmnd *cmd) while((aic_inb(p, INTSTAT) & INT_PEND) && !(p->flags & AHC_IN_ISR)) { - aic7xxx_isr(p->irq, p); + aic7xxx_isr(p); pause_sequencer(p); } aic7xxx_done_cmds_complete(p); diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 81e3ee51d89..23f5e418ab5 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -1815,7 +1815,7 @@ static void dc395x_handle_interrupt(struct AdapterCtlBlk *acb, static irqreturn_t dc395x_interrupt(int irq, void *dev_id) { - struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)dev_id; + struct AdapterCtlBlk *acb = dev_id; u16 scsi_status; u8 dma_status; irqreturn_t handled = IRQ_NONE; diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c index 1a7de3bd796..e0725353c99 100644 --- a/drivers/scsi/qlogicfas408.c +++ b/drivers/scsi/qlogicfas408.c @@ -405,10 +405,10 @@ static unsigned int ql_pcmd(Scsi_Cmnd * cmd) * Interrupt handler */ -static void ql_ihandl(int irq, void *dev_id) +static void ql_ihandl(void *dev_id) { Scsi_Cmnd *icmd; - struct Scsi_Host *host = (struct Scsi_Host *)dev_id; + struct Scsi_Host *host = dev_id; struct qlogicfas408_priv *priv = get_priv_by_host(host); int qbase = priv->qbase; REG0; @@ -438,7 +438,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id) struct Scsi_Host *host = dev_id; spin_lock_irqsave(host->host_lock, flags); - ql_ihandl(irq, dev_id); + ql_ihandl(dev_id); spin_unlock_irqrestore(host->host_lock, flags); return IRQ_HANDLED; } diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c index 0f0ac925d31..d03aa6ce8fe 100644 --- a/drivers/scsi/tmscsim.c +++ b/drivers/scsi/tmscsim.c @@ -700,9 +700,9 @@ dc390_InvalidCmd(struct dc390_acb* pACB) static irqreturn_t __inline__ -DC390_Interrupt(int irq, void *dev_id) +DC390_Interrupt(void *dev_id) { - struct dc390_acb *pACB = (struct dc390_acb*)dev_id; + struct dc390_acb *pACB = dev_id; struct dc390_dcb *pDCB; struct dc390_srb *pSRB; u8 sstatus=0; @@ -811,12 +811,12 @@ DC390_Interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static irqreturn_t do_DC390_Interrupt( int irq, void *dev_id) +static irqreturn_t do_DC390_Interrupt(int irq, void *dev_id) { irqreturn_t ret; DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq)); /* Locking is done in DC390_Interrupt */ - ret = DC390_Interrupt(irq, dev_id); + ret = DC390_Interrupt(dev_id); DEBUG1(printk (".. IRQ returned\n")); return ret; } diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 107f0fc3494..56906aba5ee 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -287,7 +287,7 @@ static const unsigned short ultrastor_ports_14f[] = { }; #endif -static void ultrastor_interrupt(int, void *); +static void ultrastor_interrupt(void *); static irqreturn_t do_ultrastor_interrupt(int, void *); static inline void build_sg_list(struct mscp *, struct scsi_cmnd *SCpnt); @@ -893,7 +893,7 @@ static int ultrastor_abort(struct scsi_cmnd *SCpnt) spin_lock_irqsave(host->host_lock, flags); /* FIXME: Ewww... need to think about passing host around properly */ - ultrastor_interrupt(0, NULL); + ultrastor_interrupt(NULL); spin_unlock_irqrestore(host->host_lock, flags); return SUCCESS; } @@ -1039,7 +1039,7 @@ int ultrastor_biosparam(struct scsi_device *sdev, struct block_device *bdev, return 0; } -static void ultrastor_interrupt(int irq, void *dev_id) +static void ultrastor_interrupt(void *dev_id) { unsigned int status; #if ULTRASTOR_MAX_CMDS > 1 @@ -1177,7 +1177,7 @@ static irqreturn_t do_ultrastor_interrupt(int irq, void *dev_id) struct Scsi_Host *dev = dev_id; spin_lock_irqsave(dev->host_lock, flags); - ultrastor_interrupt(irq, dev_id); + ultrastor_interrupt(dev_id); spin_unlock_irqrestore(dev->host_lock, flags); return IRQ_HANDLED; } diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index 4e56ec80386..634ecca36a7 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -620,7 +620,7 @@ static void rs_360_interrupt(int vec, void *dev_id) volatile struct smc_regs *smcp; volatile struct scc_regs *sccp; - info = (ser_info_t *)dev_id; + info = dev_id; idx = PORT_NUM(info->state->smc_scc_num); if (info->state->smc_scc_num & NUM_IS_SCC) { diff --git a/drivers/serial/jsm/jsm_neo.c b/drivers/serial/jsm/jsm_neo.c index 8fa31e68989..8be8da37f62 100644 --- a/drivers/serial/jsm/jsm_neo.c +++ b/drivers/serial/jsm/jsm_neo.c @@ -1116,7 +1116,7 @@ static void neo_param(struct jsm_channel *ch) */ static irqreturn_t neo_intr(int irq, void *voidbrd) { - struct jsm_board *brd = (struct jsm_board *) voidbrd; + struct jsm_board *brd = voidbrd; struct jsm_channel *ch; int port = 0; int type = 0; diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 039c2fd6d49..4f80c5b4a75 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -512,19 +512,11 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port) static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id) { - struct uart_port *port = (struct uart_port *) dev_id; + struct uart_port *port = dev_id; unsigned long pass = ISR_PASS_LIMIT; unsigned int keepgoing; unsigned short status; - if ( irq != port->irq ) { - printk( KERN_WARNING - "mpc52xx_uart_int : " \ - "Received wrong int %d. Waiting for %d\n", - irq, port->irq); - return IRQ_NONE; - } - spin_lock(&port->lock); /* While we have stuff to do, we continue */ diff --git a/drivers/serial/netx-serial.c b/drivers/serial/netx-serial.c index e92d7e1c22c..062bad457b1 100644 --- a/drivers/serial/netx-serial.c +++ b/drivers/serial/netx-serial.c @@ -247,7 +247,7 @@ static void netx_rxint(struct uart_port *port) static irqreturn_t netx_int(int irq, void *dev_id) { - struct uart_port *port = (struct uart_port *)dev_id; + struct uart_port *port = dev_id; unsigned long flags; unsigned char status; diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 846089f222d..415fe9633a9 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c @@ -232,7 +232,7 @@ static inline void check_modem_status(struct uart_pxa_port *up) */ static inline irqreturn_t serial_pxa_irq(int irq, void *dev_id) { - struct uart_pxa_port *up = (struct uart_pxa_port *)dev_id; + struct uart_pxa_port *up = dev_id; unsigned int iir, lsr; iir = serial_in(up, UART_IIR); diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c index 3d91b6b9287..cd6b65333b7 100644 --- a/drivers/sn/ioc3.c +++ b/drivers/sn/ioc3.c @@ -401,7 +401,7 @@ static inline uint32_t get_pending_intrs(struct ioc3_driver_data *idd) static irqreturn_t ioc3_intr_io(int irq, void *arg) { unsigned long flags; - struct ioc3_driver_data *idd = (struct ioc3_driver_data *)arg; + struct ioc3_driver_data *idd = arg; int handled = 1, id; unsigned int pending; diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 77122edeb20..72025df5561 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c @@ -669,7 +669,7 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data) static irqreturn_t ssp_int(int irq, void *dev_id) { - struct driver_data *drv_data = (struct driver_data *)dev_id; + struct driver_data *drv_data = dev_id; void *reg = drv_data->ioaddr; if (!drv_data->cur_msg) { -- cgit v1.2.3 From 8f4aff6cb178b0a580ee206e7cca63e2d31f4a4e Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 15:03:04 -0400 Subject: drivers/net/eepro: kill dead code The irq2dev_map has not been used for a long time. Signed-off-by: Jeff Garzik --- drivers/net/eepro.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'drivers') diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index fd6e97891e7..a4eb0dc99ec 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c @@ -994,16 +994,6 @@ static int eepro_open(struct net_device *dev) return -EAGAIN; } -#ifdef irq2dev_map - if (((irq2dev_map[dev->irq] != 0) - || (irq2dev_map[dev->irq] = dev) == 0) && - (irq2dev_map[dev->irq]!=dev)) { - /* printk("%s: IRQ map wrong\n", dev->name); */ - free_irq(dev->irq, dev); - return -EAGAIN; - } -#endif - /* Initialize the 82595. */ eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ @@ -1282,10 +1272,6 @@ static int eepro_close(struct net_device *dev) /* release the interrupt */ free_irq(dev->irq, dev); -#ifdef irq2dev_map - irq2dev_map[dev->irq] = 0; -#endif - /* Update the statistics here. What statistics? */ return 0; -- cgit v1.2.3 From d87dbede030d17770aa6a6170e70ab6f8044e5ae Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Fri, 6 Oct 2006 15:04:35 -0400 Subject: drivers/isdn/act2000: kill irq2card_map Eliminate irq->card lookup table, by properly passing the card pointer via request_irq() like other drivers. Signed-off-by: Jeff Garzik --- drivers/isdn/act2000/act2000_isa.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 3014495b7ff..3cac2373934 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c @@ -16,8 +16,6 @@ #include "act2000_isa.h" #include "capi.h" -static act2000_card *irq2card_map[16]; - /* * Reset Controller, then try to read the Card's signature. + Return: @@ -65,14 +63,9 @@ act2000_isa_detect(unsigned short portbase) static irqreturn_t act2000_isa_interrupt(int irq, void *dev_id) { - act2000_card *card = irq2card_map[irq]; + act2000_card *card = dev_id; u_char istatus; - if (!card) { - printk(KERN_WARNING - "act2000: Spurious interrupt!\n"); - return IRQ_NONE; - } istatus = (inb(ISA_PORT_ISR) & 0x07); if (istatus & ISA_ISR_OUT) { /* RX fifo has data */ @@ -139,17 +132,15 @@ int act2000_isa_config_irq(act2000_card * card, short irq) { if (card->flags & ACT2000_FLAGS_IVALID) { - free_irq(card->irq, NULL); - irq2card_map[card->irq] = NULL; + free_irq(card->irq, card); } card->flags &= ~ACT2000_FLAGS_IVALID; outb(ISA_COR_IRQOFF, ISA_PORT_COR); if (!irq) return 0; - if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) { + if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) { card->irq = irq; - irq2card_map[card->irq] = card; card->flags |= ACT2000_FLAGS_IVALID; printk(KERN_WARNING "act2000: Could not request irq %d\n",irq); @@ -188,10 +179,9 @@ act2000_isa_release(act2000_card * card) unsigned long flags; spin_lock_irqsave(&card->lock, flags); - if (card->flags & ACT2000_FLAGS_IVALID) { - free_irq(card->irq, NULL); - irq2card_map[card->irq] = NULL; - } + if (card->flags & ACT2000_FLAGS_IVALID) + free_irq(card->irq, card); + card->flags &= ~ACT2000_FLAGS_IVALID; if (card->flags & ACT2000_FLAGS_PVALID) release_region(card->port, ISA_REGION); -- cgit v1.2.3 From b7696ee3c050a76a6cebccdbadfc93896b336e44 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 6 Oct 2006 20:53:10 +0200 Subject: [PATCH] fix mesh compile errors after irq changes drivers/scsi/mesh.c:469: error: too many arguments to function 'mesh_interrupt' drivers/scsi/mesh.c:507: error: too many arguments to function 'mesh_interrupt' Signed-off-by: Olaf Hering Signed-off-by: Linus Torvalds --- drivers/scsi/mesh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c index c773e35dace..1fd3c7590d3 100644 --- a/drivers/scsi/mesh.c +++ b/drivers/scsi/mesh.c @@ -466,7 +466,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd) dlog(ms, "intr b4 arb, intr/exc/err/fc=%.8x", MKWORD(mr->interrupt, mr->exception, mr->error, mr->fifo_count)); - mesh_interrupt(0, (void *)ms, NULL); + mesh_interrupt(0, (void *)ms); if (ms->phase != arbitrating) return; } @@ -504,7 +504,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd) dlog(ms, "intr after disresel, intr/exc/err/fc=%.8x", MKWORD(mr->interrupt, mr->exception, mr->error, mr->fifo_count)); - mesh_interrupt(0, (void *)ms, NULL); + mesh_interrupt(0, (void *)ms); if (ms->phase != arbitrating) return; dlog(ms, "after intr after disresel, intr/exc/err/fc=%.8x", -- cgit v1.2.3 From 27db2d0cb9b56210dc1e29bc89a7413f3ae67b91 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 6 Oct 2006 13:54:28 +1000 Subject: [POWERPC] Fix viocons for irq breakage Signed-off-by: Stephen Rothwell Signed-off-by: Paul Mackerras --- drivers/char/viocons.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index a362ee9c92d..6d2e314860d 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c @@ -947,7 +947,7 @@ static void vioHandleData(struct HvLpEvent *event) */ continue; } else if (vio_sysrq_pressed) { - handle_sysrq(cevent->data[index], NULL, tty); + handle_sysrq(cevent->data[index], tty); vio_sysrq_pressed = 0; /* * continue because we don't want to add -- cgit v1.2.3 From be577a5220b25e0a6e3fbf96bbfc8b31d63e9ea9 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 6 Oct 2006 20:47:23 -0600 Subject: Build fixes for struct pt_regs removal Signed-off-by: Matthew Wilcox --- drivers/input/keyboard/hil_kbd.c | 2 +- drivers/input/mouse/hil_ptr.c | 2 +- drivers/input/serio/gscps2.c | 4 ++-- drivers/input/serio/hil_mlc.c | 32 ++++++++++++++++---------------- drivers/net/lasi_82596.c | 2 +- drivers/parisc/dino.c | 2 +- drivers/parisc/eisa.c | 2 +- drivers/serial/mux.c | 2 +- 8 files changed, 24 insertions(+), 24 deletions(-) (limited to 'drivers') diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index c9b0b8978cd..e774dd31e99 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c @@ -328,7 +328,7 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) kbd->dev->id.vendor = PCI_VENDOR_ID_HP; kbd->dev->id.product = 0x0001; /* TODO: get from kbd->rsc */ kbd->dev->id.version = 0x0100; /* TODO: get from kbd->rsc */ - kbd->dev->dev = &serio->dev; + kbd->dev->cdev.dev = &serio->dev; for (i = 0; i < 128; i++) { set_bit(hil_kbd_set1[i], kbd->dev->keybit); diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c index 402b057e986..4f2b503c1ac 100644 --- a/drivers/input/mouse/hil_ptr.c +++ b/drivers/input/mouse/hil_ptr.c @@ -375,7 +375,7 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) ptr->dev->id.vendor = PCI_VENDOR_ID_HP; ptr->dev->id.product = 0x0001; /* TODO: get from ptr->rsc */ ptr->dev->id.version = 0x0100; /* TODO: get from ptr->rsc */ - ptr->dev->dev = &serio->dev; + ptr->dev->cdev.dev = &serio->dev; input_register_device(ptr->dev); printk(KERN_INFO "input: %s (%s), ID: %d\n", diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 081fdc3c773..74f14e09778 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -166,7 +166,7 @@ static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data) /* make sure any received data is returned as fast as possible */ /* this is important e.g. when we set the LEDs on the keyboard */ - gscps2_interrupt(0, NULL, NULL); + gscps2_interrupt(0, NULL); return 1; } @@ -306,7 +306,7 @@ static int gscps2_open(struct serio *port) /* enable it */ gscps2_enable(ps2port, ENABLE); - gscps2_interrupt(0, NULL, NULL); + gscps2_interrupt(0, NULL); return 0; } diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c index bbbe15e2190..bdfde046b74 100644 --- a/drivers/input/serio/hil_mlc.c +++ b/drivers/input/serio/hil_mlc.c @@ -162,10 +162,10 @@ static void hil_mlc_send_polls(hil_mlc *mlc) { if (did != (p & HIL_PKT_ADDR_MASK) >> 8) { if (drv == NULL || drv->interrupt == NULL) goto skip; - drv->interrupt(serio, 0, 0, NULL); - drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); - drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL); - drv->interrupt(serio, HIL_CMD_POL + cnt, 0, NULL); + drv->interrupt(serio, 0, 0); + drv->interrupt(serio, HIL_ERR_INT >> 16, 0); + drv->interrupt(serio, HIL_PKT_CMD >> 8, 0); + drv->interrupt(serio, HIL_CMD_POL + cnt, 0); skip: did = (p & HIL_PKT_ADDR_MASK) >> 8; serio = did ? mlc->serio[mlc->di_map[did-1]] : NULL; @@ -174,10 +174,10 @@ static void hil_mlc_send_polls(hil_mlc *mlc) { } cnt++; i++; if (drv == NULL || drv->interrupt == NULL) continue; - drv->interrupt(serio, (p >> 24), 0, NULL); - drv->interrupt(serio, (p >> 16) & 0xff, 0, NULL); - drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0, NULL); - drv->interrupt(serio, p & 0xff, 0, NULL); + drv->interrupt(serio, (p >> 24), 0); + drv->interrupt(serio, (p >> 16) & 0xff, 0); + drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0); + drv->interrupt(serio, p & 0xff, 0); } } @@ -780,16 +780,16 @@ static int hil_mlc_serio_write(struct serio *serio, unsigned char c) { while ((last != idx) && (*last == 0)) last--; while (idx != last) { - drv->interrupt(serio, 0, 0, NULL); - drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); - drv->interrupt(serio, 0, 0, NULL); - drv->interrupt(serio, *idx, 0, NULL); + drv->interrupt(serio, 0, 0); + drv->interrupt(serio, HIL_ERR_INT >> 16, 0); + drv->interrupt(serio, 0, 0); + drv->interrupt(serio, *idx, 0); idx++; } - drv->interrupt(serio, 0, 0, NULL); - drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); - drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL); - drv->interrupt(serio, *idx, 0, NULL); + drv->interrupt(serio, 0, 0); + drv->interrupt(serio, HIL_ERR_INT >> 16, 0); + drv->interrupt(serio, HIL_PKT_CMD >> 8, 0); + drv->interrupt(serio, *idx, 0); mlc->serio_oidx[map->didx] = 0; mlc->serio_opacket[map->didx] = 0; diff --git a/drivers/net/lasi_82596.c b/drivers/net/lasi_82596.c index 8cbd940f0ac..f4d815bca64 100644 --- a/drivers/net/lasi_82596.c +++ b/drivers/net/lasi_82596.c @@ -1252,7 +1252,7 @@ static int __devinit i82596_probe(struct net_device *dev, static void i596_poll_controller(struct net_device *dev) { disable_irq(dev->irq); - i596_interrupt(dev->irq, dev, NULL); + i596_interrupt(dev->irq, dev); enable_irq(dev->irq); } #endif diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index a0a8fd8d212..03c763c2d0e 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -389,7 +389,7 @@ ilr_again: int irq = dino_dev->global_irq[local_irq]; DBG(KERN_DEBUG "%s(%d, %p) mask 0x%x\n", __FUNCTION__, irq, intr_dev, mask); - __do_IRQ(irq, regs); + __do_IRQ(irq); mask &= ~(1 << local_irq); } while (mask); diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index 094562e044f..e97cecbc4d1 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c @@ -234,7 +234,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) } spin_unlock_irqrestore(&eisa_irq_lock, flags); - __do_IRQ(irq, regs); + __do_IRQ(irq); spin_lock_irqsave(&eisa_irq_lock, flags); /* unmask */ diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c index aa819d3f8ee..8ad1b8c5ec5 100644 --- a/drivers/serial/mux.c +++ b/drivers/serial/mux.c @@ -230,7 +230,7 @@ static void mux_read(struct uart_port *port) continue; } - if (uart_handle_sysrq_char(port, data & 0xffu, NULL)) + if (uart_handle_sysrq_char(port, data & 0xffu)) continue; tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL); -- cgit v1.2.3 From 2850bc273776cbb1b510c5828e9e456dffb50a32 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 7 Oct 2006 14:16:45 +0100 Subject: [PATCH] m68k pt_regs fixes m68k_handle_int() split in two functions: __m68k_handle_int() takes pt_regs * and does set_irq_regs(); m68k_handle_int() doesn't get pt_regs *. Places where we used to call m68k_handle_int() recursively with the same pt_regs have simply lost the second argument, the rest is switched to __m68k_handle_int(). The rest of patch is just dropping pt_regs * where needed. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/char/vme_scc.c | 2 +- drivers/macintosh/adb-iop.c | 2 +- drivers/macintosh/via-macii.c | 2 +- drivers/macintosh/via-maciisi.c | 2 +- drivers/macintosh/via-pmu68k.c | 6 +++--- drivers/net/7990.c | 2 +- drivers/parport/parport_mfc3.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers') diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c index 0cdbaa70cf9..d0b94dd1af6 100644 --- a/drivers/char/vme_scc.c +++ b/drivers/char/vme_scc.c @@ -593,7 +593,7 @@ static void scc_enable_tx_interrupts(void *ptr) local_irq_save(flags); SCCmod(INT_AND_DMA_REG, 0xff, IDR_TX_INT_ENAB); /* restart the transmitter */ - scc_tx_int (0, port, 0); + scc_tx_int (0, port); local_irq_restore(flags); } diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c index 1ffee7aaff2..17ef5d3c01b 100644 --- a/drivers/macintosh/adb-iop.c +++ b/drivers/macintosh/adb-iop.c @@ -266,7 +266,7 @@ int adb_iop_autopoll(int devs) void adb_iop_poll(void) { if (adb_iop_state == idle) adb_iop_start(); - iop_ism_irq(0, (void *) ADB_IOP, NULL); + iop_ism_irq(0, (void *) ADB_IOP); } int adb_iop_reset_bus(void) diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index ad4bd579f61..5d88d5b0ad9 100644 --- a/drivers/macintosh/via-macii.c +++ b/drivers/macintosh/via-macii.c @@ -295,7 +295,7 @@ static void macii_poll(void) unsigned long flags; local_irq_save(flags); - if (via[IFR] & SR_INT) macii_interrupt(0, NULL, NULL); + if (via[IFR] & SR_INT) macii_interrupt(0, NULL); local_irq_restore(flags); } diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c index 789ee52086f..1f0aa5dc9aa 100644 --- a/drivers/macintosh/via-maciisi.c +++ b/drivers/macintosh/via-maciisi.c @@ -421,7 +421,7 @@ maciisi_poll(void) local_irq_save(flags); if (via[IFR] & SR_INT) { - maciisi_interrupt(0, NULL, NULL); + maciisi_interrupt(0, NULL); } else /* avoid calling this function too quickly in a loop */ udelay(ADB_DELAY); diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index 98ec915d040..d9986f3a3fb 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c @@ -221,7 +221,7 @@ pmu_init(void) } if (pmu_state == idle) { adb_int_pending = 1; - pmu_interrupt(0, NULL, NULL); + pmu_interrupt(0, NULL); } pmu_poll(); udelay(10); @@ -562,11 +562,11 @@ pmu_poll(void) local_irq_save(flags); if (via1[IFR] & SR_INT) { via1[IFR] = SR_INT; - pmu_interrupt(IRQ_MAC_ADB_SR, NULL, NULL); + pmu_interrupt(IRQ_MAC_ADB_SR, NULL); } if (via1[IFR] & CB1_INT) { via1[IFR] = CB1_INT; - pmu_interrupt(IRQ_MAC_ADB_CL, NULL, NULL); + pmu_interrupt(IRQ_MAC_ADB_CL, NULL); } local_irq_restore(flags); } diff --git a/drivers/net/7990.c b/drivers/net/7990.c index 8e996b4a34e..7733697f777 100644 --- a/drivers/net/7990.c +++ b/drivers/net/7990.c @@ -674,7 +674,7 @@ void lance_poll(struct net_device *dev) WRITERAP(lp, LE_CSR0); WRITERDP(lp, LE_C0_STRT); spin_unlock (&lp->devlock); - lance_interrupt(dev->irq, dev, NULL); + lance_interrupt(dev->irq, dev); } #endif diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c index 6541cde4df0..e5b0a544de4 100644 --- a/drivers/parport/parport_mfc3.c +++ b/drivers/parport/parport_mfc3.c @@ -219,7 +219,7 @@ static irqreturn_t mfc3_interrupt(int irq, void *dev_id) if (this_port[i] != NULL) if (pia(this_port[i])->crb & 128) { /* Board caused interrupt */ dummy = pia(this_port[i])->pprb; /* clear irq bit */ - parport_generic_irq(irq, this_port[i], regs); + parport_generic_irq(irq, this_port[i]); } return IRQ_HANDLED; } -- cgit v1.2.3 From 9c8e7f5cc965d30006c917ab19221e06fcc5a4f9 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 7 Oct 2006 16:29:18 +0100 Subject: [PATCH] m32r pt_regs fixes ... and now with irq_regs.h not forgotten... Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/net/smc91x.c | 2 +- drivers/pcmcia/m32r_pcc.c | 2 +- drivers/serial/m32r_sio.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 506807fa526..95b6478f55c 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c @@ -1400,7 +1400,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id) static void smc_poll_controller(struct net_device *dev) { disable_irq(dev->irq); - smc_interrupt(dev->irq, dev, NULL); + smc_interrupt(dev->irq, dev); enable_irq(dev->irq); } #endif diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c index 0964fd76bfe..bbf025874d0 100644 --- a/drivers/pcmcia/m32r_pcc.c +++ b/drivers/pcmcia/m32r_pcc.c @@ -395,7 +395,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev) static void pcc_interrupt_wrapper(u_long data) { - pcc_interrupt(0, NULL, NULL); + pcc_interrupt(0, NULL); init_timer(&poll_timer); poll_timer.expires = jiffies + poll_interval; add_timer(&poll_timer); diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index c85ac1a7760..7656a35f5e2 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c @@ -590,7 +590,7 @@ static void m32r_sio_timeout(unsigned long data) sts = sio_in(up, SIOSTS); if (sts & 0x5) { spin_lock(&up->port.lock); - m32r_sio_handle_port(up, sts, NULL); + m32r_sio_handle_port(up, sts); spin_unlock(&up->port.lock); } -- cgit v1.2.3 From f1d08f71974dcf68ce4510a2dfaeb798b05df2c0 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sat, 7 Oct 2006 13:41:51 +0900 Subject: [MIPS] Fix DECserial build error by IRQ hander change Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- drivers/tc/zs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c index 7c0fe1dc96a..792becdfe6f 100644 --- a/drivers/tc/zs.c +++ b/drivers/tc/zs.c @@ -389,7 +389,7 @@ static void receive_chars(struct dec_serial *info) if (ch == 0) continue; if (time_before(jiffies, break_pressed + HZ * 5)) { - handle_sysrq(ch, regs, NULL); + handle_sysrq(ch, NULL); break_pressed = 0; continue; } -- cgit v1.2.3 From b7a7179dcae6cecfaaa8384f8c088fb7823c6c90 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Fri, 6 Oct 2006 19:49:52 +0200 Subject: ieee1394: nodemgr: fix startup of knodemgrd Revert a thinko in commit d2f119fe319528da8c76a1107459d6f478cbf28c: When knodemgrd starts, it needs to sleep until host->generation was incremented above its initial value of 0. My wrong logic caused it to start sending requests when the bus wasn't completely ready. Seen as "AT dma reset ctx=0, aborting transmission" messages in 2.6.19-rc1. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 3e7974c5744..8e7b83f8448 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -1614,7 +1614,7 @@ static int nodemgr_host_thread(void *__hi) { struct host_info *hi = (struct host_info *)__hi; struct hpsb_host *host = hi->host; - unsigned int g, generation = get_hpsb_generation(host) - 1; + unsigned int g, generation = 0; int i, reset_cycles = 0; /* Setup our device-model entries */ -- cgit v1.2.3 From 0d84438d98777b0f9425d39121c42f47a06878ca Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 14:30:44 +0100 Subject: [PATCH] sparc32 pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/parport/parport_sunbpp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c index d758c90c86a..9793533276e 100644 --- a/drivers/parport/parport_sunbpp.c +++ b/drivers/parport/parport_sunbpp.c @@ -48,7 +48,7 @@ static irqreturn_t parport_sunbpp_interrupt(int irq, void *dev_id) { - parport_generic_irq(irq, (struct parport *) dev_id, regs); + parport_generic_irq(irq, (struct parport *) dev_id); return IRQ_HANDLED; } -- cgit v1.2.3 From 28431146993e0ab3a2a592af8541543fe0cc2c8e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 15:00:12 +0100 Subject: [PATCH] misc arm pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/net/dm9000.c | 2 +- drivers/usb/gadget/dummy_hcd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 3641f3b4a2c..615d2b14efa 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c @@ -346,7 +346,7 @@ static void dm9000_timeout(struct net_device *dev) static void dm9000_poll_controller(struct net_device *dev) { disable_irq(dev->irq); - dm9000_interrupt(dev->irq,dev,NULL); + dm9000_interrupt(dev->irq,dev); enable_irq(dev->irq); } #endif diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 4d2946e540c..f1f32d7be5f 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -1551,7 +1551,7 @@ return_urb: ep->already_seen = ep->setup_stage = 0; spin_unlock (&dum->lock); - usb_hcd_giveback_urb (dummy_to_hcd(dum), urb, NULL); + usb_hcd_giveback_urb (dummy_to_hcd(dum), urb); spin_lock (&dum->lock); goto restart; -- cgit v1.2.3 From 9da3b1ad7b074effd56729f9fc01cc5abf6503cc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Oct 2006 15:00:44 +0100 Subject: [PATCH] misc ppc pt_regs fixes Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/macintosh/macio-adb.c | 2 +- drivers/net/mv643xx_eth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c index 57ccc19cbdb..797cef72258 100644 --- a/drivers/macintosh/macio-adb.c +++ b/drivers/macintosh/macio-adb.c @@ -270,6 +270,6 @@ static void macio_adb_poll(void) local_irq_save(flags); if (in_8(&adb->intr.r) != 0) - macio_adb_interrupt(0, NULL, NULL); + macio_adb_interrupt(0, NULL); local_irq_restore(flags); } diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index d26a819a973..2ffa3a59e70 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -1251,7 +1251,7 @@ static void mv643xx_netpoll(struct net_device *netdev) /* wait for previous write to complete */ mv_read(MV643XX_ETH_INTERRUPT_MASK_REG(port_num)); - mv643xx_eth_int_handler(netdev->irq, netdev, NULL); + mv643xx_eth_int_handler(netdev->irq, netdev); mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), ETH_INT_UNMASK_ALL); } -- cgit v1.2.3 From 97c4965d970587a1cc4264c1cffbf0ea9c1e35e8 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 20:29:03 +0100 Subject: [PATCH] mos7840 annotations __user annotations, NULL noise removal, %p use for pointers Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/usb/serial/mos7840.c | 46 +++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 30 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 2306d493e55..021be39fe16 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -1087,7 +1087,7 @@ static int mos7840_open(struct usb_serial_port *port, struct file *filp) mos7840_port->icount.tx = 0; mos7840_port->icount.rx = 0; - dbg("\n\nusb_serial serial:%x mos7840_port:%x\n usb_serial_port port:%x\n\n", (unsigned int)serial, (unsigned int)mos7840_port, (unsigned int)port); + dbg("\n\nusb_serial serial:%p mos7840_port:%p\n usb_serial_port port:%p\n\n", serial, mos7840_port, port); return 0; @@ -1420,7 +1420,6 @@ static int mos7840_write(struct usb_serial_port *port, int i; int bytes_sent = 0; int transfer_size; - int from_user = 0; struct moschip_port *mos7840_port; struct usb_serial *serial; @@ -1511,15 +1510,7 @@ static int mos7840_write(struct usb_serial_port *port, } transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE); - if (from_user) { - if (copy_from_user - (urb->transfer_buffer, current_position, transfer_size)) { - bytes_sent = -EFAULT; - goto exit; - } - } else { - memcpy(urb->transfer_buffer, current_position, transfer_size); - } + memcpy(urb->transfer_buffer, current_position, transfer_size); /* fill urb with data and submit */ usb_fill_bulk_urb(urb, @@ -2225,7 +2216,7 @@ static void mos7840_set_termios(struct usb_serial_port *port, *****************************************************************************/ static int mos7840_get_lsr_info(struct moschip_port *mos7840_port, - unsigned int *value) + unsigned int __user *value) { int count; unsigned int result = 0; @@ -2248,7 +2239,7 @@ static int mos7840_get_lsr_info(struct moschip_port *mos7840_port, *****************************************************************************/ static int mos7840_get_bytes_avail(struct moschip_port *mos7840_port, - unsigned int *value) + unsigned int __user *value) { unsigned int result = 0; struct tty_struct *tty = mos7840_port->port->tty; @@ -2271,7 +2262,7 @@ static int mos7840_get_bytes_avail(struct moschip_port *mos7840_port, *****************************************************************************/ static int mos7840_set_modem_info(struct moschip_port *mos7840_port, - unsigned int cmd, unsigned int *value) + unsigned int cmd, unsigned int __user *value) { unsigned int mcr; unsigned int arg; @@ -2341,7 +2332,7 @@ static int mos7840_set_modem_info(struct moschip_port *mos7840_port, *****************************************************************************/ static int mos7840_get_modem_info(struct moschip_port *mos7840_port, - unsigned int *value) + unsigned int __user *value) { unsigned int result = 0; __u16 msr; @@ -2370,7 +2361,7 @@ static int mos7840_get_modem_info(struct moschip_port *mos7840_port, *****************************************************************************/ static int mos7840_get_serial_info(struct moschip_port *mos7840_port, - struct serial_struct *retinfo) + struct serial_struct __user *retinfo) { struct serial_struct tmp; @@ -2405,6 +2396,7 @@ static int mos7840_get_serial_info(struct moschip_port *mos7840_port, static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) { + void __user *argp = (void __user *)arg; struct moschip_port *mos7840_port; struct tty_struct *tty; @@ -2433,16 +2425,13 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, case TIOCINQ: dbg("%s (%d) TIOCINQ", __FUNCTION__, port->number); - return mos7840_get_bytes_avail(mos7840_port, - (unsigned int *)arg); - break; + return mos7840_get_bytes_avail(mos7840_port, argp); case TIOCOUTQ: dbg("%s (%d) TIOCOUTQ", __FUNCTION__, port->number); return put_user(tty->driver->chars_in_buffer ? tty->driver->chars_in_buffer(tty) : 0, (int __user *)arg); - break; case TCFLSH: retval = tty_check_change(tty); @@ -2472,13 +2461,13 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, case TCGETS: if (kernel_termios_to_user_termios - ((struct termios __user *)arg, tty->termios)) + ((struct termios __user *)argp, tty->termios)) return -EFAULT; return 0; case TIOCSERGETLSR: dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__, port->number); - return mos7840_get_lsr_info(mos7840_port, (unsigned int *)arg); + return mos7840_get_lsr_info(mos7840_port, argp); return 0; case TIOCMBIS: @@ -2487,19 +2476,16 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); mosret = - mos7840_set_modem_info(mos7840_port, cmd, - (unsigned int *)arg); + mos7840_set_modem_info(mos7840_port, cmd, argp); return mosret; case TIOCMGET: dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number); - return mos7840_get_modem_info(mos7840_port, - (unsigned int *)arg); + return mos7840_get_modem_info(mos7840_port, argp); case TIOCGSERIAL: dbg("%s (%d) TIOCGSERIAL", __FUNCTION__, port->number); - return mos7840_get_serial_info(mos7840_port, - (struct serial_struct *)arg); + return mos7840_get_serial_info(mos7840_port, argp); case TIOCSSERIAL: dbg("%s (%d) TIOCSSERIAL", __FUNCTION__, port->number); @@ -2549,7 +2535,7 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__, port->number, icount.rx, icount.tx); - if (copy_to_user((void *)arg, &icount, sizeof(icount))) + if (copy_to_user(argp, &icount, sizeof(icount))) return -EFAULT; return 0; @@ -2817,7 +2803,7 @@ static int mos7840_startup(struct usb_serial *serial) /* setting configuration feature to one */ usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), - (__u8) 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 5 * HZ); + (__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5 * HZ); return 0; } -- cgit v1.2.3 From e069d79d23739977800c3b8495853b735f77ef30 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 9 Oct 2006 20:29:43 +0100 Subject: [PATCH] tifm __iomem annotations, NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/misc/tifm_7xx1.c | 13 +++++++------ drivers/misc/tifm_core.c | 2 +- drivers/mmc/tifm_sd.c | 14 +++++++------- 3 files changed, 15 insertions(+), 14 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c index b1748669e05..1ba8754e938 100644 --- a/drivers/misc/tifm_7xx1.c +++ b/drivers/misc/tifm_7xx1.c @@ -48,7 +48,7 @@ static void tifm_7xx1_remove_media(void *adapter) printk(KERN_INFO DRIVER_NAME ": demand removing card from socket %d\n", cnt); sock = fm->sockets[cnt]; - fm->sockets[cnt] = 0; + fm->sockets[cnt] = NULL; fm->remove_mask &= ~(1 << cnt); writel(0x0e00, sock->addr + SOCK_CONTROL); @@ -118,7 +118,7 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static tifm_media_id tifm_7xx1_toggle_sock_power(char *sock_addr, int is_x2) +static tifm_media_id tifm_7xx1_toggle_sock_power(char __iomem *sock_addr, int is_x2) { unsigned int s_state; int cnt; @@ -163,7 +163,8 @@ static tifm_media_id tifm_7xx1_toggle_sock_power(char *sock_addr, int is_x2) return (readl(sock_addr + SOCK_PRESENT_STATE) >> 4) & 7; } -inline static char *tifm_7xx1_sock_addr(char *base_addr, unsigned int sock_num) +inline static char __iomem * +tifm_7xx1_sock_addr(char __iomem *base_addr, unsigned int sock_num) { return base_addr + ((sock_num + 1) << 10); } @@ -176,7 +177,7 @@ static void tifm_7xx1_insert_media(void *adapter) char *card_name = "xx"; int cnt, ok_to_register; unsigned int insert_mask; - struct tifm_dev *new_sock = 0; + struct tifm_dev *new_sock = NULL; if (!class_device_get(&fm->cdev)) return; @@ -230,7 +231,7 @@ static void tifm_7xx1_insert_media(void *adapter) if (!ok_to_register || device_register(&new_sock->dev)) { spin_lock_irqsave(&fm->lock, flags); - fm->sockets[cnt] = 0; + fm->sockets[cnt] = NULL; spin_unlock_irqrestore(&fm->lock, flags); tifm_free_device(&new_sock->dev); @@ -390,7 +391,7 @@ static void tifm_7xx1_remove(struct pci_dev *dev) tifm_remove_adapter(fm); - pci_set_drvdata(dev, 0); + pci_set_drvdata(dev, NULL); iounmap(fm->addr); pci_intx(dev, 0); diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c index cca5f852246..ee326136d03 100644 --- a/drivers/misc/tifm_core.c +++ b/drivers/misc/tifm_core.c @@ -157,7 +157,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id) dev->wq = create_singlethread_workqueue(dev->wq_name); if (!dev->wq) { kfree(dev); - return 0; + return NULL; } dev->dev.parent = fm->dev; dev->dev.bus = &tifm_bus_type; diff --git a/drivers/mmc/tifm_sd.c b/drivers/mmc/tifm_sd.c index 6d23dc08d16..2bacff60913 100644 --- a/drivers/mmc/tifm_sd.c +++ b/drivers/mmc/tifm_sd.c @@ -501,13 +501,13 @@ static void tifm_sd_end_cmd(void *data) struct tifm_dev *sock = host->dev; struct mmc_host *mmc = tifm_get_drvdata(sock); struct mmc_request *mrq; - struct mmc_data *r_data = 0; + struct mmc_data *r_data = NULL; unsigned long flags; spin_lock_irqsave(&sock->lock, flags); mrq = host->req; - host->req = 0; + host->req = NULL; host->state = IDLE; if (!mrq) { @@ -546,7 +546,7 @@ static void tifm_sd_request_nodma(struct mmc_host *mmc, struct mmc_request *mrq) struct tifm_dev *sock = host->dev; unsigned long flags; struct mmc_data *r_data = mrq->cmd->data; - char *t_buffer = 0; + char *t_buffer = NULL; if (r_data) { t_buffer = kmap(r_data->sg->page); @@ -613,13 +613,13 @@ static void tifm_sd_end_cmd_nodma(void *data) struct tifm_dev *sock = host->dev; struct mmc_host *mmc = tifm_get_drvdata(sock); struct mmc_request *mrq; - struct mmc_data *r_data = 0; + struct mmc_data *r_data = NULL; unsigned long flags; spin_lock_irqsave(&sock->lock, flags); mrq = host->req; - host->req = 0; + host->req = NULL; host->state = IDLE; if (!mrq) { @@ -644,7 +644,7 @@ static void tifm_sd_end_cmd_nodma(void *data) r_data->bytes_xfered += r_data->blksz - readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1; } - host->buffer = 0; + host->buffer = NULL; host->buffer_pos = 0; host->buffer_size = 0; } @@ -895,7 +895,7 @@ static void tifm_sd_remove(struct tifm_dev *sock) sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); writel(0, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); - tifm_set_drvdata(sock, 0); + tifm_set_drvdata(sock, NULL); mmc_free_host(mmc); } -- cgit v1.2.3 From da96d0b58adddf3bdeaa9644ac74f0dcc9039407 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:22:37 +0200 Subject: [PATCH] m68k/HP300: Enable HIL configuration options Enable HIL configuration options on HP300 Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- drivers/input/keyboard/Kconfig | 4 ++-- drivers/input/misc/Kconfig | 2 +- drivers/input/mouse/Kconfig | 2 +- drivers/input/serio/Kconfig | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 679bde34d24..81a333f7301 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -166,7 +166,7 @@ config KEYBOARD_AMIGA config KEYBOARD_HIL_OLD tristate "HP HIL keyboard support (simple driver)" - depends on GSC + depends on GSC || HP300 default y help The "Human Interface Loop" is a older, 8-channel USB-like @@ -183,7 +183,7 @@ config KEYBOARD_HIL_OLD config KEYBOARD_HIL tristate "HP HIL keyboard support" - depends on GSC + depends on GSC || HP300 default y select HP_SDC select HIL_MLC diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index a6dfc745573..ba0e88c64e1 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -73,7 +73,7 @@ config INPUT_UINPUT config HP_SDC_RTC tristate "HP SDC Real Time Clock" - depends on GSC + depends on GSC || HP300 select HP_SDC help Say Y here if you want to support the built-in real time clock diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index f15ccf78168..35d998c3e57 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig @@ -119,7 +119,7 @@ config MOUSE_VSXXXAA config MOUSE_HIL tristate "HIL pointers (mice etc)." - depends on GSC + depends on GSC || HP300 select HP_SDC select HIL_MLC help diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig index 8cdbfeca590..adef447f23e 100644 --- a/drivers/input/serio/Kconfig +++ b/drivers/input/serio/Kconfig @@ -112,7 +112,7 @@ config SERIO_GSCPS2 config HP_SDC tristate "HP System Device Controller i8042 Support" - depends on GSC && SERIO + depends on (GSC || HP300) && SERIO default y ---help--- This option enables support for the "System Device -- cgit v1.2.3 From ea62aa1b6f6d31b53a34a6f5271ed85735ccc0bc Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:27:42 +0200 Subject: [PATCH] m68k/MVME167: SERIAL167 is no longer broken - SERIAL167 is no longer broken - Removed some unused variables from the driver to fix compiler warnings Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- drivers/char/serial167.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers') diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 6f13f98e317..defc0dbdedb 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -1422,7 +1422,6 @@ cy_tiocmget(struct tty_struct *tty, struct file *file) volatile unsigned char *base_addr = (u_char *)BASE_ADDR; unsigned long flags; unsigned char status; - unsigned int result; channel = info->line; @@ -1446,7 +1445,6 @@ cy_tiocmset(struct tty_struct *tty, struct file *file, int channel; volatile unsigned char *base_addr = (u_char *)BASE_ADDR; unsigned long flags; - unsigned int arg; channel = info->line; -- cgit v1.2.3 From 81e859ac1eef300c1b2ff49a2f2da8ee4ce1e844 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 9 Oct 2006 22:27:42 +0200 Subject: [PATCH] m68k/MVME167: SERIAL167 tty flip buffer updates Compile fixes related to changed tty flip buffer handling. Signed-off-by: Kars de Jong Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds --- drivers/char/serial167.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index defc0dbdedb..461bfe0234c 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -427,8 +428,9 @@ cd2401_rxerr_interrupt(int irq, void *dev_id) overflowing, we still loose the next incoming character. */ - tty_insert_flip_char(tty, data, TTY_NORMAL); - } + if (tty_buffer_request_room(tty, 1) != 0){ + tty_insert_flip_char(tty, data, TTY_FRAME); + } /* These two conditions may imply */ /* a normal read should be done. */ /* else if(data & CyTIMEOUT) */ @@ -437,14 +439,14 @@ cd2401_rxerr_interrupt(int irq, void *dev_id) tty_insert_flip_char(tty, 0, TTY_NORMAL); } }else{ - tty_insert_flip_char(tty, data, TTY_NORMAL); + tty_insert_flip_char(tty, data, TTY_NORMAL); } }else{ /* there was a software buffer overrun and nothing could be done about it!!! */ } } - schedule_delayed_work(&tty->flip.work, 1); + tty_schedule_flip(tty); /* end of service */ base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; return IRQ_HANDLED; @@ -635,6 +637,7 @@ cd2401_rx_interrupt(int irq, void *dev_id) char data; int char_count; int save_cnt; + int len; /* determine the channel and change to that context */ channel = (u_short ) (base_addr[CyLICR] >> 2); @@ -667,14 +670,15 @@ cd2401_rx_interrupt(int irq, void *dev_id) info->mon.char_max = char_count; info->mon.char_last = char_count; #endif - while(char_count--){ + len = tty_buffer_request_room(tty, char_count); + while(len--){ data = base_addr[CyRDR]; tty_insert_flip_char(tty, data, TTY_NORMAL); #ifdef CYCLOM_16Y_HACK udelay(10L); #endif } - schedule_delayed_work(&tty->flip.work, 1); + tty_schedule_flip(tty); } /* end of service */ base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS; -- cgit v1.2.3 From 18965513fdc3af976f000f231ee216500d707c11 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Oct 2006 23:20:46 +0100 Subject: [MIPS] qtronix: remove driver. Another leftover of removing support for the ITE8172. Signed-off-by: Ralf Baechle --- drivers/char/qtronix.c | 605 ------------------------------------------------- 1 file changed, 605 deletions(-) delete mode 100644 drivers/char/qtronix.c (limited to 'drivers') diff --git a/drivers/char/qtronix.c b/drivers/char/qtronix.c deleted file mode 100644 index 5c9477741a3..00000000000 --- a/drivers/char/qtronix.c +++ /dev/null @@ -1,605 +0,0 @@ -/* - * - * BRIEF MODULE DESCRIPTION - * Qtronix 990P infrared keyboard driver. - * - * - * Copyright 2001 MontaVista Software Inc. - * Author: MontaVista Software, Inc. - * ppopov@mvista.com or source@mvista.com - * - * - * The bottom portion of this driver was take from - * pc_keyb.c Please see that file for copyrights. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NOTE: - * - * This driver has only been tested with the Consumer IR - * port of the ITE 8172 system controller. - * - * You do not need this driver if you are using the ps/2 or - * USB adapter that the keyboard ships with. You only need - * this driver if your board has a IR port and the keyboard - * data is being sent directly to the IR. In that case, - * you also need some low-level IR support. See it8172_cir.c. - * - */ - -#ifdef CONFIG_QTRONIX_KEYBOARD - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define leading1 0 -#define leading2 0xF - -#define KBD_CIR_PORT 0 -#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in */ - -static int data_index; -struct cir_port *cir; -static unsigned char kbdbytes[5]; -static unsigned char cir_data[32]; /* we only need 16 chars */ - -static void kbd_int_handler(int irq, void *dev_id); -static int handle_data(unsigned char *p_data); -static inline void handle_mouse_event(unsigned char scancode); -static inline void handle_keyboard_event(unsigned char scancode, int down); -static int __init psaux_init(void); - -static struct aux_queue *queue; /* Mouse data buffer. */ -static int aux_count = 0; - -/* - * Keys accessed through the 'Fn' key - * The Fn key does not produce a key-up sequence. So, the first - * time the user presses it, it will be key-down event. The key - * stays down until the user presses it again. - */ -#define NUM_FN_KEYS 56 -static unsigned char fn_keys[NUM_FN_KEYS] = { - 0,0,0,0,0,0,0,0, /* 0 7 */ - 8,9,10,93,0,0,0,0, /* 8 15 */ - 0,0,0,0,0,0,0,5, /* 16 23 */ - 6,7,91,0,0,0,0,0, /* 24 31 */ - 0,0,0,0,0,2,3,4, /* 32 39 */ - 92,0,0,0,0,0,0,0, /* 40 47 */ - 0,0,0,0,11,0,94,95 /* 48 55 */ - -}; - -void __init init_qtronix_990P_kbd(void) -{ - int retval; - - cir = (struct cir_port *)kmalloc(sizeof(struct cir_port), GFP_KERNEL); - if (!cir) { - printk("Unable to initialize Qtronix keyboard\n"); - return; - } - - /* - * revisit - * this should be programmable, somehow by the, by the user. - */ - cir->port = KBD_CIR_PORT; - cir->baud_rate = 0x1d; - cir->rdwos = 0; - cir->rxdcr = 0x3; - cir->hcfs = 0; - cir->fifo_tl = 0; - cir->cfq = 0x1d; - cir_port_init(cir); - - retval = request_irq(IT8172_CIR0_IRQ, kbd_int_handler, - (unsigned long )(IRQF_DISABLED|IRQF_SHARED), - (const char *)"Qtronix IR Keyboard", (void *)cir); - - if (retval) { - printk("unable to allocate cir %d irq %d\n", - cir->port, IT8172_CIR0_IRQ); - } -#ifdef CONFIG_PSMOUSE - psaux_init(); -#endif -} - -static inline unsigned char BitReverse(unsigned short key) -{ - unsigned char rkey = 0; - rkey |= (key & 0x1) << 7; - rkey |= (key & 0x2) << 5; - rkey |= (key & 0x4) << 3; - rkey |= (key & 0x8) << 1; - rkey |= (key & 0x10) >> 1; - rkey |= (key & 0x20) >> 3; - rkey |= (key & 0x40) >> 5; - rkey |= (key & 0x80) >> 7; - return rkey; - -} - - -static inline u_int8_t UpperByte(u_int8_t data) -{ - return (data >> 4); -} - - -static inline u_int8_t LowerByte(u_int8_t data) -{ - return (data & 0xF); -} - - -int CheckSumOk(u_int8_t byte1, u_int8_t byte2, - u_int8_t byte3, u_int8_t byte4, u_int8_t byte5) -{ - u_int8_t CheckSum; - - CheckSum = (byte1 & 0x0F) + byte2 + byte3 + byte4 + byte5; - if ( LowerByte(UpperByte(CheckSum) + LowerByte(CheckSum)) != UpperByte(byte1) ) - return 0; - else - return 1; -} - - -static void kbd_int_handler(int irq, void *dev_id) -{ - struct cir_port *cir; - int j; - unsigned char int_status; - - cir = (struct cir_port *)dev_id; - int_status = get_int_status(cir); - if (int_status & 0x4) { - clear_fifo(cir); - return; - } - - while (cir_get_rx_count(cir)) { - - cir_data[data_index] = cir_read_data(cir); - - if (data_index == 0) {/* expecting first byte */ - if (cir_data[data_index] != leading1) { - //printk("!leading byte %x\n", cir_data[data_index]); - set_rx_active(cir); - clear_fifo(cir); - continue; - } - } - if (data_index == 1) { - if ((cir_data[data_index] & 0xf) != leading2) { - set_rx_active(cir); - data_index = 0; /* start over */ - clear_fifo(cir); - continue; - } - } - - if ( (cir_data[data_index] == 0xff)) { /* last byte */ - //printk("data_index %d\n", data_index); - set_rx_active(cir); -#if 0 - for (j=0; j<=data_index; j++) { - printk("rx_data %d: %x\n", j, cir_data[j]); - } -#endif - data_index = 0; - handle_data(cir_data); - return; - } - else if (data_index>16) { - set_rx_active(cir); -#if 0 - printk("warning: data_index %d\n", data_index); - for (j=0; j<=data_index; j++) { - printk("rx_data %d: %x\n", j, cir_data[j]); - } -#endif - data_index = 0; - clear_fifo(cir); - return; - } - data_index++; - } -} - - -#define NUM_KBD_BYTES 5 -static int handle_data(unsigned char *p_data) -{ - u_int32_t bit_bucket; - u_int32_t i, j; - u_int32_t got_bits, next_byte; - int down = 0; - - /* Reorganize the bit stream */ - for (i=0; i<16; i++) - p_data[i] = BitReverse(~p_data[i]); - - /* - * We've already previously checked that p_data[0] - * is equal to leading1 and that (p_data[1] & 0xf) - * is equal to leading2. These twelve bits are the - * leader code. We can now throw them away (the 12 - * bits) and continue parsing the stream. - */ - bit_bucket = p_data[1] << 12; - got_bits = 4; - next_byte = 2; - - /* - * Process four bits at a time - */ - for (i=0; i> 1); - got_bits -= 4; - bit_bucket = bit_bucket << 4; - } - else if ((bit_bucket & 0xC000) == 0x8000) { - /* Convert 10b to 0 */ - kbdbytes[i] = kbdbytes[i] >> 1; - got_bits -= 2; - bit_bucket = bit_bucket << 2; - } - else { - /* bad serial stream */ - return 1; - } - - if (next_byte > 16) { - //printk("error: too many bytes\n"); - return 1; - } - } - } - - - if (!CheckSumOk(kbdbytes[0], kbdbytes[1], - kbdbytes[2], kbdbytes[3], kbdbytes[4])) { - //printk("checksum failed\n"); - return 1; - } - - if (kbdbytes[1] & 0x08) { - //printk("m: %x %x %x\n", kbdbytes[1], kbdbytes[2], kbdbytes[3]); - handle_mouse_event(kbdbytes[1]); - handle_mouse_event(kbdbytes[2]); - handle_mouse_event(kbdbytes[3]); - } - else { - if (kbdbytes[2] == 0) down = 1; -#if 0 - if (down) - printk("down %d\n", kbdbytes[3]); - else - printk("up %d\n", kbdbytes[3]); -#endif - handle_keyboard_event(kbdbytes[3], down); - } - return 0; -} - - -DEFINE_SPINLOCK(kbd_controller_lock); -static unsigned char handle_kbd_event(void); - - -int kbd_setkeycode(unsigned int scancode, unsigned int keycode) -{ - printk("kbd_setkeycode scancode %x keycode %x\n", scancode, keycode); - return 0; -} - -int kbd_getkeycode(unsigned int scancode) -{ - return scancode; -} - - -int kbd_translate(unsigned char scancode, unsigned char *keycode, - char raw_mode) -{ - static int prev_scancode = 0; - - if (scancode == 0x00 || scancode == 0xff) { - prev_scancode = 0; - return 0; - } - - /* todo */ - if (!prev_scancode && scancode == 160) { /* Fn key down */ - //printk("Fn key down\n"); - prev_scancode = 160; - return 0; - } - else if (prev_scancode && scancode == 160) { /* Fn key up */ - //printk("Fn key up\n"); - prev_scancode = 0; - return 0; - } - - /* todo */ - if (prev_scancode == 160) { - if (scancode <= NUM_FN_KEYS) { - *keycode = fn_keys[scancode]; - //printk("fn keycode %d\n", *keycode); - } - else - return 0; - } - else if (scancode <= 127) { - *keycode = scancode; - } - else - return 0; - - - return 1; -} - -char kbd_unexpected_up(unsigned char keycode) -{ - //printk("kbd_unexpected_up\n"); - return 0; -} - -static unsigned char kbd_exists = 1; - -static inline void handle_keyboard_event(unsigned char scancode, int down) -{ - kbd_exists = 1; - handle_scancode(scancode, down); - tasklet_schedule(&keyboard_tasklet); -} - - -void kbd_leds(unsigned char leds) -{ -} - -/* dummy */ -void kbd_init_hw(void) -{ -} - - - -static inline void handle_mouse_event(unsigned char scancode) -{ - if(scancode == AUX_RECONNECT){ - queue->head = queue->tail = 0; /* Flush input queue */ - // __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ - return; - } - - if (aux_count) { - int head = queue->head; - - queue->buf[head] = scancode; - head = (head + 1) & (AUX_BUF_SIZE-1); - if (head != queue->tail) { - queue->head = head; - kill_fasync(&queue->fasync, SIGIO, POLL_IN); - wake_up_interruptible(&queue->proc_list); - } - } -} - -static unsigned char get_from_queue(void) -{ - unsigned char result; - unsigned long flags; - - spin_lock_irqsave(&kbd_controller_lock, flags); - result = queue->buf[queue->tail]; - queue->tail = (queue->tail + 1) & (AUX_BUF_SIZE-1); - spin_unlock_irqrestore(&kbd_controller_lock, flags); - return result; -} - - -static inline int queue_empty(void) -{ - return queue->head == queue->tail; -} - -static int fasync_aux(int fd, struct file *filp, int on) -{ - int retval; - - //printk("fasync_aux\n"); - retval = fasync_helper(fd, filp, on, &queue->fasync); - if (retval < 0) - return retval; - return 0; -} - - -/* - * Random magic cookie for the aux device - */ -#define AUX_DEV ((void *)queue) - -static int release_aux(struct inode * inode, struct file * file) -{ - fasync_aux(-1, file, 0); - aux_count--; - return 0; -} - -static int open_aux(struct inode * inode, struct file * file) -{ - if (aux_count++) { - return 0; - } - queue->head = queue->tail = 0; /* Flush input queue */ - return 0; -} - -/* - * Put bytes from input queue to buffer. - */ - -static ssize_t read_aux(struct file * file, char * buffer, - size_t count, loff_t *ppos) -{ - DECLARE_WAITQUEUE(wait, current); - ssize_t i = count; - unsigned char c; - - if (queue_empty()) { - if (file->f_flags & O_NONBLOCK) - return -EAGAIN; - add_wait_queue(&queue->proc_list, &wait); -repeat: - set_current_state(TASK_INTERRUPTIBLE); - if (queue_empty() && !signal_pending(current)) { - schedule(); - goto repeat; - } - current->state = TASK_RUNNING; - remove_wait_queue(&queue->proc_list, &wait); - } - while (i > 0 && !queue_empty()) { - c = get_from_queue(); - put_user(c, buffer++); - i--; - } - if (count-i) { - struct inode *inode = file->f_dentry->d_inode; - inode->i_atime = current_fs_time(inode->i_sb); - return count-i; - } - if (signal_pending(current)) - return -ERESTARTSYS; - return 0; -} - -/* - * Write to the aux device. - */ - -static ssize_t write_aux(struct file * file, const char * buffer, - size_t count, loff_t *ppos) -{ - /* - * The ITE boards this was tested on did not have the - * transmit wires connected. - */ - return count; -} - -static unsigned int aux_poll(struct file *file, poll_table * wait) -{ - poll_wait(file, &queue->proc_list, wait); - if (!queue_empty()) - return POLLIN | POLLRDNORM; - return 0; -} - -struct file_operations psaux_fops = { - .read = read_aux, - .write = write_aux, - .poll = aux_poll, - .open = open_aux, - .release = release_aux, - .fasync = fasync_aux, -}; - -/* - * Initialize driver. - */ -static struct miscdevice psaux_mouse = { - PSMOUSE_MINOR, "psaux", &psaux_fops -}; - -static int __init psaux_init(void) -{ - int retval; - - retval = misc_register(&psaux_mouse); - if(retval < 0) - return retval; - - queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL); - if (!queue) { - misc_deregister(&psaux_mouse); - return -ENOMEM; - } - - memset(queue, 0, sizeof(*queue)); - queue->head = queue->tail = 0; - init_waitqueue_head(&queue->proc_list); - - return 0; -} -module_init(init_qtronix_990P_kbd); -#endif -- cgit v1.2.3 From 12a0a703b3f07e5b01c81fe4f5d2a221c9318f16 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 9 Oct 2006 23:20:47 +0100 Subject: [RTC] Consistently use of tabs for formatting. --- drivers/char/rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index abee7a33946..66a7385bc34 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -35,13 +35,13 @@ * 1.09a Pete Zaitcev: Sun SPARC * 1.09b Jeff Garzik: Modularize, init cleanup * 1.09c Jeff Garzik: SMP cleanup - * 1.10 Paul Barton-Davis: add support for async I/O + * 1.10 Paul Barton-Davis: add support for async I/O * 1.10a Andrea Arcangeli: Alpha updates * 1.10b Andrew Morton: SMP lock fix * 1.10c Cesar Barros: SMP locking fixes and cleanup * 1.10d Paul Gortmaker: delete paranoia check in rtc_exit * 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness. - * 1.11 Takashi Iwai: Kernel access functions + * 1.11 Takashi Iwai: Kernel access functions * rtc_register/rtc_unregister/rtc_control * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer -- cgit v1.2.3 From 9f2545c11869868fd3cde7098d99e690891e442c Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Tue, 10 Oct 2006 11:45:45 +1000 Subject: [POWERPC] Fix i2c-powermac platform device usage i2c-powermac was written & merged right after Russell King's changes adding platform_driver... which I missed. Thus it still used struct device, causing crashes when hitting sleep/wakeup callbacks (it happened to work by luck so far, until early/late callbacks got added). This causes crashes on sleep/wakeup on PowerBooks with 2.6.19. The patch fixes it by using a proper platform_driver. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- drivers/i2c/busses/i2c-powermac.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index a508cb962d2..648d55533d8 100644 --- a/drivers/i2c/busses/i2c-powermac.c +++ b/drivers/i2c/busses/i2c-powermac.c @@ -182,9 +182,9 @@ static const struct i2c_algorithm i2c_powermac_algorithm = { }; -static int i2c_powermac_remove(struct device *dev) +static int i2c_powermac_remove(struct platform_device *dev) { - struct i2c_adapter *adapter = dev_get_drvdata(dev); + struct i2c_adapter *adapter = platform_get_drvdata(dev); struct pmac_i2c_bus *bus = i2c_get_adapdata(adapter); int rc; @@ -195,16 +195,16 @@ static int i2c_powermac_remove(struct device *dev) if (rc) printk("i2c-powermac.c: Failed to remove bus %s !\n", adapter->name); - dev_set_drvdata(dev, NULL); + platform_set_drvdata(dev, NULL); kfree(adapter); return 0; } -static int i2c_powermac_probe(struct device *dev) +static int __devexit i2c_powermac_probe(struct platform_device *dev) { - struct pmac_i2c_bus *bus = dev->platform_data; + struct pmac_i2c_bus *bus = dev->dev.platform_data; struct device_node *parent = NULL; struct i2c_adapter *adapter; char name[32]; @@ -246,11 +246,11 @@ static int i2c_powermac_probe(struct device *dev) printk(KERN_ERR "i2c-powermac: can't allocate inteface !\n"); return -ENOMEM; } - dev_set_drvdata(dev, adapter); + platform_set_drvdata(dev, adapter); strcpy(adapter->name, name); adapter->algo = &i2c_powermac_algorithm; i2c_set_adapdata(adapter, bus); - adapter->dev.parent = dev; + adapter->dev.parent = &dev->dev; pmac_i2c_attach_adapter(bus, adapter); rc = i2c_add_adapter(adapter); if (rc) { @@ -265,23 +265,25 @@ static int i2c_powermac_probe(struct device *dev) } -static struct device_driver i2c_powermac_driver = { - .name = "i2c-powermac", - .bus = &platform_bus_type, +static struct platform_driver i2c_powermac_driver = { .probe = i2c_powermac_probe, - .remove = i2c_powermac_remove, + .remove = __devexit_p(i2c_powermac_remove), + .driver = { + .name = "i2c-powermac", + .bus = &platform_bus_type, + }, }; static int __init i2c_powermac_init(void) { - driver_register(&i2c_powermac_driver); + platform_driver_register(&i2c_powermac_driver); return 0; } static void __exit i2c_powermac_cleanup(void) { - driver_unregister(&i2c_powermac_driver); + platform_driver_unregister(&i2c_powermac_driver); } module_init(i2c_powermac_init); -- cgit v1.2.3 From 10270613fb4d5a44c335cfa13e9626bf5743c01d Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Tue, 10 Oct 2006 11:47:31 +1000 Subject: [POWERPC] Fix windfarm platform device usage The windfarm code uses a struct device_driver instead of platform_driver, which can cause crashes if any of the callbacks are called (like on module removal). This fixes it. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- drivers/macintosh/windfarm_pm112.c | 18 ++++++++++-------- drivers/macintosh/windfarm_pm81.c | 24 ++++++++++-------------- drivers/macintosh/windfarm_pm91.c | 24 ++++++++++-------------- 3 files changed, 30 insertions(+), 36 deletions(-) (limited to 'drivers') diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c index ef66bf2778e..fa4b13f8936 100644 --- a/drivers/macintosh/windfarm_pm112.c +++ b/drivers/macintosh/windfarm_pm112.c @@ -650,24 +650,26 @@ static struct notifier_block pm112_events = { .notifier_call = pm112_wf_notify, }; -static int wf_pm112_probe(struct device *dev) +static int wf_pm112_probe(struct platform_device *dev) { wf_register_client(&pm112_events); return 0; } -static int wf_pm112_remove(struct device *dev) +static int __devexit wf_pm112_remove(struct platform_device *dev) { wf_unregister_client(&pm112_events); /* should release all sensors and controls */ return 0; } -static struct device_driver wf_pm112_driver = { - .name = "windfarm", - .bus = &platform_bus_type, +static struct platform_driver wf_pm112_driver = { .probe = wf_pm112_probe, - .remove = wf_pm112_remove, + .remove = __devexit_p(wf_pm112_remove), + .driver = { + .name = "windfarm", + .bus = &platform_bus_type, + }, }; static int __init wf_pm112_init(void) @@ -683,13 +685,13 @@ static int __init wf_pm112_init(void) ++nr_cores; printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n"); - driver_register(&wf_pm112_driver); + platform_driver_register(&wf_pm112_driver); return 0; } static void __exit wf_pm112_exit(void) { - driver_unregister(&wf_pm112_driver); + platform_driver_unregister(&wf_pm112_driver); } module_init(wf_pm112_init); diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c index 2ff546e4c92..2a944851b8e 100644 --- a/drivers/macintosh/windfarm_pm81.c +++ b/drivers/macintosh/windfarm_pm81.c @@ -131,8 +131,6 @@ static int wf_smu_mach_model; /* machine model id */ -static struct device *wf_smu_dev; - /* Controls & sensors */ static struct wf_sensor *sensor_cpu_power; static struct wf_sensor *sensor_cpu_temp; @@ -717,16 +715,14 @@ static int wf_init_pm(void) return 0; } -static int wf_smu_probe(struct device *ddev) +static int wf_smu_probe(struct platform_device *ddev) { - wf_smu_dev = ddev; - wf_register_client(&wf_smu_events); return 0; } -static int wf_smu_remove(struct device *ddev) +static int __devexit wf_smu_remove(struct platform_device *ddev) { wf_unregister_client(&wf_smu_events); @@ -766,16 +762,16 @@ static int wf_smu_remove(struct device *ddev) if (wf_smu_cpu_fans) kfree(wf_smu_cpu_fans); - wf_smu_dev = NULL; - return 0; } -static struct device_driver wf_smu_driver = { - .name = "windfarm", - .bus = &platform_bus_type, +static struct platform_driver wf_smu_driver = { .probe = wf_smu_probe, - .remove = wf_smu_remove, + .remove = __devexit_p(wf_smu_remove), + .driver = { + .name = "windfarm", + .bus = &platform_bus_type, + }, }; @@ -794,7 +790,7 @@ static int __init wf_smu_init(void) request_module("windfarm_lm75_sensor"); #endif /* MODULE */ - driver_register(&wf_smu_driver); + platform_driver_register(&wf_smu_driver); } return rc; @@ -803,7 +799,7 @@ static int __init wf_smu_init(void) static void __exit wf_smu_exit(void) { - driver_unregister(&wf_smu_driver); + platform_driver_unregister(&wf_smu_driver); } diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c index 59e9ffe37c3..9961a67b4f8 100644 --- a/drivers/macintosh/windfarm_pm91.c +++ b/drivers/macintosh/windfarm_pm91.c @@ -63,8 +63,6 @@ */ #undef HACKED_OVERTEMP -static struct device *wf_smu_dev; - /* Controls & sensors */ static struct wf_sensor *sensor_cpu_power; static struct wf_sensor *sensor_cpu_temp; @@ -641,16 +639,14 @@ static int wf_init_pm(void) return 0; } -static int wf_smu_probe(struct device *ddev) +static int wf_smu_probe(struct platform_device *ddev) { - wf_smu_dev = ddev; - wf_register_client(&wf_smu_events); return 0; } -static int wf_smu_remove(struct device *ddev) +static int __devexit wf_smu_remove(struct platform_device *ddev) { wf_unregister_client(&wf_smu_events); @@ -698,16 +694,16 @@ static int wf_smu_remove(struct device *ddev) if (wf_smu_cpu_fans) kfree(wf_smu_cpu_fans); - wf_smu_dev = NULL; - return 0; } -static struct device_driver wf_smu_driver = { - .name = "windfarm", - .bus = &platform_bus_type, +static struct platform_driver wf_smu_driver = { .probe = wf_smu_probe, - .remove = wf_smu_remove, + .remove = __devexit_p(wf_smu_remove), + .driver = { + .name = "windfarm", + .bus = &platform_bus_type, + }, }; @@ -725,7 +721,7 @@ static int __init wf_smu_init(void) request_module("windfarm_lm75_sensor"); #endif /* MODULE */ - driver_register(&wf_smu_driver); + platform_driver_register(&wf_smu_driver); } return rc; @@ -734,7 +730,7 @@ static int __init wf_smu_init(void) static void __exit wf_smu_exit(void) { - driver_unregister(&wf_smu_driver); + platform_driver_unregister(&wf_smu_driver); } -- cgit v1.2.3 From e52e6080ca10e0a8ce2a35c86965945cdfa8ed7e Mon Sep 17 00:00:00 2001 From: Tom Tucker Date: Tue, 3 Oct 2006 09:46:41 -0500 Subject: RDMA/amso1100: Add spinlocks to serialize ib_post_send/ib_post_recv The AMSO driver was not thread-safe in the post WR code and had code that would sleep if the WR post FIFO was full. Since these functions can be called on interrupt level I changed the sleep to a udelay. Signed-off-by: Tom Tucker Signed-off-by: Roland Dreier --- drivers/infiniband/hw/amso1100/c2_qp.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c index 12261132b07..5bcf697aa33 100644 --- a/drivers/infiniband/hw/amso1100/c2_qp.c +++ b/drivers/infiniband/hw/amso1100/c2_qp.c @@ -35,6 +35,8 @@ * */ +#include + #include "c2.h" #include "c2_vq.h" #include "c2_status.h" @@ -705,10 +707,8 @@ static inline void c2_activity(struct c2_dev *c2dev, u32 mq_index, u16 shared) * cannot get on the bus and the card and system hang in a * deadlock -- thus the need for this code. [TOT] */ - while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(0); - } + while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) + udelay(10); __raw_writel(C2_HINT_MAKE(mq_index, shared), c2dev->regs + PCI_BAR0_ADAPTER_HINT); @@ -766,6 +766,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, struct c2_dev *c2dev = to_c2dev(ibqp->device); struct c2_qp *qp = to_c2qp(ibqp); union c2wr wr; + unsigned long lock_flags; int err = 0; u32 flags; @@ -881,8 +882,10 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, /* * Post the puppy! */ + spin_lock_irqsave(&qp->lock, lock_flags); err = qp_wr_post(&qp->sq_mq, &wr, qp, msg_size); if (err) { + spin_unlock_irqrestore(&qp->lock, lock_flags); break; } @@ -890,6 +893,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr, * Enqueue mq index to activity FIFO. */ c2_activity(c2dev, qp->sq_mq.index, qp->sq_mq.hint_count); + spin_unlock_irqrestore(&qp->lock, lock_flags); ib_wr = ib_wr->next; } @@ -905,6 +909,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, struct c2_dev *c2dev = to_c2dev(ibqp->device); struct c2_qp *qp = to_c2qp(ibqp); union c2wr wr; + unsigned long lock_flags; int err = 0; if (qp->state > IB_QPS_RTS) @@ -945,8 +950,10 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, break; } + spin_lock_irqsave(&qp->lock, lock_flags); err = qp_wr_post(&qp->rq_mq, &wr, qp, qp->rq_mq.msg_size); if (err) { + spin_unlock_irqrestore(&qp->lock, lock_flags); break; } @@ -954,6 +961,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr, * Enqueue mq index to activity FIFO */ c2_activity(c2dev, qp->rq_mq.index, qp->rq_mq.hint_count); + spin_unlock_irqrestore(&qp->lock, lock_flags); ib_wr = ib_wr->next; } -- cgit v1.2.3 From 9b0af401aae336975e620fccdd294bb763424f3f Mon Sep 17 00:00:00 2001 From: Ishai Rabinovitz Date: Tue, 10 Oct 2006 09:51:14 -0700 Subject: IB/srp: Remove redundant memset() scsi_host_alloc() already allocates with kzalloc(), so the struct Scsi_Host is zeroed out, including the private data portion. Remove the redundant memset that zeros this out again in the SRP initiator. Signed-off-by: Ishai Rabinovitz Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/srp/ib_srp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers') diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 44b9e5be668..f1b7a0f2bee 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1708,7 +1708,6 @@ static ssize_t srp_create_target(struct class_device *class_dev, target_host->max_lun = SRP_MAX_LUN; target = host_to_target(target_host); - memset(target, 0, sizeof *target); target->io_class = SRP_REV16A_IB_IO_CLASS; target->scsi_host = target_host; -- cgit v1.2.3 From 01cb9bcbd34b7ba768a7f05375faf43becdb8a60 Mon Sep 17 00:00:00 2001 From: Ishai Rabinovitz Date: Wed, 4 Oct 2006 15:28:56 +0200 Subject: IB/srp: Enable multiple connections to the same target Enable multiple concurrent connections to the same SRP target: 1) Use port GUID instead of node GUID in the initiator port identifier. This allows connections to be made from multiple HCA ports at the same time. 2) Let the user specify the identifier extention when adding the device. This allows userspace to make multiple connections even from the same port, if it wants too. Without this, only one connection can be made from any given HCA, even if it has multiple ports, because we don't use multi-channel mode, so targets will only allow one connection from a given initiator port ID. Signed-off-by: Ishai Rabinovitz Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/srp/ib_srp.c | 26 +++++++++++++++++--------- drivers/infiniband/ulp/srp/ib_srp.h | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index f1b7a0f2bee..4b09147f438 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -343,29 +343,32 @@ static int srp_send_req(struct srp_target_port *target) */ if (target->io_class == SRP_REV10_IB_IO_CLASS) { memcpy(req->priv.initiator_port_id, - target->srp_host->initiator_port_id + 8, 8); + &target->path.sgid.global.interface_id, 8); memcpy(req->priv.initiator_port_id + 8, - target->srp_host->initiator_port_id, 8); + &target->initiator_ext, 8); memcpy(req->priv.target_port_id, &target->ioc_guid, 8); memcpy(req->priv.target_port_id + 8, &target->id_ext, 8); } else { memcpy(req->priv.initiator_port_id, - target->srp_host->initiator_port_id, 16); + &target->initiator_ext, 8); + memcpy(req->priv.initiator_port_id + 8, + &target->path.sgid.global.interface_id, 8); memcpy(req->priv.target_port_id, &target->id_ext, 8); memcpy(req->priv.target_port_id + 8, &target->ioc_guid, 8); } /* * Topspin/Cisco SRP targets will reject our login unless we - * zero out the first 8 bytes of our initiator port ID. The - * second 8 bytes must be our local node GUID, but we always - * use that anyway. + * zero out the first 8 bytes of our initiator port ID and set + * the second 8 bytes to the local node GUID. */ if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) { printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround " "activated for target GUID %016llx\n", (unsigned long long) be64_to_cpu(target->ioc_guid)); memset(req->priv.initiator_port_id, 0, 8); + memcpy(req->priv.initiator_port_id + 8, + &target->srp_host->dev->dev->node_guid, 8); } status = ib_send_cm_req(target->cm_id, &req->param); @@ -1553,6 +1556,7 @@ enum { SRP_OPT_MAX_SECT = 1 << 5, SRP_OPT_MAX_CMD_PER_LUN = 1 << 6, SRP_OPT_IO_CLASS = 1 << 7, + SRP_OPT_INITIATOR_EXT = 1 << 8, SRP_OPT_ALL = (SRP_OPT_ID_EXT | SRP_OPT_IOC_GUID | SRP_OPT_DGID | @@ -1569,6 +1573,7 @@ static match_table_t srp_opt_tokens = { { SRP_OPT_MAX_SECT, "max_sect=%d" }, { SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" }, { SRP_OPT_IO_CLASS, "io_class=%x" }, + { SRP_OPT_INITIATOR_EXT, "initiator_ext=%s" }, { SRP_OPT_ERR, NULL } }; @@ -1668,6 +1673,12 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) target->io_class = token; break; + case SRP_OPT_INITIATOR_EXT: + p = match_strdup(args); + target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); + kfree(p); + break; + default: printk(KERN_WARNING PFX "unknown parameter or missing value " "'%s' in target creation request\n", p); @@ -1814,9 +1825,6 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port) host->dev = device; host->port = port; - host->initiator_port_id[7] = port; - memcpy(host->initiator_port_id + 8, &device->dev->node_guid, 8); - host->class_dev.class = &srp_class; host->class_dev.dev = device->dev->dma_device; snprintf(host->class_dev.class_id, BUS_ID_SIZE, "srp-%s-%d", diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h index 5b581fb8eb0..d4e35ef5137 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.h +++ b/drivers/infiniband/ulp/srp/ib_srp.h @@ -91,7 +91,6 @@ struct srp_device { }; struct srp_host { - u8 initiator_port_id[16]; struct srp_device *dev; u8 port; struct class_device class_dev; @@ -122,6 +121,7 @@ struct srp_target_port { __be64 id_ext; __be64 ioc_guid; __be64 service_id; + __be64 initiator_ext; u16 io_class; struct srp_host *srp_host; struct Scsi_Host *scsi_host; -- cgit v1.2.3 From a8bf4e7717142b0688a726dd07501a6a7783792a Mon Sep 17 00:00:00 2001 From: Jack Morgenstein Date: Wed, 4 Oct 2006 13:56:34 +0200 Subject: IB/mthca: Query port fix Fill in "max_vl_num" (encoded according to VLCap field in the PortInfo MAD) and "init_type_reply" values in the ib_query_port() verb. Signed-off-by: Jack Morgenstein Signed-off-by: Roland Dreier --- drivers/infiniband/hw/mthca/mthca_provider.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index 981fe2eebdf..fc67f780581 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -179,6 +179,8 @@ static int mthca_query_port(struct ib_device *ibdev, props->max_mtu = out_mad->data[41] & 0xf; props->active_mtu = out_mad->data[36] >> 4; props->subnet_timeout = out_mad->data[51] & 0x1f; + props->max_vl_num = out_mad->data[37] >> 4; + props->init_type_reply = out_mad->data[41] >> 4; out: kfree(in_mad); -- cgit v1.2.3 From 8575329d4f8596519d86830f622d2c30601f3ef3 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 4 Oct 2006 11:29:59 -0700 Subject: IB/cm: Fix timewait crash after module unload If the ib_cm module is unloaded while id's are still in timewait, the CM will destroy the work queue used to process timewait. Once the id's exit timewait, their timers will fire, leading to a crash trying to access the destroyed work queue. We need to track id's that are in timewait, and cancel their deferred work on module unload. Signed-off-by: Sean Hefty Signed-off-by: Roland Dreier --- drivers/infiniband/core/cm.c | 54 +++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 18 deletions(-) (limited to 'drivers') diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index f35fcc4c063..470c482f288 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -75,6 +75,7 @@ static struct ib_cm { struct rb_root remote_sidr_table; struct idr local_id_table; __be32 random_id_operand; + struct list_head timewait_list; struct workqueue_struct *wq; } cm; @@ -112,6 +113,7 @@ struct cm_work { struct cm_timewait_info { struct cm_work work; /* Must be first. */ + struct list_head list; struct rb_node remote_qp_node; struct rb_node remote_id_node; __be64 remote_ca_guid; @@ -647,13 +649,6 @@ static inline int cm_convert_to_ms(int iba_time) static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info) { - unsigned long flags; - - if (!timewait_info->inserted_remote_id && - !timewait_info->inserted_remote_qp) - return; - - spin_lock_irqsave(&cm.lock, flags); if (timewait_info->inserted_remote_id) { rb_erase(&timewait_info->remote_id_node, &cm.remote_id_table); timewait_info->inserted_remote_id = 0; @@ -663,7 +658,6 @@ static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info) rb_erase(&timewait_info->remote_qp_node, &cm.remote_qp_table); timewait_info->inserted_remote_qp = 0; } - spin_unlock_irqrestore(&cm.lock, flags); } static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id) @@ -684,8 +678,12 @@ static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id) static void cm_enter_timewait(struct cm_id_private *cm_id_priv) { int wait_time; + unsigned long flags; + spin_lock_irqsave(&cm.lock, flags); cm_cleanup_timewait(cm_id_priv->timewait_info); + list_add_tail(&cm_id_priv->timewait_info->list, &cm.timewait_list); + spin_unlock_irqrestore(&cm.lock, flags); /* * The cm_id could be destroyed by the user before we exit timewait. @@ -701,9 +699,13 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv) static void cm_reset_to_idle(struct cm_id_private *cm_id_priv) { + unsigned long flags; + cm_id_priv->id.state = IB_CM_IDLE; if (cm_id_priv->timewait_info) { + spin_lock_irqsave(&cm.lock, flags); cm_cleanup_timewait(cm_id_priv->timewait_info); + spin_unlock_irqrestore(&cm.lock, flags); kfree(cm_id_priv->timewait_info); cm_id_priv->timewait_info = NULL; } @@ -1307,6 +1309,7 @@ static struct cm_id_private * cm_match_req(struct cm_work *work, if (timewait_info) { cur_cm_id_priv = cm_get_id(timewait_info->work.local_id, timewait_info->work.remote_id); + cm_cleanup_timewait(cm_id_priv->timewait_info); spin_unlock_irqrestore(&cm.lock, flags); if (cur_cm_id_priv) { cm_dup_req_handler(work, cur_cm_id_priv); @@ -1315,7 +1318,8 @@ static struct cm_id_private * cm_match_req(struct cm_work *work, cm_issue_rej(work->port, work->mad_recv_wc, IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ, NULL, 0); - goto error; + listen_cm_id_priv = NULL; + goto out; } /* Find matching listen request. */ @@ -1323,21 +1327,20 @@ static struct cm_id_private * cm_match_req(struct cm_work *work, req_msg->service_id, req_msg->private_data); if (!listen_cm_id_priv) { + cm_cleanup_timewait(cm_id_priv->timewait_info); spin_unlock_irqrestore(&cm.lock, flags); cm_issue_rej(work->port, work->mad_recv_wc, IB_CM_REJ_INVALID_SERVICE_ID, CM_MSG_RESPONSE_REQ, NULL, 0); - goto error; + goto out; } atomic_inc(&listen_cm_id_priv->refcount); atomic_inc(&cm_id_priv->refcount); cm_id_priv->id.state = IB_CM_REQ_RCVD; atomic_inc(&cm_id_priv->work_count); spin_unlock_irqrestore(&cm.lock, flags); +out: return listen_cm_id_priv; - -error: cm_cleanup_timewait(cm_id_priv->timewait_info); - return NULL; } static int cm_req_handler(struct cm_work *work) @@ -2601,28 +2604,29 @@ static int cm_timewait_handler(struct cm_work *work) { struct cm_timewait_info *timewait_info; struct cm_id_private *cm_id_priv; - unsigned long flags; int ret; timewait_info = (struct cm_timewait_info *)work; - cm_cleanup_timewait(timewait_info); + spin_lock_irq(&cm.lock); + list_del(&timewait_info->list); + spin_unlock_irq(&cm.lock); cm_id_priv = cm_acquire_id(timewait_info->work.local_id, timewait_info->work.remote_id); if (!cm_id_priv) return -EINVAL; - spin_lock_irqsave(&cm_id_priv->lock, flags); + spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_TIMEWAIT || cm_id_priv->remote_qpn != timewait_info->remote_qpn) { - spin_unlock_irqrestore(&cm_id_priv->lock, flags); + spin_unlock_irq(&cm_id_priv->lock); goto out; } cm_id_priv->id.state = IB_CM_IDLE; ret = atomic_inc_and_test(&cm_id_priv->work_count); if (!ret) list_add_tail(&work->list, &cm_id_priv->work_list); - spin_unlock_irqrestore(&cm_id_priv->lock, flags); + spin_unlock_irq(&cm_id_priv->lock); if (ret) cm_process_work(cm_id_priv, work); @@ -3374,6 +3378,7 @@ static int __init ib_cm_init(void) idr_init(&cm.local_id_table); get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand); idr_pre_get(&cm.local_id_table, GFP_KERNEL); + INIT_LIST_HEAD(&cm.timewait_list); cm.wq = create_workqueue("ib_cm"); if (!cm.wq) @@ -3391,7 +3396,20 @@ error: static void __exit ib_cm_cleanup(void) { + struct cm_timewait_info *timewait_info, *tmp; + + spin_lock_irq(&cm.lock); + list_for_each_entry(timewait_info, &cm.timewait_list, list) + cancel_delayed_work(&timewait_info->work.work); + spin_unlock_irq(&cm.lock); + destroy_workqueue(cm.wq); + + list_for_each_entry_safe(timewait_info, tmp, &cm.timewait_list, list) { + list_del(&timewait_info->list); + kfree(timewait_info); + } + ib_unregister_client(&cm_client); idr_destroy(&cm.local_id_table); } -- cgit v1.2.3 From 82a9c16a10521a0ceadbd27a549f6e8d5e70e0ab Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 4 Oct 2006 11:37:25 -0700 Subject: IB/cm: Send DREP in response to unmatched DREQ Currently a DREP is only sent in response to a DREQ if a connection has been found matching the DREQ, and it is in the proper state. Once a DREP is sent, the local connection moves into timewait. Duplicate DREQs received while in this state result in re-sending the DREP. However, it's likely that the local connection will enter and exit timewait before the remote side times out a lost DREP and resends a DREQ. To handle this, we send a DREP in response to a DREQ, even if a local connection is not found. This avoids maintaining disconnected id's in timewait states for excessively long times, just to handle a lost DREP. Signed-off-by: Sean Hefty Signed-off-by: Roland Dreier --- drivers/infiniband/core/cm.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 470c482f288..25b1018a476 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1902,6 +1902,32 @@ out: spin_unlock_irqrestore(&cm_id_priv->lock, flags); } EXPORT_SYMBOL(ib_send_cm_drep); +static int cm_issue_drep(struct cm_port *port, + struct ib_mad_recv_wc *mad_recv_wc) +{ + struct ib_mad_send_buf *msg = NULL; + struct cm_dreq_msg *dreq_msg; + struct cm_drep_msg *drep_msg; + int ret; + + ret = cm_alloc_response_msg(port, mad_recv_wc, &msg); + if (ret) + return ret; + + dreq_msg = (struct cm_dreq_msg *) mad_recv_wc->recv_buf.mad; + drep_msg = (struct cm_drep_msg *) msg->mad; + + cm_format_mad_hdr(&drep_msg->hdr, CM_DREP_ATTR_ID, dreq_msg->hdr.tid); + drep_msg->remote_comm_id = dreq_msg->local_comm_id; + drep_msg->local_comm_id = dreq_msg->remote_comm_id; + + ret = ib_post_send_mad(msg, NULL); + if (ret) + cm_free_msg(msg); + + return ret; +} + static int cm_dreq_handler(struct cm_work *work) { struct cm_id_private *cm_id_priv; @@ -1913,8 +1939,10 @@ static int cm_dreq_handler(struct cm_work *work) dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad; cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id, dreq_msg->local_comm_id); - if (!cm_id_priv) + if (!cm_id_priv) { + cm_issue_drep(work->port, work->mad_recv_wc); return -EINVAL; + } work->cm_event.private_data = &dreq_msg->private_data; -- cgit v1.2.3 From 1031bfb93adf641436b2192170525b76e2eb25bd Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Tue, 10 Oct 2006 12:50:38 -0700 Subject: RDMA/amso1100: Fix build with debugging off Since pr_debug() has changed from a macro to an inline function when DEBUG is not defined, its arguments now need to be defined even when debugging is off. Therefore to_event_str() and to_qp_state_str() need to be moved out of #ifdef DEBUG. The compiler will throw the definitions away if DEBUG is not defined, but it needs to be able to see that the functions exist. Signed-off-by: Roland Dreier --- drivers/infiniband/hw/amso1100/c2_ae.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers') diff --git a/drivers/infiniband/hw/amso1100/c2_ae.c b/drivers/infiniband/hw/amso1100/c2_ae.c index 3aae4978e1c..a31439bd3b6 100644 --- a/drivers/infiniband/hw/amso1100/c2_ae.c +++ b/drivers/infiniband/hw/amso1100/c2_ae.c @@ -66,7 +66,6 @@ static int c2_convert_cm_status(u32 c2_status) } } -#ifdef DEBUG static const char* to_event_str(int event) { static const char* event_str[] = { @@ -144,7 +143,6 @@ static const char *to_qp_state_str(int state) return ""; }; } -#endif void c2_ae_event(struct c2_dev *c2dev, u32 mq_index) { -- cgit v1.2.3 From 73fbe8be73512b8a3ffa3d20c9d7f531af99679c Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Tue, 10 Oct 2006 12:50:38 -0700 Subject: IPoIB: Check for DMA mapping error for TX packets Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers') diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index f426a69d9a4..8bf5e9ec7c9 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -355,6 +355,11 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, tx_req->skb = skb; addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len, DMA_TO_DEVICE); + if (unlikely(dma_mapping_error(addr))) { + ++priv->stats.tx_errors; + dev_kfree_skb_any(skb); + return; + } pci_unmap_addr_set(tx_req, mapping, addr); if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), -- cgit v1.2.3 From 2cbe19d48af198f0070470a2d836828de24fe163 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Mon, 9 Oct 2006 18:06:32 +0200 Subject: IB/mthca: Fix off-by-one in mthca SRQ creation All HCAs (not just mem-free) need a spare SRQ entry, so bump srq->max by 1 in all cases. Noted by Jack Morgenstein Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- drivers/infiniband/hw/mthca/mthca_srq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index 0f316c87bf6..92a72f52152 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c @@ -201,6 +201,8 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd, if (mthca_is_memfree(dev)) srq->max = roundup_pow_of_two(srq->max + 1); + else + srq->max = srq->max + 1; ds = max(64UL, roundup_pow_of_two(sizeof (struct mthca_next_seg) + @@ -277,7 +279,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd, srq->first_free = 0; srq->last_free = srq->max - 1; - attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; + attr->max_wr = srq->max - 1; attr->max_sge = srq->max_gs; return 0; @@ -413,7 +415,7 @@ int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr) srq_attr->srq_limit = be16_to_cpu(tavor_ctx->limit_watermark); } - srq_attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; + srq_attr->max_wr = srq->max - 1; srq_attr->max_sge = srq->max_gs; out: -- cgit v1.2.3 From 1e0dbafd30b2e1cd17fd141f4cfd633078524e8c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:07 +0100 Subject: [PATCH] advansys __iomem annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/scsi/advansys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 83695416b2c..587eac92079 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -3881,7 +3881,7 @@ typedef struct asc_board { /* * The following fields are used only for Wide Boards. */ - void *ioremap_addr; /* I/O Memory remap address. */ + void __iomem *ioremap_addr; /* I/O Memory remap address. */ ushort ioport; /* I/O Port address. */ ADV_CARR_T *orig_carrp; /* ADV_CARR_T memory block. */ adv_req_t *orig_reqp; /* adv_req_t memory block. */ -- cgit v1.2.3 From 6aae8738473b7447284fe370d4e6816c02b4511b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:27 +0100 Subject: [PATCH] drivers/s390 misc sparse annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/s390/scsi/zfcp_erp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 862a411a4aa..c88babce9bc 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -1987,7 +1987,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) sbale = &(adapter->response_queue.buffer[i]->element[0]); sbale->length = 0; sbale->flags = SBAL_FLAGS_LAST_ENTRY; - sbale->addr = 0; + sbale->addr = NULL; } ZFCP_LOG_TRACE("calling do_QDIO on adapter %s (flags=0x%x, " -- cgit v1.2.3 From 48343273e846d2612b7977f2503fd97503996fa0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:47 +0100 Subject: [PATCH] __iomem annotations in sunzilog Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- drivers/serial/sunzilog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index b11f6dea270..73dd2eedaaa 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c @@ -1057,7 +1057,7 @@ static void sunzilog_free_tables(void) static void sunzilog_putchar(struct uart_port *port, int ch) { - struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); + struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port); int loops = ZS_PUT_CHAR_MAX_DELAY; /* This is a timed polling loop so do not switch the explicit -- cgit v1.2.3 From aa7677d40072a97a861390f0ed1a8c25ce312201 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:44:57 +0100 Subject: [PATCH] NULL noise removal: advansys Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/scsi/advansys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 587eac92079..2b344356a29 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -3951,7 +3951,7 @@ typedef struct _PCI_CONFIG_SPACE_ /* Number of boards detected in system. */ STATIC int asc_board_count = 0; -STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { 0 }; +STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { NULL }; /* Overrun buffer used by all narrow boards. */ STATIC uchar overrun_buf[ASC_OVERRUN_BSIZE] = { 0 }; @@ -6621,7 +6621,7 @@ adv_build_req(asc_board_t *boardp, struct scsi_cmnd *scp, dma_map_single(dev, scp->request_buffer, scp->request_bufflen, scp->sc_data_direction); } else { - scsiqp->vdata_addr = 0; + scsiqp->vdata_addr = NULL; scp->SCp.dma_handle = 0; } scsiqp->data_addr = cpu_to_le32(scp->SCp.dma_handle); -- cgit v1.2.3 From 98ae6ccd8e15aeac1c624615c044deecf46a359a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:07 +0100 Subject: [PATCH] fix misannotations in loop.c Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/block/loop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/block/loop.c b/drivers/block/loop.c index d6bb8da955a..19a09a18727 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -295,7 +295,7 @@ fail: * and do_lo_send_write(). */ static int __do_lo_send_write(struct file *file, - u8 __user *buf, const int len, loff_t pos) + u8 *buf, const int len, loff_t pos) { ssize_t bw; mm_segment_t old_fs = get_fs(); @@ -324,7 +324,7 @@ static int do_lo_send_direct_write(struct loop_device *lo, struct bio_vec *bvec, int bsize, loff_t pos, struct page *page) { ssize_t bw = __do_lo_send_write(lo->lo_backing_file, - (u8 __user *)kmap(bvec->bv_page) + bvec->bv_offset, + kmap(bvec->bv_page) + bvec->bv_offset, bvec->bv_len, pos); kunmap(bvec->bv_page); cond_resched(); @@ -351,7 +351,7 @@ static int do_lo_send_write(struct loop_device *lo, struct bio_vec *bvec, bvec->bv_offset, bvec->bv_len, pos >> 9); if (likely(!ret)) return __do_lo_send_write(lo->lo_backing_file, - (u8 __user *)page_address(page), bvec->bv_len, + page_address(page), bvec->bv_len, pos); printk(KERN_ERR "loop: Transfer error at byte offset %llu, " "length %i.\n", (unsigned long long)pos, bvec->bv_len); -- cgit v1.2.3 From 04b1add1ab9121898b7d63570aad2a9c7ee9cfa3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:17 +0100 Subject: [PATCH] misc sata __iomem annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/ata/sata_sil.c | 2 +- drivers/ata/sata_svw.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index ae5edb80ea9..ca8d9931247 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c @@ -349,7 +349,7 @@ static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg) static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) { - void *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg); + void __iomem *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg); if (mmio) writel(val, mmio); } diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c index 84025a2fd5b..db32d15b7fa 100644 --- a/drivers/ata/sata_svw.c +++ b/drivers/ata/sata_svw.c @@ -177,7 +177,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc) struct ata_port *ap = qc->ap; unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); u8 dmactl; - void *mmio = (void *) ap->ioaddr.bmdma_addr; + void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr; /* load PRD table addr. */ mb(); /* make sure PRD table writes are visible to controller */ writel(ap->prd_dma, mmio + ATA_DMA_TABLE_OFS); @@ -205,7 +205,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc) static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; - void *mmio = (void *) ap->ioaddr.bmdma_addr; + void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr; u8 dmactl; /* start host DMA transaction */ -- cgit v1.2.3 From c714de5dcf41cee869c4a74e8783c6d9be459ef6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:37 +0100 Subject: [PATCH] devio __user annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/usb/core/devio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 2c9c9462d89..724822cac2b 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1216,7 +1216,7 @@ static int proc_submiturb_compat(struct dev_state *ps, void __user *arg) { struct usbdevfs_urb uurb; - if (get_urb32(&uurb,(struct usbdevfs_urb32 *)arg)) + if (get_urb32(&uurb,(struct usbdevfs_urb32 __user *)arg)) return -EFAULT; return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, arg); @@ -1251,7 +1251,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg) } free_async(as); - if (put_user((u32)(u64)addr, (u32 __user *)arg)) + if (put_user(ptr_to_compat(addr), (u32 __user *)arg)) return -EFAULT; return 0; } @@ -1520,7 +1520,7 @@ static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd case USBDEVFS_IOCTL32: snoop(&dev->dev, "%s: IOCTL\n", __FUNCTION__); - ret = proc_ioctl_compat(ps, (compat_uptr_t)(long)p); + ret = proc_ioctl_compat(ps, ptr_to_compat(p)); break; #endif -- cgit v1.2.3 From 47b16539e1072afd2c964b97be4a95b5cf2ff801 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:45:47 +0100 Subject: [PATCH] drivers/dma trivial annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/dma/ioatdma.c | 4 ++-- drivers/dma/ioatdma.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c index f3bf1e230bc..0358419a0e4 100644 --- a/drivers/dma/ioatdma.c +++ b/drivers/dma/ioatdma.c @@ -80,7 +80,7 @@ static int enumerate_dma_channels(struct ioat_device *device) static struct ioat_desc_sw *ioat_dma_alloc_descriptor( struct ioat_dma_chan *ioat_chan, - int flags) + gfp_t flags) { struct ioat_dma_descriptor *desc; struct ioat_desc_sw *desc_sw; @@ -686,7 +686,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev, { int err; unsigned long mmio_start, mmio_len; - void *reg_base; + void __iomem *reg_base; struct ioat_device *device; err = pci_enable_device(pdev); diff --git a/drivers/dma/ioatdma.h b/drivers/dma/ioatdma.h index a5d3b364416..62b26a9be4c 100644 --- a/drivers/dma/ioatdma.h +++ b/drivers/dma/ioatdma.h @@ -44,7 +44,7 @@ extern struct list_head dma_client_list; struct ioat_device { struct pci_dev *pdev; - void *reg_base; + void __iomem *reg_base; struct pci_pool *dma_pool; struct pci_pool *completion_pool; @@ -73,7 +73,7 @@ struct ioat_device { struct ioat_dma_chan { - void *reg_base; + void __iomem *reg_base; dma_cookie_t completed_cookie; unsigned long last_completion; -- cgit v1.2.3 From afc12d30a74415a49a6ce36d89f82641b46c499b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:46:37 +0100 Subject: [PATCH] mtd: remove several bogus casts to void * in iounmap() argument Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/mtd/maps/physmap.c | 2 +- drivers/mtd/nand/cs553x_nand.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index bc7cc71788b..d1717763f71 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -62,7 +62,7 @@ static int physmap_flash_remove(struct platform_device *dev) } if (info->map.virt != NULL) - iounmap((void *)info->map.virt); + iounmap(info->map.virt); if (info->res != NULL) { release_resource(info->res); diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c index e0a1d386e58..94924d52a9b 100644 --- a/drivers/mtd/nand/cs553x_nand.c +++ b/drivers/mtd/nand/cs553x_nand.c @@ -249,7 +249,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr) goto out; out_ior: - iounmap((void *)this->IO_ADDR_R); + iounmap(this->IO_ADDR_R); out_mtd: kfree(new_mtd); out: -- cgit v1.2.3 From e4cad1b5a4851c90c1bcf460062074a2fa10815b Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:07 +0100 Subject: [PATCH] passing pointer to setup_timer() should be via unsigned long Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/mmc/sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 6d024342b2f..9a7d39b7cdb 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -1329,7 +1329,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) tasklet_init(&host->finish_tasklet, sdhci_tasklet_finish, (unsigned long)host); - setup_timer(&host->timer, sdhci_timeout_timer, (long)host); + setup_timer(&host->timer, sdhci_timeout_timer, (unsigned long)host); ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED, host->slot_descr, host); -- cgit v1.2.3 From 4370df9782a8456039cf85d2b833c2c2097f3ded Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:17 +0100 Subject: [PATCH] acpi NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/acpi/cm_sbs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c index a01ce6700bf..4a9b7bf6f44 100644 --- a/drivers/acpi/cm_sbs.c +++ b/drivers/acpi/cm_sbs.c @@ -67,7 +67,7 @@ void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param) lock_ac_dir_cnt--; if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) { remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); - acpi_ac_dir = 0; + acpi_ac_dir = NULL; } mutex_unlock(&cm_sbs_mutex); } @@ -99,7 +99,7 @@ void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param) if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param && acpi_battery_dir) { remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); - acpi_battery_dir = 0; + acpi_battery_dir = NULL; } mutex_unlock(&cm_sbs_mutex); return; -- cgit v1.2.3 From 29756fa3287ff702535e459e7ca8c6038f6e9ae3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:27 +0100 Subject: [PATCH] trivial iomem annotations: istallion Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/char/istallion.c | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'drivers') diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index d6e031542c6..ffdf9df1a67 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c @@ -686,37 +686,37 @@ static stlibrd_t *stli_allocbrd(void); static void stli_ecpinit(stlibrd_t *brdp); static void stli_ecpenable(stlibrd_t *brdp); static void stli_ecpdisable(stlibrd_t *brdp); -static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_ecpreset(stlibrd_t *brdp); static void stli_ecpintr(stlibrd_t *brdp); static void stli_ecpeiinit(stlibrd_t *brdp); static void stli_ecpeienable(stlibrd_t *brdp); static void stli_ecpeidisable(stlibrd_t *brdp); -static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_ecpeireset(stlibrd_t *brdp); static void stli_ecpmcenable(stlibrd_t *brdp); static void stli_ecpmcdisable(stlibrd_t *brdp); -static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_ecpmcreset(stlibrd_t *brdp); static void stli_ecppciinit(stlibrd_t *brdp); -static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_ecppcireset(stlibrd_t *brdp); static void stli_onbinit(stlibrd_t *brdp); static void stli_onbenable(stlibrd_t *brdp); static void stli_onbdisable(stlibrd_t *brdp); -static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_onbreset(stlibrd_t *brdp); static void stli_onbeinit(stlibrd_t *brdp); static void stli_onbeenable(stlibrd_t *brdp); static void stli_onbedisable(stlibrd_t *brdp); -static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_onbereset(stlibrd_t *brdp); static void stli_bbyinit(stlibrd_t *brdp); -static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_bbyreset(stlibrd_t *brdp); static void stli_stalinit(stlibrd_t *brdp); -static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); +static void __iomem *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); static void stli_stalreset(stlibrd_t *brdp); static stliport_t *stli_getport(int brdnr, int panelnr, int portnr); @@ -1566,7 +1566,7 @@ static void stli_flushchars(struct tty_struct *tty) len = MIN(len, cooksize); count = 0; - shbuf = (char *) EBRDGETMEMPTR(brdp, portp->txoffset); + shbuf = EBRDGETMEMPTR(brdp, portp->txoffset); buf = stli_txcookbuf; while (len > 0) { @@ -2948,9 +2948,9 @@ static void stli_ecpdisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3022,9 +3022,9 @@ static void stli_ecpeidisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3074,9 +3074,9 @@ static void stli_ecpmcdisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3119,9 +3119,9 @@ static void stli_ecppciinit(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3185,9 +3185,9 @@ static void stli_onbdisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; if (offset > brdp->memsize) { printk(KERN_ERR "STALLION: shared memory pointer=%x out of " @@ -3250,9 +3250,9 @@ static void stli_onbedisable(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; if (offset > brdp->memsize) { @@ -3300,9 +3300,9 @@ static void stli_bbyinit(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { - void *ptr; + void __iomem *ptr; unsigned char val; BUG_ON(offset > brdp->memsize); @@ -3337,7 +3337,7 @@ static void stli_stalinit(stlibrd_t *brdp) /*****************************************************************************/ -static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) +static void __iomem *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) { BUG_ON(offset > brdp->memsize); return brdp->membase + (offset % STAL_PAGESIZE); @@ -3876,7 +3876,7 @@ static int stli_eisamemprobe(stlibrd_t *brdp) continue; if (brdp->brdtype == BRD_ECPE) { - ecpsigp = (cdkecpsig_t __iomem *) stli_ecpeigetmemptr(brdp, + ecpsigp = stli_ecpeigetmemptr(brdp, CDK_SIGADDR, __LINE__); memcpy_fromio(&ecpsig, ecpsigp, sizeof(cdkecpsig_t)); if (ecpsig.magic == cpu_to_le32(ECP_MAGIC)) @@ -4184,7 +4184,7 @@ static int stli_initbrds(void) static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp) { unsigned long flags; - void *memptr; + void __iomem *memptr; stlibrd_t *brdp; int brdnr, size, n; void *p; @@ -4214,7 +4214,7 @@ static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, lof while (size > 0) { spin_lock_irqsave(&brd_lock, flags); EBRDENABLE(brdp); - memptr = (void *) EBRDGETMEMPTR(brdp, off); + memptr = EBRDGETMEMPTR(brdp, off); n = MIN(size, (brdp->pagesize - (((unsigned long) off) % brdp->pagesize))); n = MIN(n, PAGE_SIZE); memcpy_fromio(p, memptr, n); @@ -4247,7 +4247,7 @@ out: static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp) { unsigned long flags; - void *memptr; + void __iomem *memptr; stlibrd_t *brdp; char __user *chbuf; int brdnr, size, n; @@ -4287,7 +4287,7 @@ static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t cou } spin_lock_irqsave(&brd_lock, flags); EBRDENABLE(brdp); - memptr = (void *) EBRDGETMEMPTR(brdp, off); + memptr = EBRDGETMEMPTR(brdp, off); memcpy_toio(memptr, p, n); EBRDDISABLE(brdp); spin_unlock_irqrestore(&brd_lock, flags); -- cgit v1.2.3 From fa1f5ea860af34d74c1475eddde3364e71fac15d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:47:47 +0100 Subject: [PATCH] gfp annotations: scsi_error Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/scsi/scsi_error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 3d355d05461..aff1b0cfd4b 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -495,7 +495,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, memcpy(scmd->cmnd, cmnd, cmnd_size); if (copy_sense) { - int gfp_mask = GFP_ATOMIC; + gfp_t gfp_mask = GFP_ATOMIC; if (shost->hostt->unchecked_isa_dma) gfp_mask |= __GFP_DMA; -- cgit v1.2.3 From 03dc55064117508ad474f3eede3a77bf9fbb636f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:07 +0100 Subject: [PATCH] trivial iomem annotations: sata_promise Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/ata/sata_promise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c index d636ede064a..8bcdfa64667 100644 --- a/drivers/ata/sata_promise.c +++ b/drivers/ata/sata_promise.c @@ -360,7 +360,7 @@ static void pdc_sata_phy_reset(struct ata_port *ap) static void pdc_pata_cbl_detect(struct ata_port *ap) { u8 tmp; - void __iomem *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; + void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; tmp = readb(mmio); -- cgit v1.2.3 From a6ded1b0605376e18a17cb01977819bcf2677cdc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:17 +0100 Subject: [PATCH] openprom NULL noise removal Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- drivers/sbus/char/openprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 2f698763ba5..81ba2d71cee 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c @@ -630,7 +630,7 @@ static int openprom_ioctl(struct inode * inode, struct file * file, case OPROMPATH2NODE: if ((file->f_mode & FMODE_READ) == 0) return -EPERM; - return openprom_sunos_ioctl(inode, file, cmd, arg, 0); + return openprom_sunos_ioctl(inode, file, cmd, arg, NULL); case OPIOCGET: case OPIOCNEXTPROP: -- cgit v1.2.3 From ba674cfcbdb93cb560a4ae4d2c8b53cfbddc2d22 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:27 +0100 Subject: [PATCH] __user annotations: loop.c Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 19a09a18727..beab6d2643c 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1187,7 +1187,7 @@ struct compat_loop_info { * - noinlined to reduce stack space usage in main part of driver */ static noinline int -loop_info64_from_compat(const struct compat_loop_info *arg, +loop_info64_from_compat(const struct compat_loop_info __user *arg, struct loop_info64 *info64) { struct compat_loop_info info; -- cgit v1.2.3 From 663d1ba2f1f66db43ab95350f965c1d9f2e3e5bc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:48:37 +0100 Subject: [PATCH] em28xx NULL noise removal Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/media/video/em28xx/em28xx-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 20df657b70c..2a461dde480 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -174,7 +174,7 @@ static void em28xx_config_i2c(struct em28xx *dev) route.input = INPUT(dev->ctl_input)->vmux; route.output = 0; - em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, 0); + em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL); em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL); -- cgit v1.2.3 From 3c5c6658d2f1385cf06cdc00db9f7f124a35fb25 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:49:47 +0100 Subject: [PATCH] use %zu for size_t Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/scsi/dc395x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 23f5e418ab5..e95b367d09e 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -1219,7 +1219,7 @@ static void dump_register_info(struct AdapterCtlBlk *acb, srb, srb->cmd, srb->cmd->pid, srb->cmd->cmnd[0], srb->cmd->device->id, srb->cmd->device->lun); - printk(" sglist=%p cnt=%i idx=%i len=%Zd\n", + printk(" sglist=%p cnt=%i idx=%i len=%zu\n", srb->segment_x, srb->sg_count, srb->sg_index, srb->total_xfer_length); printk(" state=0x%04x status=0x%02x phase=0x%02x (%sconn.)\n", -- cgit v1.2.3 From 70f38912935fd4aa3fea1ddf87ed1cee63109cc5 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 10 Oct 2006 22:49:57 +0100 Subject: [PATCH] use %p for pointers Signed-off-by: Al Viro Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- drivers/sbus/char/uctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index ddc0681ac75..b30372f17f1 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -400,7 +400,7 @@ static int __init ts102_uctrl_init(void) } driver->regs->uctrl_intr = UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK; - printk("uctrl: 0x%x (irq %d)\n", driver->regs, driver->irq); + printk("uctrl: 0x%p (irq %d)\n", driver->regs, driver->irq); uctrl_get_event_status(); uctrl_get_external_status(); return 0; -- cgit v1.2.3 From 56052d525a05ba9e53d4f11be2d5deee64924514 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Thu, 1 Dec 2005 17:10:40 -0500 Subject: [PATCH] cdrom: add endianness annotations Signed-off-by: Alexey Dobriyan Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/cdrom/cdrom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 2a0c50d84fc..7ea0f48f8fa 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -703,7 +703,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) { struct packet_command cgc; char buffer[16]; - __u16 *feature_code; + __be16 *feature_code; int ret; init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); @@ -716,7 +716,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi) if ((ret = cdi->ops->generic_packet(cdi, &cgc))) return ret; - feature_code = (__u16 *) &buffer[sizeof(struct feature_header)]; + feature_code = (__be16 *) &buffer[sizeof(struct feature_header)]; if (be16_to_cpu(*feature_code) == CDF_HWDM) return 0; @@ -2963,7 +2963,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, how much data is available for transfer. buffer[1] is unfortunately ambigious and the only reliable way seem to be to simply skip over the block descriptor... */ - offset = 8 + be16_to_cpu(*(unsigned short *)(buffer+6)); + offset = 8 + be16_to_cpu(*(__be16 *)(buffer+6)); if (offset + 16 > sizeof(buffer)) return -E2BIG; -- cgit v1.2.3 From 7359bbfd85751de23079cc26cd248635aebe840b Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 23 Dec 2005 01:18:25 +0300 Subject: [PATCH] chelsio: add endian annotations Signed-off-by: Alexey Dobriyan Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/net/chelsio/cpl5_cmd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/net/chelsio/cpl5_cmd.h b/drivers/net/chelsio/cpl5_cmd.h index 27925e487bc..5b357d9e88d 100644 --- a/drivers/net/chelsio/cpl5_cmd.h +++ b/drivers/net/chelsio/cpl5_cmd.h @@ -108,7 +108,7 @@ struct cpl_tx_pkt_lso { u8 iff:4; #endif u16 vlan; - u32 len; + __be32 len; u32 rsvd2; u8 rsvd3; @@ -119,7 +119,7 @@ struct cpl_tx_pkt_lso { u8 ip_hdr_words:4; u8 tcp_hdr_words:4; #endif - u16 eth_type_mss; + __be16 eth_type_mss; }; struct cpl_rx_pkt { @@ -138,7 +138,7 @@ struct cpl_rx_pkt { u8 iff:4; #endif u16 csum; - u16 vlan; + __be16 vlan; u16 len; }; -- cgit v1.2.3 From 107c3a73e0ee037322efa00fa3cb45b3b7eb6069 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 13 Aug 2006 15:38:04 -0400 Subject: [PATCH] endianness annotations in s2io Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/net/s2io.h | 322 ++++++++++++++++++++++++++--------------------------- 1 file changed, 161 insertions(+), 161 deletions(-) (limited to 'drivers') diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 72f52dc98f5..12b719f4d00 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h @@ -116,179 +116,179 @@ typedef struct { /* The statistics block of Xena */ typedef struct stat_block { /* Tx MAC statistics counters. */ - u32 tmac_data_octets; - u32 tmac_frms; - u64 tmac_drop_frms; - u32 tmac_bcst_frms; - u32 tmac_mcst_frms; - u64 tmac_pause_ctrl_frms; - u32 tmac_ucst_frms; - u32 tmac_ttl_octets; - u32 tmac_any_err_frms; - u32 tmac_nucst_frms; - u64 tmac_ttl_less_fb_octets; - u64 tmac_vld_ip_octets; - u32 tmac_drop_ip; - u32 tmac_vld_ip; - u32 tmac_rst_tcp; - u32 tmac_icmp; - u64 tmac_tcp; - u32 reserved_0; - u32 tmac_udp; + __le32 tmac_data_octets; + __le32 tmac_frms; + __le64 tmac_drop_frms; + __le32 tmac_bcst_frms; + __le32 tmac_mcst_frms; + __le64 tmac_pause_ctrl_frms; + __le32 tmac_ucst_frms; + __le32 tmac_ttl_octets; + __le32 tmac_any_err_frms; + __le32 tmac_nucst_frms; + __le64 tmac_ttl_less_fb_octets; + __le64 tmac_vld_ip_octets; + __le32 tmac_drop_ip; + __le32 tmac_vld_ip; + __le32 tmac_rst_tcp; + __le32 tmac_icmp; + __le64 tmac_tcp; + __le32 reserved_0; + __le32 tmac_udp; /* Rx MAC Statistics counters. */ - u32 rmac_data_octets; - u32 rmac_vld_frms; - u64 rmac_fcs_err_frms; - u64 rmac_drop_frms; - u32 rmac_vld_bcst_frms; - u32 rmac_vld_mcst_frms; - u32 rmac_out_rng_len_err_frms; - u32 rmac_in_rng_len_err_frms; - u64 rmac_long_frms; - u64 rmac_pause_ctrl_frms; - u64 rmac_unsup_ctrl_frms; - u32 rmac_accepted_ucst_frms; - u32 rmac_ttl_octets; - u32 rmac_discarded_frms; - u32 rmac_accepted_nucst_frms; - u32 reserved_1; - u32 rmac_drop_events; - u64 rmac_ttl_less_fb_octets; - u64 rmac_ttl_frms; - u64 reserved_2; - u32 rmac_usized_frms; - u32 reserved_3; - u32 rmac_frag_frms; - u32 rmac_osized_frms; - u32 reserved_4; - u32 rmac_jabber_frms; - u64 rmac_ttl_64_frms; - u64 rmac_ttl_65_127_frms; - u64 reserved_5; - u64 rmac_ttl_128_255_frms; - u64 rmac_ttl_256_511_frms; - u64 reserved_6; - u64 rmac_ttl_512_1023_frms; - u64 rmac_ttl_1024_1518_frms; - u32 rmac_ip; - u32 reserved_7; - u64 rmac_ip_octets; - u32 rmac_drop_ip; - u32 rmac_hdr_err_ip; - u32 reserved_8; - u32 rmac_icmp; - u64 rmac_tcp; - u32 rmac_err_drp_udp; - u32 rmac_udp; - u64 rmac_xgmii_err_sym; - u64 rmac_frms_q0; - u64 rmac_frms_q1; - u64 rmac_frms_q2; - u64 rmac_frms_q3; - u64 rmac_frms_q4; - u64 rmac_frms_q5; - u64 rmac_frms_q6; - u64 rmac_frms_q7; - u16 rmac_full_q3; - u16 rmac_full_q2; - u16 rmac_full_q1; - u16 rmac_full_q0; - u16 rmac_full_q7; - u16 rmac_full_q6; - u16 rmac_full_q5; - u16 rmac_full_q4; - u32 reserved_9; - u32 rmac_pause_cnt; - u64 rmac_xgmii_data_err_cnt; - u64 rmac_xgmii_ctrl_err_cnt; - u32 rmac_err_tcp; - u32 rmac_accepted_ip; + __le32 rmac_data_octets; + __le32 rmac_vld_frms; + __le64 rmac_fcs_err_frms; + __le64 rmac_drop_frms; + __le32 rmac_vld_bcst_frms; + __le32 rmac_vld_mcst_frms; + __le32 rmac_out_rng_len_err_frms; + __le32 rmac_in_rng_len_err_frms; + __le64 rmac_long_frms; + __le64 rmac_pause_ctrl_frms; + __le64 rmac_unsup_ctrl_frms; + __le32 rmac_accepted_ucst_frms; + __le32 rmac_ttl_octets; + __le32 rmac_discarded_frms; + __le32 rmac_accepted_nucst_frms; + __le32 reserved_1; + __le32 rmac_drop_events; + __le64 rmac_ttl_less_fb_octets; + __le64 rmac_ttl_frms; + __le64 reserved_2; + __le32 rmac_usized_frms; + __le32 reserved_3; + __le32 rmac_frag_frms; + __le32 rmac_osized_frms; + __le32 reserved_4; + __le32 rmac_jabber_frms; + __le64 rmac_ttl_64_frms; + __le64 rmac_ttl_65_127_frms; + __le64 reserved_5; + __le64 rmac_ttl_128_255_frms; + __le64 rmac_ttl_256_511_frms; + __le64 reserved_6; + __le64 rmac_ttl_512_1023_frms; + __le64 rmac_ttl_1024_1518_frms; + __le32 rmac_ip; + __le32 reserved_7; + __le64 rmac_ip_octets; + __le32 rmac_drop_ip; + __le32 rmac_hdr_err_ip; + __le32 reserved_8; + __le32 rmac_icmp; + __le64 rmac_tcp; + __le32 rmac_err_drp_udp; + __le32 rmac_udp; + __le64 rmac_xgmii_err_sym; + __le64 rmac_frms_q0; + __le64 rmac_frms_q1; + __le64 rmac_frms_q2; + __le64 rmac_frms_q3; + __le64 rmac_frms_q4; + __le64 rmac_frms_q5; + __le64 rmac_frms_q6; + __le64 rmac_frms_q7; + __le16 rmac_full_q3; + __le16 rmac_full_q2; + __le16 rmac_full_q1; + __le16 rmac_full_q0; + __le16 rmac_full_q7; + __le16 rmac_full_q6; + __le16 rmac_full_q5; + __le16 rmac_full_q4; + __le32 reserved_9; + __le32 rmac_pause_cnt; + __le64 rmac_xgmii_data_err_cnt; + __le64 rmac_xgmii_ctrl_err_cnt; + __le32 rmac_err_tcp; + __le32 rmac_accepted_ip; /* PCI/PCI-X Read transaction statistics. */ - u32 new_rd_req_cnt; - u32 rd_req_cnt; - u32 rd_rtry_cnt; - u32 new_rd_req_rtry_cnt; + __le32 new_rd_req_cnt; + __le32 rd_req_cnt; + __le32 rd_rtry_cnt; + __le32 new_rd_req_rtry_cnt; /* PCI/PCI-X Write/Read transaction statistics. */ - u32 wr_req_cnt; - u32 wr_rtry_rd_ack_cnt; - u32 new_wr_req_rtry_cnt; - u32 new_wr_req_cnt; - u32 wr_disc_cnt; - u32 wr_rtry_cnt; + __le32 wr_req_cnt; + __le32 wr_rtry_rd_ack_cnt; + __le32 new_wr_req_rtry_cnt; + __le32 new_wr_req_cnt; + __le32 wr_disc_cnt; + __le32 wr_rtry_cnt; /* PCI/PCI-X Write / DMA Transaction statistics. */ - u32 txp_wr_cnt; - u32 rd_rtry_wr_ack_cnt; - u32 txd_wr_cnt; - u32 txd_rd_cnt; - u32 rxd_wr_cnt; - u32 rxd_rd_cnt; - u32 rxf_wr_cnt; - u32 txf_rd_cnt; + __le32 txp_wr_cnt; + __le32 rd_rtry_wr_ack_cnt; + __le32 txd_wr_cnt; + __le32 txd_rd_cnt; + __le32 rxd_wr_cnt; + __le32 rxd_rd_cnt; + __le32 rxf_wr_cnt; + __le32 txf_rd_cnt; /* Tx MAC statistics overflow counters. */ - u32 tmac_data_octets_oflow; - u32 tmac_frms_oflow; - u32 tmac_bcst_frms_oflow; - u32 tmac_mcst_frms_oflow; - u32 tmac_ucst_frms_oflow; - u32 tmac_ttl_octets_oflow; - u32 tmac_any_err_frms_oflow; - u32 tmac_nucst_frms_oflow; - u64 tmac_vlan_frms; - u32 tmac_drop_ip_oflow; - u32 tmac_vld_ip_oflow; - u32 tmac_rst_tcp_oflow; - u32 tmac_icmp_oflow; - u32 tpa_unknown_protocol; - u32 tmac_udp_oflow; - u32 reserved_10; - u32 tpa_parse_failure; + __le32 tmac_data_octets_oflow; + __le32 tmac_frms_oflow; + __le32 tmac_bcst_frms_oflow; + __le32 tmac_mcst_frms_oflow; + __le32 tmac_ucst_frms_oflow; + __le32 tmac_ttl_octets_oflow; + __le32 tmac_any_err_frms_oflow; + __le32 tmac_nucst_frms_oflow; + __le64 tmac_vlan_frms; + __le32 tmac_drop_ip_oflow; + __le32 tmac_vld_ip_oflow; + __le32 tmac_rst_tcp_oflow; + __le32 tmac_icmp_oflow; + __le32 tpa_unknown_protocol; + __le32 tmac_udp_oflow; + __le32 reserved_10; + __le32 tpa_parse_failure; /* Rx MAC Statistics overflow counters. */ - u32 rmac_data_octets_oflow; - u32 rmac_vld_frms_oflow; - u32 rmac_vld_bcst_frms_oflow; - u32 rmac_vld_mcst_frms_oflow; - u32 rmac_accepted_ucst_frms_oflow; - u32 rmac_ttl_octets_oflow; - u32 rmac_discarded_frms_oflow; - u32 rmac_accepted_nucst_frms_oflow; - u32 rmac_usized_frms_oflow; - u32 rmac_drop_events_oflow; - u32 rmac_frag_frms_oflow; - u32 rmac_osized_frms_oflow; - u32 rmac_ip_oflow; - u32 rmac_jabber_frms_oflow; - u32 rmac_icmp_oflow; - u32 rmac_drop_ip_oflow; - u32 rmac_err_drp_udp_oflow; - u32 rmac_udp_oflow; - u32 reserved_11; - u32 rmac_pause_cnt_oflow; - u64 rmac_ttl_1519_4095_frms; - u64 rmac_ttl_4096_8191_frms; - u64 rmac_ttl_8192_max_frms; - u64 rmac_ttl_gt_max_frms; - u64 rmac_osized_alt_frms; - u64 rmac_jabber_alt_frms; - u64 rmac_gt_max_alt_frms; - u64 rmac_vlan_frms; - u32 rmac_len_discard; - u32 rmac_fcs_discard; - u32 rmac_pf_discard; - u32 rmac_da_discard; - u32 rmac_red_discard; - u32 rmac_rts_discard; - u32 reserved_12; - u32 rmac_ingm_full_discard; - u32 reserved_13; - u32 rmac_accepted_ip_oflow; - u32 reserved_14; - u32 link_fault_cnt; + __le32 rmac_data_octets_oflow; + __le32 rmac_vld_frms_oflow; + __le32 rmac_vld_bcst_frms_oflow; + __le32 rmac_vld_mcst_frms_oflow; + __le32 rmac_accepted_ucst_frms_oflow; + __le32 rmac_ttl_octets_oflow; + __le32 rmac_discarded_frms_oflow; + __le32 rmac_accepted_nucst_frms_oflow; + __le32 rmac_usized_frms_oflow; + __le32 rmac_drop_events_oflow; + __le32 rmac_frag_frms_oflow; + __le32 rmac_osized_frms_oflow; + __le32 rmac_ip_oflow; + __le32 rmac_jabber_frms_oflow; + __le32 rmac_icmp_oflow; + __le32 rmac_drop_ip_oflow; + __le32 rmac_err_drp_udp_oflow; + __le32 rmac_udp_oflow; + __le32 reserved_11; + __le32 rmac_pause_cnt_oflow; + __le64 rmac_ttl_1519_4095_frms; + __le64 rmac_ttl_4096_8191_frms; + __le64 rmac_ttl_8192_max_frms; + __le64 rmac_ttl_gt_max_frms; + __le64 rmac_osized_alt_frms; + __le64 rmac_jabber_alt_frms; + __le64 rmac_gt_max_alt_frms; + __le64 rmac_vlan_frms; + __le32 rmac_len_discard; + __le32 rmac_fcs_discard; + __le32 rmac_pf_discard; + __le32 rmac_da_discard; + __le32 rmac_red_discard; + __le32 rmac_rts_discard; + __le32 reserved_12; + __le32 rmac_ingm_full_discard; + __le32 reserved_13; + __le32 rmac_accepted_ip_oflow; + __le32 reserved_14; + __le32 link_fault_cnt; u8 buffer[20]; swStat_t sw_stat; xpakStat_t xpak_stat; -- cgit v1.2.3 From 15e541feb340bc2a4caaf707ee5ad71a47fdd068 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 10 Oct 2006 01:40:55 -0400 Subject: [PATCH] irda: donauboe fixes, cleanups - fix: toshoboe_invalid_dev() was recently removed, but not all callers were updated, causing the obvious linker error. Remove caller, because the check (like the one removed) isn't used. - fix: propagate request_irq() return value - cleanup: remove void* casts - cleanup: remove impossible ASSERTs Signed-off-by: Jeff Garzik Signed-off-by: Linus Torvalds --- drivers/net/irda/donauboe.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 636d0630fe0..16620bd97fb 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c @@ -1154,13 +1154,10 @@ dumpbufs(skb->data,skb->len,'>'); static irqreturn_t toshoboe_interrupt (int irq, void *dev_id) { - struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; + struct toshoboe_cb *self = dev_id; __u8 irqstat; struct sk_buff *skb = NULL; - if (self == NULL && toshoboe_invalid_dev(irq)) - return IRQ_NONE; - irqstat = INB (OBOE_ISR); /* was it us */ @@ -1348,13 +1345,11 @@ toshoboe_net_open (struct net_device *dev) { struct toshoboe_cb *self; unsigned long flags; + int rc; IRDA_DEBUG (4, "%s()\n", __FUNCTION__); - IRDA_ASSERT (dev != NULL, return -1; ); - self = (struct toshoboe_cb *) dev->priv; - - IRDA_ASSERT (self != NULL, return 0; ); + self = netdev_priv(dev); if (self->async) return -EBUSY; @@ -1362,11 +1357,10 @@ toshoboe_net_open (struct net_device *dev) if (self->stopped) return 0; - if (request_irq (self->io.irq, toshoboe_interrupt, - IRQF_SHARED | IRQF_DISABLED, dev->name, (void *) self)) - { - return -EAGAIN; - } + rc = request_irq (self->io.irq, toshoboe_interrupt, + IRQF_SHARED | IRQF_DISABLED, dev->name, self); + if (rc) + return rc; spin_lock_irqsave(&self->spinlock, flags); toshoboe_startchip (self); -- cgit v1.2.3 From 0968cf51b6f2ca8a951de4b976370189cf43bbdd Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 10 Oct 2006 02:58:14 -0400 Subject: [PATCH] firmware/dcdbas: fix bug in error cleanup The error path path mistakenly called sysfs_create_group() rather than sysfs_remove_group(). They take the same arguments, so it's easy to cut-n-paste such a bug. Signed-off-by: Jeff Garzik Signed-off-by: Linus Torvalds --- drivers/firmware/dcdbas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c index 339f405ff70..8bcb58cd4ac 100644 --- a/drivers/firmware/dcdbas.c +++ b/drivers/firmware/dcdbas.c @@ -559,7 +559,7 @@ static int __devinit dcdbas_probe(struct platform_device *dev) while (--i >= 0) sysfs_remove_bin_file(&dev->dev.kobj, dcdbas_bin_attrs[i]); - sysfs_create_group(&dev->dev.kobj, &dcdbas_attr_group); + sysfs_remove_group(&dev->dev.kobj, &dcdbas_attr_group); return error; } } -- cgit v1.2.3 From 53a5fbdc2dff55161a206ed1a1385a8fa8055c34 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 10 Oct 2006 17:14:44 -0700 Subject: ACPI: Allow setting SCI_EN bit in PM1_CONTROL register MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed by at least the Mac Mini's, which (incorrectly) come back from suspend with SCI_EN clear. Thanks to Frédéric Riss for hunting this down. Acked-by: Frédéric Riss Cc: Pavel Machek Cc: Len Brown Cc: Arjan van de Ven Signed-off-by: Linus Torvalds --- drivers/acpi/hardware/hwregs.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index 3143f36fcec..fa58c1edce1 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c @@ -665,8 +665,6 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) /* * Perform a read first to preserve certain bits (per ACPI spec) - * - * Note: This includes SCI_EN, we never want to change this bit */ status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_CONTROL, -- cgit v1.2.3