diff options
Diffstat (limited to 'drivers')
177 files changed, 1205 insertions, 1026 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 2e79a3395ec..301e832e696 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -434,18 +434,18 @@ static int acpi_button_add(struct acpi_device *device) switch (button->type) { case ACPI_BUTTON_TYPE_POWER: case ACPI_BUTTON_TYPE_POWERF: - input->evbit[0] = BIT(EV_KEY); + input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_POWER, input->keybit); break; case ACPI_BUTTON_TYPE_SLEEP: case ACPI_BUTTON_TYPE_SLEEPF: - input->evbit[0] = BIT(EV_KEY); + input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_SLEEP, input->keybit); break; case ACPI_BUTTON_TYPE_LID: - input->evbit[0] = BIT(EV_SW); + input->evbit[0] = BIT_MASK(EV_SW); set_bit(SW_LID, input->swbit); break; } diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index cb136a919f2..ac4a0cb217a 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -188,7 +188,7 @@ static int sock_xmit(struct nbd_device *lo, int send, void *buf, int size, if (signal_pending(current)) { siginfo_t info; printk(KERN_WARNING "nbd (pid %d: %s) got signal %d\n", - current->pid, current->comm, + task_pid_nr(current), current->comm, dequeue_signal_lock(current, ¤t->blocked, &info)); result = -EINTR; sock_shutdown(lo, !send); diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index d70745c8425..af056105316 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -1107,7 +1107,7 @@ int open_for_data(struct cdrom_device_info * cdi) is the default case! */ cdinfo(CD_OPEN, "bummer. wrong media type.\n"); cdinfo(CD_WARNING, "pid %d must open device O_NONBLOCK!\n", - (unsigned int)current->pid); + (unsigned int)task_pid_nr(current)); ret=-EMEDIUMTYPE; goto clean_up_and_return; } diff --git a/drivers/char/drm/drm_bufs.c b/drivers/char/drm/drm_bufs.c index 856774fbe02..d24a6c2c2c2 100644 --- a/drivers/char/drm/drm_bufs.c +++ b/drivers/char/drm/drm_bufs.c @@ -1456,7 +1456,7 @@ int drm_freebufs(struct drm_device *dev, void *data, buf = dma->buflist[idx]; if (buf->file_priv != file_priv) { DRM_ERROR("Process %d freeing buffer not owned\n", - current->pid); + task_pid_nr(current)); return -EINVAL; } drm_free_buffer(dev, buf); diff --git a/drivers/char/drm/drm_drv.c b/drivers/char/drm/drm_drv.c index 72668b15e5c..44a46268b02 100644 --- a/drivers/char/drm/drm_drv.c +++ b/drivers/char/drm/drm_drv.c @@ -463,7 +463,7 @@ int drm_ioctl(struct inode *inode, struct file *filp, ++file_priv->ioctl_count; DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n", - current->pid, cmd, nr, + task_pid_nr(current), cmd, nr, (long)old_encode_dev(file_priv->head->device), file_priv->authenticated); diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c index f383fc37190..3992f73299c 100644 --- a/drivers/char/drm/drm_fops.c +++ b/drivers/char/drm/drm_fops.c @@ -234,7 +234,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp, if (!drm_cpu_valid()) return -EINVAL; - DRM_DEBUG("pid = %d, minor = %d\n", current->pid, minor); + DRM_DEBUG("pid = %d, minor = %d\n", task_pid_nr(current), minor); priv = drm_alloc(sizeof(*priv), DRM_MEM_FILES); if (!priv) @@ -244,7 +244,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp, filp->private_data = priv; priv->filp = filp; priv->uid = current->euid; - priv->pid = current->pid; + priv->pid = task_pid_nr(current); priv->minor = minor; priv->head = drm_heads[minor]; priv->ioctl_count = 0; @@ -339,7 +339,8 @@ int drm_release(struct inode *inode, struct file *filp) */ DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n", - current->pid, (long)old_encode_dev(file_priv->head->device), + task_pid_nr(current), + (long)old_encode_dev(file_priv->head->device), dev->open_count); if (dev->driver->reclaim_buffers_locked && dev->lock.hw_lock) { diff --git a/drivers/char/drm/drm_lock.c b/drivers/char/drm/drm_lock.c index c6b73e744d6..bea2a7d5b2b 100644 --- a/drivers/char/drm/drm_lock.c +++ b/drivers/char/drm/drm_lock.c @@ -58,12 +58,12 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) if (lock->context == DRM_KERNEL_CONTEXT) { DRM_ERROR("Process %d using kernel context %d\n", - current->pid, lock->context); + task_pid_nr(current), lock->context); return -EINVAL; } DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n", - lock->context, current->pid, + lock->context, task_pid_nr(current), dev->lock.hw_lock->lock, lock->flags); if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE)) @@ -153,7 +153,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) if (lock->context == DRM_KERNEL_CONTEXT) { DRM_ERROR("Process %d using kernel context %d\n", - current->pid, lock->context); + task_pid_nr(current), lock->context); return -EINVAL; } diff --git a/drivers/char/drm/drm_os_linux.h b/drivers/char/drm/drm_os_linux.h index 114e54e0f61..76e44ac94fb 100644 --- a/drivers/char/drm/drm_os_linux.h +++ b/drivers/char/drm/drm_os_linux.h @@ -7,7 +7,7 @@ #include <linux/delay.h> /** Current process ID */ -#define DRM_CURRENTPID current->pid +#define DRM_CURRENTPID task_pid_nr(current) #define DRM_SUSER(p) capable(CAP_SYS_ADMIN) #define DRM_UDELAY(d) udelay(d) /** Read a byte from a MMIO region */ diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c index 8e841bdee6d..eb381a7c5be 100644 --- a/drivers/char/drm/i810_dma.c +++ b/drivers/char/drm/i810_dma.c @@ -1024,7 +1024,7 @@ static int i810_getbuf(struct drm_device *dev, void *data, retcode = i810_dma_get_buffer(dev, d, file_priv); DRM_DEBUG("i810_dma: %d returning %d, granted = %d\n", - current->pid, retcode, d->granted); + task_pid_nr(current), retcode, d->granted); sarea_priv->last_dispatch = (int)hw_status[5]; diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c index 43a1f78712d..69a363edb0d 100644 --- a/drivers/char/drm/i830_dma.c +++ b/drivers/char/drm/i830_dma.c @@ -1409,7 +1409,7 @@ static int i830_getbuf(struct drm_device *dev, void *data, retcode = i830_dma_get_buffer(dev, d, file_priv); DRM_DEBUG("i830_dma: %d returning %d, granted = %d\n", - current->pid, retcode, d->granted); + task_pid_nr(current), retcode, d->granted); sarea_priv->last_dispatch = (int)hw_status[5]; diff --git a/drivers/char/esp.c b/drivers/char/esp.c index 2e7ae42a550..0f8fb135da5 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c @@ -58,10 +58,10 @@ #include <linux/mm.h> #include <linux/init.h> #include <linux/delay.h> +#include <linux/bitops.h> #include <asm/system.h> #include <asm/io.h> -#include <asm/bitops.h> #include <asm/dma.h> #include <linux/slab.h> diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 212276affa1..fc54d234507 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -42,6 +42,7 @@ #include <linux/sysrq.h> #include <linux/input.h> #include <linux/reboot.h> +#include <linux/notifier.h> extern void ctrl_alt_del(void); @@ -81,7 +82,8 @@ void compute_shiftstate(void); typedef void (k_handler_fn)(struct vc_data *vc, unsigned char value, char up_flag); static k_handler_fn K_HANDLERS; -static k_handler_fn *k_handler[16] = { K_HANDLERS }; +k_handler_fn *k_handler[16] = { K_HANDLERS }; +EXPORT_SYMBOL_GPL(k_handler); #define FN_HANDLERS\ fn_null, fn_enter, fn_show_ptregs, fn_show_mem,\ @@ -127,7 +129,7 @@ int shift_state = 0; */ static struct input_handler kbd_handler; -static unsigned long key_down[NBITS(KEY_MAX)]; /* keyboard key bitmap */ +static unsigned long key_down[BITS_TO_LONGS(KEY_CNT)]; /* keyboard key bitmap */ static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */ static int dead_key_next; static int npadch = -1; /* -1 or number assembled on pad */ @@ -160,6 +162,23 @@ static int sysrq_alt_use; static int sysrq_alt; /* + * Notifier list for console keyboard events + */ +static ATOMIC_NOTIFIER_HEAD(keyboard_notifier_list); + +int register_keyboard_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&keyboard_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(register_keyboard_notifier); + +int unregister_keyboard_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&keyboard_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(unregister_keyboard_notifier); + +/* * Translation of scancodes to keycodes. We set them on only the first * keyboard in the list that accepts the scancode and keycode. * Explanation for not choosing the first attached keyboard anymore: @@ -1130,6 +1149,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) unsigned char type, raw_mode; struct tty_struct *tty; int shift_final; + struct keyboard_notifier_param param = { .vc = vc, .value = keycode, .down = down }; tty = vc->vc_tty; @@ -1217,10 +1237,11 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) return; } - shift_final = (shift_state | kbd->slockstate) ^ kbd->lockstate; + param.shift = shift_final = (shift_state | kbd->slockstate) ^ kbd->lockstate; key_map = key_maps[shift_final]; - if (!key_map) { + if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_KEYCODE, ¶m) == NOTIFY_STOP || !key_map) { + atomic_notifier_call_chain(&keyboard_notifier_list, KBD_UNBOUND_KEYCODE, ¶m); compute_shiftstate(); kbd->slockstate = 0; return; @@ -1237,6 +1258,9 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) type = KTYP(keysym); if (type < 0xf0) { + param.value = keysym; + if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_UNICODE, ¶m) == NOTIFY_STOP) + return; if (down && !raw_mode) to_utf8(vc, keysym); return; @@ -1244,9 +1268,6 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) type -= 0xf0; - if (raw_mode && type != KT_SPEC && type != KT_SHIFT) - return; - if (type == KT_LETTER) { type = KT_LATIN; if (vc_kbd_led(kbd, VC_CAPSLOCK)) { @@ -1255,9 +1276,18 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) keysym = key_map[keycode]; } } + param.value = keysym; + + if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_KEYSYM, ¶m) == NOTIFY_STOP) + return; + + if (raw_mode && type != KT_SPEC && type != KT_SHIFT) + return; (*k_handler[type])(vc, keysym & 0xff, !down); + atomic_notifier_call_chain(&keyboard_notifier_list, KBD_POST_KEYSYM, ¶m); + if (type != KT_SLOCK) kbd->slockstate = 0; } @@ -1347,12 +1377,12 @@ static void kbd_start(struct input_handle *handle) static const struct input_device_id kbd_ids[] = { { .flags = INPUT_DEVICE_ID_MATCH_EVBIT, - .evbit = { BIT(EV_KEY) }, + .evbit = { BIT_MASK(EV_KEY) }, }, { .flags = INPUT_DEVICE_ID_MATCH_EVBIT, - .evbit = { BIT(EV_SND) }, + .evbit = { BIT_MASK(EV_SND) }, }, { }, /* Terminating entry */ diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 661aca0e155..fd0abef7ee0 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -56,11 +56,11 @@ #include <linux/mm.h> #include <linux/delay.h> #include <linux/pci.h> +#include <linux/bitops.h> #include <asm/system.h> #include <asm/io.h> #include <asm/irq.h> -#include <asm/bitops.h> #include <asm/uaccess.h> #include "mxser.h" diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c index 854dbf59eb6..081c84c7b54 100644 --- a/drivers/char/mxser_new.c +++ b/drivers/char/mxser_new.c @@ -39,11 +39,11 @@ #include <linux/mm.h> #include <linux/delay.h> #include <linux/pci.h> +#include <linux/bitops.h> #include <asm/system.h> #include <asm/io.h> #include <asm/irq.h> -#include <asm/bitops.h> #include <asm/uaccess.h> #include "mxser_new.h" diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 859858561ab..9782cb4d30d 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c @@ -1178,9 +1178,9 @@ static int __devinit sonypi_create_input_devices(void) jog_dev->id.bustype = BUS_ISA; jog_dev->id.vendor = PCI_VENDOR_ID_SONY; - jog_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - jog_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_MIDDLE); - jog_dev->relbit[0] = BIT(REL_WHEEL); + jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE); + jog_dev->relbit[0] = BIT_MASK(REL_WHEEL); sonypi_device.input_key_dev = key_dev = input_allocate_device(); if (!key_dev) { @@ -1193,7 +1193,7 @@ static int __devinit sonypi_create_input_devices(void) key_dev->id.vendor = PCI_VENDOR_ID_SONY; /* Initialize the Input Drivers: special keys */ - key_dev->evbit[0] = BIT(EV_KEY); + key_dev->evbit[0] = BIT_MASK(EV_KEY); for (i = 0; sonypi_inputkeys[i].sonypiev; i++) if (sonypi_inputkeys[i].inputev) set_bit(sonypi_inputkeys[i].inputev, key_dev->keybit); diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 85a23283dff..a6e1c9ba121 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -1467,7 +1467,7 @@ static int sx_open(struct tty_struct *tty, struct file *filp) line = tty->index; sx_dprintk(SX_DEBUG_OPEN, "%d: opening line %d. tty=%p ctty=%p, " - "np=%d)\n", current->pid, line, tty, + "np=%d)\n", task_pid_nr(current), line, tty, current->signal->tty, sx_nports); if ((line < 0) || (line >= SX_NPORTS) || (line >= sx_nports)) diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 78d14935f2b..de60e1ea4fb 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c @@ -251,7 +251,7 @@ static void send_sig_all(int sig) struct task_struct *p; for_each_process(p) { - if (p->mm && !is_init(p)) + if (p->mm && !is_global_init(p)) /* Not swapper, init nor kernel thread */ force_sig(sig, p); } diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 9c867cf6de6..13a53575a01 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -103,6 +103,7 @@ #include <linux/selection.h> #include <linux/kmod.h> +#include <linux/nsproxy.h> #undef TTY_DEBUG_HANGUP @@ -3107,7 +3108,7 @@ static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t */ if (tty == real_tty && current->signal->tty != real_tty) return -ENOTTY; - return put_user(pid_nr(real_tty->pgrp), p); + return put_user(pid_vnr(real_tty->pgrp), p); } /** @@ -3141,7 +3142,7 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t if (pgrp_nr < 0) return -EINVAL; rcu_read_lock(); - pgrp = find_pid(pgrp_nr); + pgrp = find_vpid(pgrp_nr); retval = -ESRCH; if (!pgrp) goto out_unlock; @@ -3178,7 +3179,7 @@ static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t _ return -ENOTTY; if (!real_tty->session) return -ENOTTY; - return put_user(pid_nr(real_tty->session), p); + return put_user(pid_vnr(real_tty->session), p); } /** @@ -3528,8 +3529,8 @@ void __do_SAK(struct tty_struct *tty) /* Kill the entire session */ do_each_pid_task(session, PIDTYPE_SID, p) { printk(KERN_NOTICE "SAK: killed process %d" - " (%s): process_session(p)==tty->session\n", - p->pid, p->comm); + " (%s): task_session_nr(p)==tty->session\n", + task_pid_nr(p), p->comm); send_sig(SIGKILL, p, 1); } while_each_pid_task(session, PIDTYPE_SID, p); /* Now kill any processes that happen to have the @@ -3538,8 +3539,8 @@ void __do_SAK(struct tty_struct *tty) do_each_thread(g, p) { if (p->signal->tty == tty) { printk(KERN_NOTICE "SAK: killed process %d" - " (%s): process_session(p)==tty->session\n", - p->pid, p->comm); + " (%s): task_session_nr(p)==tty->session\n", + task_pid_nr(p), p->comm); send_sig(SIGKILL, p, 1); continue; } @@ -3559,7 +3560,7 @@ void __do_SAK(struct tty_struct *tty) filp->private_data == tty) { printk(KERN_NOTICE "SAK: killed process %d" " (%s): fd#%d opened to the tty\n", - p->pid, p->comm, i); + task_pid_nr(p), p->comm, i); force_sig(SIGKILL, p); break; } diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 1764c67b585..7a5badfb7d8 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -99,6 +99,7 @@ #include <linux/pm.h> #include <linux/font.h> #include <linux/bitops.h> +#include <linux/notifier.h> #include <asm/io.h> #include <asm/system.h> @@ -223,6 +224,35 @@ enum { }; /* + * Notifier list for console events. + */ +static ATOMIC_NOTIFIER_HEAD(vt_notifier_list); + +int register_vt_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_register(&vt_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(register_vt_notifier); + +int unregister_vt_notifier(struct notifier_block *nb) +{ + return atomic_notifier_chain_unregister(&vt_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(unregister_vt_notifier); + +static void notify_write(struct vc_data *vc, unsigned int unicode) +{ + struct vt_notifier_param param = { .vc = vc, unicode = unicode }; + atomic_notifier_call_chain(&vt_notifier_list, VT_WRITE, ¶m); +} + +static void notify_update(struct vc_data *vc) +{ + struct vt_notifier_param param = { .vc = vc }; + atomic_notifier_call_chain(&vt_notifier_list, VT_UPDATE, ¶m); +} + +/* * Low-Level Functions */ @@ -718,6 +748,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ return -ENXIO; if (!vc_cons[currcons].d) { struct vc_data *vc; + struct vt_notifier_param param; /* prevent users from taking too much memory */ if (currcons >= MAX_NR_USER_CONSOLES && !capable(CAP_SYS_RESOURCE)) @@ -729,7 +760,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ /* although the numbers above are not valid since long ago, the point is still up-to-date and the comment still has its value even if only as a historical artifact. --mj, July 1998 */ - vc = kzalloc(sizeof(struct vc_data), GFP_KERNEL); + param.vc = vc = kzalloc(sizeof(struct vc_data), GFP_KERNEL); if (!vc) return -ENOMEM; vc_cons[currcons].d = vc; @@ -746,6 +777,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ } vc->vc_kmalloced = 1; vc_init(vc, vc->vc_rows, vc->vc_cols, 1); + atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, ¶m); } return 0; } @@ -907,6 +939,8 @@ void vc_deallocate(unsigned int currcons) if (vc_cons_allocated(currcons)) { struct vc_data *vc = vc_cons[currcons].d; + struct vt_notifier_param param = { .vc = vc }; + atomic_notifier_call_chain(&vt_notifier_list, VT_DEALLOCATE, ¶m); vc->vc_sw->con_deinit(vc); put_pid(vc->vt_pid); module_put(vc->vc_sw->owner); @@ -1019,6 +1053,7 @@ static void lf(struct vc_data *vc) vc->vc_pos += vc->vc_size_row; } vc->vc_need_wrap = 0; + notify_write(vc, '\n'); } static void ri(struct vc_data *vc) @@ -1039,6 +1074,7 @@ static inline void cr(struct vc_data *vc) { vc->vc_pos -= vc->vc_x << 1; vc->vc_need_wrap = vc->vc_x = 0; + notify_write(vc, '\r'); } static inline void bs(struct vc_data *vc) @@ -1047,6 +1083,7 @@ static inline void bs(struct vc_data *vc) vc->vc_pos -= 2; vc->vc_x--; vc->vc_need_wrap = 0; + notify_write(vc, '\b'); } } @@ -1593,6 +1630,7 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) break; } vc->vc_pos += (vc->vc_x << 1); + notify_write(vc, '\t'); return; case 10: case 11: case 12: lf(vc); @@ -2252,6 +2290,7 @@ rescan_last_byte: tc = conv_uni_to_pc(vc, ' '); /* A space is printed in the second column */ if (tc < 0) tc = ' '; } + notify_write(vc, c); if (inverse) { FLUSH @@ -2274,6 +2313,7 @@ rescan_last_byte: release_console_sem(); out: + notify_update(vc); return n; #undef FLUSH } @@ -2317,6 +2357,7 @@ static void console_callback(struct work_struct *ignored) do_blank_screen(0); blank_timer_expired = 0; } + notify_update(vc_cons[fg_console].d); release_console_sem(); } @@ -2418,6 +2459,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count) continue; } scr_writew((vc->vc_attr << 8) + c, (unsigned short *)vc->vc_pos); + notify_write(vc, c); cnt++; if (myx == vc->vc_cols - 1) { vc->vc_need_wrap = 1; @@ -2436,6 +2478,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count) } } set_cursor(vc); + notify_update(vc); quit: clear_bit(0, &printing); diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index e80af67664c..2d23e304f5e 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h @@ -94,8 +94,6 @@ extern int edac_debug_level; #endif /* !CONFIG_EDAC_DEBUG */ -#define BIT(x) (1 << (x)) - #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ PCI_DEVICE_ID_ ## vend ## _ ## dev diff --git a/drivers/edac/pasemi_edac.c b/drivers/edac/pasemi_edac.c index e66cdd42a39..9007d067722 100644 --- a/drivers/edac/pasemi_edac.c +++ b/drivers/edac/pasemi_edac.c @@ -270,6 +270,7 @@ static void __devexit pasemi_edac_remove(struct pci_dev *pdev) static const struct pci_device_id pasemi_edac_pci_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_PASEMI, 0xa00a) }, + { } }; MODULE_DEVICE_TABLE(pci, pasemi_edac_pci_tbl); diff --git a/drivers/firmware/dcdbas.h b/drivers/firmware/dcdbas.h index dcdba0f1b32..87bc3417de2 100644 --- a/drivers/firmware/dcdbas.h +++ b/drivers/firmware/dcdbas.h @@ -17,7 +17,6 @@ #define _DCDBAS_H_ #include <linux/device.h> -#include <linux/input.h> #include <linux/sysfs.h> #include <linux/types.h> diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index a702e2f6da7..1ca6f4635ee 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -113,13 +113,13 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t if (count > HID_MIN_BUFFER_SIZE) { printk(KERN_WARNING "hidraw: pid %d passed too large report\n", - current->pid); + task_pid_nr(current)); return -EINVAL; } if (count < 2) { printk(KERN_WARNING "hidraw: pid %d passed too short report\n", - current->pid); + task_pid_nr(current)); return -EINVAL; } diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index b76b02f7b52..775a1ef28a2 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c @@ -274,8 +274,11 @@ static int usb_kbd_probe(struct usb_interface *iface, input_set_drvdata(input_dev, kbd); - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); - input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL) | BIT(LED_COMPOSE) | BIT(LED_KANA); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) | + BIT_MASK(EV_REP); + input_dev->ledbit[0] = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) | + BIT_MASK(LED_SCROLLL) | BIT_MASK(LED_COMPOSE) | + BIT_MASK(LED_KANA); for (i = 0; i < 255; i++) set_bit(usb_kbd_keycode[i], input_dev->keybit); diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index 5345c73bcf6..f8ad6910d3d 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c @@ -173,11 +173,13 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i usb_to_input_id(dev, &input_dev->id); input_dev->dev.parent = &intf->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); - input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA); - input_dev->relbit[0] |= BIT(REL_WHEEL); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); + input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_SIDE) | + BIT_MASK(BTN_EXTRA); + input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); input_set_drvdata(input_dev, mouse); diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 4879125b4cd..1001d2e122a 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -1099,7 +1099,7 @@ static int applesmc_create_accelerometer(void) idev->name = "applesmc"; idev->id.bustype = BUS_HOST; idev->dev.parent = &pdev->dev; - idev->evbit[0] = BIT(EV_ABS); + idev->evbit[0] = BIT_MASK(EV_ABS); input_set_abs_params(idev, ABS_X, -256, 256, APPLESMC_INPUT_FUZZ, APPLESMC_INPUT_FLAT); input_set_abs_params(idev, ABS_Y, diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c index 8a7ae03aeee..bab5fd2e4df 100644 --- a/drivers/hwmon/hdaps.c +++ b/drivers/hwmon/hdaps.c @@ -574,7 +574,7 @@ static int __init hdaps_init(void) idev = hdaps_idev->input; idev->name = "hdaps"; idev->dev.parent = &pdev->dev; - idev->evbit[0] = BIT(EV_ABS); + idev->evbit[0] = BIT_MASK(EV_ABS); input_set_abs_params(idev, ABS_X, -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT); input_set_abs_params(idev, ABS_Y, diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 00fad11733a..6426a61f8d4 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -85,7 +85,7 @@ struct bits { const char *set; const char *unset; }; -#define BIT(m, s, u) { .mask = m, .set = s, .unset = u } +#define PXA_BIT(m, s, u) { .mask = m, .set = s, .unset = u } static inline void decode_bits(const char *prefix, const struct bits *bits, int num, u32 val) @@ -100,17 +100,17 @@ decode_bits(const char *prefix, const struct bits *bits, int num, u32 val) } static const struct bits isr_bits[] = { - BIT(ISR_RWM, "RX", "TX"), - BIT(ISR_ACKNAK, "NAK", "ACK"), - BIT(ISR_UB, "Bsy", "Rdy"), - BIT(ISR_IBB, "BusBsy", "BusRdy"), - BIT(ISR_SSD, "SlaveStop", NULL), - BIT(ISR_ALD, "ALD", NULL), - BIT(ISR_ITE, "TxEmpty", NULL), - BIT(ISR_IRF, "RxFull", NULL), - BIT(ISR_GCAD, "GenCall", NULL), - BIT(ISR_SAD, "SlaveAddr", NULL), - BIT(ISR_BED, "BusErr", NULL), + PXA_BIT(ISR_RWM, "RX", "TX"), + PXA_BIT(ISR_ACKNAK, "NAK", "ACK"), + PXA_BIT(ISR_UB, "Bsy", "Rdy"), + PXA_BIT(ISR_IBB, "BusBsy", "BusRdy"), + PXA_BIT(ISR_SSD, "SlaveStop", NULL), + PXA_BIT(ISR_ALD, "ALD", NULL), + PXA_BIT(ISR_ITE, "TxEmpty", NULL), + PXA_BIT(ISR_IRF, "RxFull", NULL), + PXA_BIT(ISR_GCAD, "GenCall", NULL), + PXA_BIT(ISR_SAD, "SlaveAddr", NULL), + PXA_BIT(ISR_BED, "BusErr", NULL), }; static void decode_ISR(unsigned int val) @@ -120,21 +120,21 @@ static void decode_ISR(unsigned int val) } static const struct bits icr_bits[] = { - BIT(ICR_START, "START", NULL), - BIT(ICR_STOP, "STOP", NULL), - BIT(ICR_ACKNAK, "ACKNAK", NULL), - BIT(ICR_TB, "TB", NULL), - BIT(ICR_MA, "MA", NULL), - BIT(ICR_SCLE, "SCLE", "scle"), - BIT(ICR_IUE, "IUE", "iue"), - BIT(ICR_GCD, "GCD", NULL), - BIT(ICR_ITEIE, "ITEIE", NULL), - BIT(ICR_IRFIE, "IRFIE", NULL), - BIT(ICR_BEIE, "BEIE", NULL), - BIT(ICR_SSDIE, "SSDIE", NULL), - BIT(ICR_ALDIE, "ALDIE", NULL), - BIT(ICR_SADIE, "SADIE", NULL), - BIT(ICR_UR, "UR", "ur"), + PXA_BIT(ICR_START, "START", NULL), + PXA_BIT(ICR_STOP, "STOP", NULL), + PXA_BIT(ICR_ACKNAK, "ACKNAK", NULL), + PXA_BIT(ICR_TB, "TB", NULL), + PXA_BIT(ICR_MA, "MA", NULL), + PXA_BIT(ICR_SCLE, "SCLE", "scle"), + PXA_BIT(ICR_IUE, "IUE", "iue"), + PXA_BIT(ICR_GCD, "GCD", NULL), + PXA_BIT(ICR_ITEIE, "ITEIE", NULL), + PXA_BIT(ICR_IRFIE, "IRFIE", NULL), + PXA_BIT(ICR_BEIE, "BEIE", NULL), + PXA_BIT(ICR_SSDIE, "SSDIE", NULL), + PXA_BIT(ICR_ALDIE, "ALDIE", NULL), + PXA_BIT(ICR_SADIE, "SADIE", NULL), + PXA_BIT(ICR_UR, "UR", "ur"), }; static void decode_ICR(unsigned int val) diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 5c8b008676f..32eaa3f8051 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -47,12 +47,12 @@ #include <linux/device.h> #include <linux/kmod.h> #include <linux/scatterlist.h> +#include <linux/bitops.h> #include <asm/byteorder.h> #include <asm/irq.h> #include <asm/uaccess.h> #include <asm/io.h> -#include <asm/bitops.h> static int __ide_end_request(ide_drive_t *drive, struct request *rq, int uptodate, unsigned int nr_bytes) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 93644f82592..d08fb30768b 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -2797,11 +2797,12 @@ static void cma_remove_one(struct ib_device *device) static int cma_init(void) { - int ret, low, high; + int ret, low, high, remaining; get_random_bytes(&next_port, sizeof next_port); inet_get_local_port_range(&low, &high); - next_port = ((unsigned int) next_port % (high - low)) + low; + remaining = (high - low) + 1; + next_port = ((unsigned int) next_port % remaining) + low; cma_wq = create_singlethread_workqueue("rdma_cm"); if (!cma_wq) diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 1d62c8b88e1..e5b4e9bfbdc 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -495,7 +495,7 @@ static unsigned int evdev_poll(struct file *file, poll_table *wait) #ifdef CONFIG_COMPAT #define BITS_PER_LONG_COMPAT (sizeof(compat_long_t) * 8) -#define NBITS_COMPAT(x) ((((x) - 1) / BITS_PER_LONG_COMPAT) + 1) +#define BITS_TO_LONGS_COMPAT(x) ((((x) - 1) / BITS_PER_LONG_COMPAT) + 1) #ifdef __BIG_ENDIAN static int bits_to_user(unsigned long *bits, unsigned int maxbit, @@ -504,7 +504,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, int len, i; if (compat) { - len = NBITS_COMPAT(maxbit) * sizeof(compat_long_t); + len = BITS_TO_LONGS_COMPAT(maxbit) * sizeof(compat_long_t); if (len > maxlen) len = maxlen; @@ -515,7 +515,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, sizeof(compat_long_t))) return -EFAULT; } else { - len = NBITS(maxbit) * sizeof(long); + len = BITS_TO_LONGS(maxbit) * sizeof(long); if (len > maxlen) len = maxlen; @@ -530,8 +530,8 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, unsigned int maxlen, void __user *p, int compat) { int len = compat ? - NBITS_COMPAT(maxbit) * sizeof(compat_long_t) : - NBITS(maxbit) * sizeof(long); + BITS_TO_LONGS_COMPAT(maxbit) * sizeof(compat_long_t) : + BITS_TO_LONGS(maxbit) * sizeof(long); if (len > maxlen) len = maxlen; @@ -545,7 +545,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, static int bits_to_user(unsigned long *bits, unsigned int maxbit, unsigned int maxlen, void __user *p, int compat) { - int len = NBITS(maxbit) * sizeof(long); + int len = BITS_TO_LONGS(maxbit) * sizeof(long); if (len > maxlen) len = maxlen; diff --git a/drivers/input/input.c b/drivers/input/input.c index 2f2b020cd62..307c7b5c2b3 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -584,10 +584,10 @@ static int input_default_setkeycode(struct input_dev *dev, #define MATCH_BIT(bit, max) \ - for (i = 0; i < NBITS(max); i++) \ + for (i = 0; i < BITS_TO_LONGS(max); i++) \ if ((id->bit[i] & dev->bit[i]) != id->bit[i]) \ break; \ - if (i != NBITS(max)) \ + if (i != BITS_TO_LONGS(max)) \ continue; static const struct input_device_id *input_match_device(const struct input_device_id *id, @@ -698,7 +698,7 @@ static void input_seq_print_bitmap(struct seq_file *seq, const char *name, { int i; - for (i = NBITS(max) - 1; i > 0; i--) + for (i = BITS_TO_LONGS(max) - 1; i > 0; i--) if (bitmap[i]) break; @@ -892,7 +892,7 @@ static int input_print_modalias_bits(char *buf, int size, len += snprintf(buf, max(size, 0), "%c", name); for (i = min_bit; i < max_bit; i++) - if (bm[LONG(i)] & BIT(i)) + if (bm[BIT_WORD(i)] & BIT_MASK(i)) len += snprintf(buf + len, max(size - len, 0), "%X,", i); return len; } @@ -991,7 +991,7 @@ static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap, int i; int len = 0; - for (i = NBITS(max) - 1; i > 0; i--) + for (i = BITS_TO_LONGS(max) - 1; i > 0; i--) if (bitmap[i]) break; diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 2b201f9aa02..22b2789ef58 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -844,8 +844,8 @@ static const struct input_device_id joydev_blacklist[] = { { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT, - .evbit = { BIT(EV_KEY) }, - .keybit = { [LONG(BTN_TOUCH)] = BIT(BTN_TOUCH) }, + .evbit = { BIT_MASK(EV_KEY) }, + .keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) }, }, /* Avoid itouchpads, touchscreens and tablets */ { } /* Terminating entry */ }; @@ -854,20 +854,20 @@ static const struct input_device_id joydev_ids[] = { { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, - .evbit = { BIT(EV_ABS) }, - .absbit = { BIT(ABS_X) }, + .evbit = { BIT_MASK(EV_ABS) }, + .absbit = { BIT_MASK(ABS_X) }, }, { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, - .evbit = { BIT(EV_ABS) }, - .absbit = { BIT(ABS_WHEEL) }, + .evbit = { BIT_MASK(EV_ABS) }, + .absbit = { BIT_MASK(ABS_WHEEL) }, }, { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, - .evbit = { BIT(EV_ABS) }, - .absbit = { BIT(ABS_THROTTLE) }, + .evbit = { BIT_MASK(EV_ABS) }, + .absbit = { BIT_MASK(ABS_THROTTLE) }, }, { } /* Terminating entry */ }; diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c index ff701ab10d7..52ba16f487c 100644 --- a/drivers/input/joystick/a3d.c +++ b/drivers/input/joystick/a3d.c @@ -326,14 +326,19 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv) a3d->length = 33; - input_dev->evbit[0] |= BIT(EV_ABS) | BIT(EV_KEY) | BIT(EV_REL); - input_dev->relbit[0] |= BIT(REL_X) | BIT(REL_Y); - input_dev->absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_THROTTLE) | BIT(ABS_RUDDER) - | BIT(ABS_HAT0X) | BIT(ABS_HAT0Y) | BIT(ABS_HAT1X) | BIT(ABS_HAT1Y); - input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE) - | BIT(BTN_SIDE) | BIT(BTN_EXTRA); - input_dev->keybit[LONG(BTN_JOYSTICK)] |= BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP) - | BIT(BTN_PINKIE); + input_dev->evbit[0] |= BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY) | + BIT_MASK(EV_REL); + input_dev->relbit[0] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y); + input_dev->absbit[0] |= BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) | + BIT_MASK(ABS_THROTTLE) | BIT_MASK(ABS_RUDDER) | + BIT_MASK(ABS_HAT0X) | BIT_MASK(ABS_HAT0Y) | + BIT_MASK(ABS_HAT1X) | BIT_MASK(ABS_HAT1Y); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_RIGHT) | + BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) | + BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); + input_dev->keybit[BIT_WORD(BTN_JOYSTICK)] |= + BIT_MASK(BTN_TRIGGER) | BIT_MASK(BTN_THUMB) | + BIT_MASK(BTN_TOP) | BIT_MASK(BTN_PINKIE); a3d_read(a3d, data); @@ -348,9 +353,10 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv) } else { a3d->length = 29; - input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_REL); - input_dev->relbit[0] |= BIT(REL_X) | BIT(REL_Y); - input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE); + input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + input_dev->relbit[0] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_RIGHT) | + BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE); a3d_read(a3d, data); diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c index 28140c4a110..d1ca8a14950 100644 --- a/drivers/input/joystick/adi.c +++ b/drivers/input/joystick/adi.c @@ -431,7 +431,7 @@ static int adi_init_input(struct adi *adi, struct adi_port *port, int half) input_dev->open = adi_open; input_dev->close = adi_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad != -1)) * 2; i++) set_bit(adi->abs[i], input_dev->absbit); diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index b0f5541ec3e..5cf9f3610e6 100644 --- a/drivers/input/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c @@ -137,9 +137,10 @@ static int __init amijoy_init(void) amijoy_dev[i]->open = amijoy_open; amijoy_dev[i]->close = amijoy_close; - amijoy_dev[i]->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - amijoy_dev[i]->absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - amijoy_dev[i]->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); + amijoy_dev[i]->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + amijoy_dev[i]->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y); + amijoy_dev[i]->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); for (j = 0; j < 2; j++) { amijoy_dev[i]->absmin[ABS_X + j] = -1; amijoy_dev[i]->absmax[ABS_X + j] = 1; diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c index bdd157c1ebf..15739880afc 100644 --- a/drivers/input/joystick/analog.c +++ b/drivers/input/joystick/analog.c @@ -456,7 +456,7 @@ static int analog_init_device(struct analog_port *port, struct analog *analog, i input_dev->open = analog_open; input_dev->close = analog_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = j = 0; i < 4; i++) if (analog->mask & (1 << i)) { diff --git a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c index d3352a849b8..55646a6d89f 100644 --- a/drivers/input/joystick/cobra.c +++ b/drivers/input/joystick/cobra.c @@ -218,7 +218,7 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv) input_dev->open = cobra_open; input_dev->close = cobra_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); input_set_abs_params(input_dev, ABS_X, -1, 1, 0, 0); input_set_abs_params(input_dev, ABS_Y, -1, 1, 0, 0); for (j = 0; cobra_btn[j]; j++) diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c index b069ee18e35..27fc475bd3a 100644 --- a/drivers/input/joystick/db9.c +++ b/drivers/input/joystick/db9.c @@ -631,7 +631,7 @@ static struct db9 __init *db9_probe(int parport, int mode) input_dev->open = db9_open; input_dev->close = db9_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (j = 0; j < db9_mode->n_buttons; j++) set_bit(db9_mode->buttons[j], input_dev->keybit); for (j = 0; j < db9_mode->n_axis; j++) { diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index 1a452e0e5f2..df2a9d02ca6 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c @@ -653,12 +653,12 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type) input_dev->close = gc_close; if (pad_type != GC_SNESMOUSE) { - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = 0; i < 2; i++) input_set_abs_params(input_dev, ABS_X + i, -1, 1, 0, 0); } else - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); gc->pads[0] |= gc_status_bit[idx]; gc->pads[pad_type] |= gc_status_bit[idx]; diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c index d514aebf755..1f6302c0eb3 100644 --- a/drivers/input/joystick/gf2k.c +++ b/drivers/input/joystick/gf2k.c @@ -315,7 +315,7 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv) input_dev->open = gf2k_open; input_dev->close = gf2k_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = 0; i < gf2k_axes[gf2k->id]; i++) set_bit(gf2k_abs[i], input_dev->absbit); diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c index 73eb5ab6f14..fd3853ab1aa 100644 --- a/drivers/input/joystick/grip.c +++ b/drivers/input/joystick/grip.c @@ -370,7 +370,7 @@ static int grip_connect(struct gameport *gameport, struct gameport_driver *drv) input_dev->open = grip_open; input_dev->close = grip_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (j = 0; (t = grip_abs[grip->mode[i]][j]) >= 0; j++) { diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c index 4ed3a3eadf1..c57e21d68c0 100644 --- a/drivers/input/joystick/grip_mp.c +++ b/drivers/input/joystick/grip_mp.c @@ -606,7 +606,7 @@ static int register_slot(int slot, struct grip_mp *grip) input_dev->open = grip_open; input_dev->close = grip_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (j = 0; (t = grip_abs[port->mode][j]) >= 0; j++) input_set_abs_params(input_dev, t, -1, 1, 0, 0); diff --git a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c index d4e8073caf2..aa6bfb3fb8c 100644 --- a/drivers/input/joystick/guillemot.c +++ b/drivers/input/joystick/guillemot.c @@ -238,7 +238,7 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver * input_dev->open = guillemot_open; input_dev->close = guillemot_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = 0; (t = guillemot->type->abs[i]) >= 0; i++) input_set_abs_params(input_dev, t, 0, 255, 0, 0); diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index 682244b1c04..6f826b37d9a 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c @@ -389,7 +389,8 @@ int iforce_init_device(struct iforce *iforce) * Set input device bitfields and ranges. */ - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_FF_STATUS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | + BIT_MASK(EV_FF_STATUS); for (i = 0; iforce->type->btn[i] >= 0; i++) set_bit(iforce->type->btn[i], input_dev->keybit); diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h index 40a853ac21c..a964a7cfd21 100644 --- a/drivers/input/joystick/iforce/iforce.h +++ b/drivers/input/joystick/iforce/iforce.h @@ -62,13 +62,13 @@ #define FF_CORE_IS_PLAYED 3 /* Effect is currently being played */ #define FF_CORE_SHOULD_PLAY 4 /* User wants the effect to be played */ #define FF_CORE_UPDATE 5 /* Effect is being updated */ -#define FF_MODCORE_MAX 5 +#define FF_MODCORE_CNT 6 struct iforce_core_effect { /* Information about where modifiers are stored in the device's memory */ struct resource mod1_chunk; struct resource mod2_chunk; - unsigned long flags[NBITS(FF_MODCORE_MAX)]; + unsigned long flags[BITS_TO_LONGS(FF_MODCORE_CNT)]; }; #define FF_CMD_EFFECT 0x010e diff --git a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c index 1aec1e9d7c5..bc8ea95dfd0 100644 --- a/drivers/input/joystick/interact.c +++ b/drivers/input/joystick/interact.c @@ -269,7 +269,7 @@ static int interact_connect(struct gameport *gameport, struct gameport_driver *d input_dev->open = interact_open; input_dev->close = interact_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = 0; (t = interact_type[interact->type].abs[i]) >= 0; i++) { set_bit(t, input_dev->absbit); diff --git a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c index b35604ee43a..54e676948eb 100644 --- a/drivers/input/joystick/magellan.c +++ b/drivers/input/joystick/magellan.c @@ -170,7 +170,7 @@ static int magellan_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = 0; i < 9; i++) set_bit(magellan_buttons[i], input_dev->keybit); diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 2adf73f63c9..7b4865fdee5 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c @@ -758,7 +758,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) input_dev->open = sw_open; input_dev->close = sw_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (j = 0; (bits = sw_bit[sw->type][j]); j++) { code = sw_abs[sw->type][j]; diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c index abb7c4cf54a..d4087fd4965 100644 --- a/drivers/input/joystick/spaceball.c +++ b/drivers/input/joystick/spaceball.c @@ -228,18 +228,23 @@ static int spaceball_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); switch (id) { case SPACEBALL_4000FLX: case SPACEBALL_4000FLX_L: - input_dev->keybit[LONG(BTN_0)] |= BIT(BTN_9); - input_dev->keybit[LONG(BTN_A)] |= BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C) | BIT(BTN_MODE); + input_dev->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_9); + input_dev->keybit[BIT_WORD(BTN_A)] |= BIT_MASK(BTN_A) | + BIT_MASK(BTN_B) | BIT_MASK(BTN_C) | + BIT_MASK(BTN_MODE); default: - input_dev->keybit[LONG(BTN_0)] |= BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) - | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7) | BIT(BTN_8); + input_dev->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_2) | + BIT_MASK(BTN_3) | BIT_MASK(BTN_4) | + BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | + BIT_MASK(BTN_7) | BIT_MASK(BTN_8); case SPACEBALL_3003C: - input_dev->keybit[LONG(BTN_0)] |= BIT(BTN_1) | BIT(BTN_8); + input_dev->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_1) | + BIT_MASK(BTN_8); } for (i = 0; i < 3; i++) { diff --git a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c index c4937f1e837..f7ce4004f4b 100644 --- a/drivers/input/joystick/spaceorb.c +++ b/drivers/input/joystick/spaceorb.c @@ -185,7 +185,7 @@ static int spaceorb_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = 0; i < 6; i++) set_bit(spaceorb_buttons[i], input_dev->keybit); diff --git a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c index 8581ee991d4..baa10b2f7ba 100644 --- a/drivers/input/joystick/stinger.c +++ b/drivers/input/joystick/stinger.c @@ -156,10 +156,11 @@ static int stinger_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_A)] = BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C) | BIT(BTN_X) | - BIT(BTN_Y) | BIT(BTN_Z) | BIT(BTN_TL) | BIT(BTN_TR) | - BIT(BTN_START) | BIT(BTN_SELECT); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_A)] = BIT_MASK(BTN_A) | BIT_MASK(BTN_B) | + BIT_MASK(BTN_C) | BIT_MASK(BTN_X) | BIT_MASK(BTN_Y) | + BIT_MASK(BTN_Z) | BIT_MASK(BTN_TL) | BIT_MASK(BTN_TR) | + BIT_MASK(BTN_START) | BIT_MASK(BTN_SELECT); input_set_abs_params(input_dev, ABS_X, -64, 64, 0, 4); input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 4); diff --git a/drivers/input/joystick/tmdc.c b/drivers/input/joystick/tmdc.c index 3b36ee04f72..0feeb8acb53 100644 --- a/drivers/input/joystick/tmdc.c +++ b/drivers/input/joystick/tmdc.c @@ -333,7 +333,7 @@ static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data) input_dev->open = tmdc_open; input_dev->close = tmdc_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); for (i = 0; i < port->absc && i < TMDC_ABS; i++) if (port->abs[i] >= 0) diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index 8381c6f1437..bbebd4e2ad7 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c @@ -229,7 +229,7 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs) input_dev->open = tgfx_open; input_dev->close = tgfx_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); input_set_abs_params(input_dev, ABS_X, -1, 1, 0, 0); input_set_abs_params(input_dev, ABS_Y, -1, 1, 0, 0); diff --git a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c index c91504ec38e..1085c841fec 100644 --- a/drivers/input/joystick/twidjoy.c +++ b/drivers/input/joystick/twidjoy.c @@ -207,7 +207,7 @@ static int twidjoy_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); input_set_abs_params(input_dev, ABS_X, -50, 50, 4, 4); input_set_abs_params(input_dev, ABS_Y, -50, 50, 4, 4); diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c index 4e85f72eefd..e928b6e3724 100644 --- a/drivers/input/joystick/warrior.c +++ b/drivers/input/joystick/warrior.c @@ -162,9 +162,11 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TRIGGER)] = BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP) | BIT(BTN_TOP2); - input_dev->relbit[0] = BIT(REL_DIAL); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL) | + BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TRIGGER)] = BIT_MASK(BTN_TRIGGER) | + BIT_MASK(BTN_THUMB) | BIT_MASK(BTN_TOP) | BIT_MASK(BTN_TOP2); + input_dev->relbit[0] = BIT_MASK(REL_DIAL); input_set_abs_params(input_dev, ABS_X, -64, 64, 0, 8); input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 8); input_set_abs_params(input_dev, ABS_THROTTLE, -112, 112, 0, 0); diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 623629a69b0..6dd375825a1 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -658,7 +658,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id input_dev->open = xpad_open; input_dev->close = xpad_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); /* set up buttons */ for (i = 0; xpad_btn[i] >= 0; i++) diff --git a/drivers/input/keyboard/aaed2000_kbd.c b/drivers/input/keyboard/aaed2000_kbd.c index 63d6ead6b87..72abc196ce6 100644 --- a/drivers/input/keyboard/aaed2000_kbd.c +++ b/drivers/input/keyboard/aaed2000_kbd.c @@ -125,7 +125,7 @@ static int __devinit aaedkbd_probe(struct platform_device *pdev) input_dev->id.version = 0x0100; input_dev->dev.parent = &pdev->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); input_dev->keycode = aaedkbd->keycode; input_dev->keycodesize = sizeof(unsigned char); input_dev->keycodemax = ARRAY_SIZE(aaedkbd_keycode); diff --git a/drivers/input/keyboard/amikbd.c b/drivers/input/keyboard/amikbd.c index c67e84ec2d6..81bf7562aca 100644 --- a/drivers/input/keyboard/amikbd.c +++ b/drivers/input/keyboard/amikbd.c @@ -209,7 +209,7 @@ static int __init amikbd_init(void) amikbd_dev->id.product = 0x0001; amikbd_dev->id.version = 0x0100; - amikbd_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + amikbd_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); for (i = 0; i < 0x78; i++) set_bit(i, amikbd_dev->keybit); diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c index a1800151b6c..4e92100c56a 100644 --- a/drivers/input/keyboard/atakbd.c +++ b/drivers/input/keyboard/atakbd.c @@ -237,7 +237,7 @@ static int __init atakbd_init(void) atakbd_dev->id.product = 0x0001; atakbd_dev->id.version = 0x0100; - atakbd_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + atakbd_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); atakbd_dev->keycode = atakbd_keycode; atakbd_dev->keycodesize = sizeof(unsigned char); atakbd_dev->keycodemax = ARRAY_SIZE(atakbd_keycode); diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 41fc3d03b6e..b39c5b31e62 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -900,27 +900,32 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd) input_set_drvdata(input_dev, atkbd); - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_MSC); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | + BIT_MASK(EV_MSC); if (atkbd->write) { - input_dev->evbit[0] |= BIT(EV_LED); - input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); + input_dev->evbit[0] |= BIT_MASK(EV_LED); + input_dev->ledbit[0] = BIT_MASK(LED_NUML) | + BIT_MASK(LED_CAPSL) | BIT_MASK(LED_SCROLLL); } if (atkbd->extra) - input_dev->ledbit[0] |= BIT(LED_COMPOSE) | BIT(LED_SUSPEND) | - BIT(LED_SLEEP) | BIT(LED_MUTE) | BIT(LED_MISC); + input_dev->ledbit[0] |= BIT_MASK(LED_COMPOSE) | + BIT_MASK(LED_SUSPEND) | BIT_MASK(LED_SLEEP) | + BIT_MASK(LED_MUTE) | BIT_MASK(LED_MISC); if (!atkbd->softrepeat) { input_dev->rep[REP_DELAY] = 250; input_dev->rep[REP_PERIOD] = 33; } - input_dev->mscbit[0] = atkbd->softraw ? BIT(MSC_SCAN) : BIT(MSC_RAW) | BIT(MSC_SCAN); + input_dev->mscbit[0] = atkbd->softraw ? BIT_MASK(MSC_SCAN) : + BIT_MASK(MSC_RAW) | BIT_MASK(MSC_SCAN); if (atkbd->scroll) { - input_dev->evbit[0] |= BIT(EV_REL); - input_dev->relbit[0] = BIT(REL_WHEEL) | BIT(REL_HWHEEL); + input_dev->evbit[0] |= BIT_MASK(EV_REL); + input_dev->relbit[0] = BIT_MASK(REL_WHEEL) | + BIT_MASK(REL_HWHEEL); set_bit(BTN_MIDDLE, input_dev->keybit); } diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index 6578bfff644..790fed368aa 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c @@ -325,7 +325,8 @@ static int __init corgikbd_probe(struct platform_device *pdev) input_dev->id.version = 0x0100; input_dev->dev.parent = &pdev->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | + BIT_MASK(EV_PWR) | BIT_MASK(EV_SW); input_dev->keycode = corgikbd->keycode; input_dev->keycodesize = sizeof(unsigned char); input_dev->keycodemax = ARRAY_SIZE(corgikbd_keycode); diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index e2a3293bc67..3eddf52a0bb 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -62,7 +62,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) platform_set_drvdata(pdev, input); - input->evbit[0] = BIT(EV_KEY); + input->evbit[0] = BIT_MASK(EV_KEY); input->name = pdev->name; input->phys = "gpio-keys/input0"; diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index cdd254f2e6c..adbf29f0169 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c @@ -323,8 +323,9 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv) goto bail2; } - kbd->dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); - kbd->dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); + kbd->dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); + kbd->dev->ledbit[0] = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) | + BIT_MASK(LED_SCROLLL); kbd->dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE; kbd->dev->keycodesize = sizeof(hil_kbd_set1[0]); kbd->dev->keycode = hil_kbd_set1; diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index 499b6974457..50d80ecf0b8 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c @@ -266,8 +266,9 @@ hil_keyb_init(void) if (hphilkeyb_keycode[i] != KEY_RESERVED) set_bit(hphilkeyb_keycode[i], hil_dev.dev->keybit); - hil_dev.dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); - hil_dev.dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL); + hil_dev.dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); + hil_dev.dev->ledbit[0] = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) | + BIT_MASK(LED_SCROLLL); hil_dev.dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE; hil_dev.dev->keycodesize= sizeof(hphilkeyb_keycode[0]); hil_dev.dev->keycode = hphilkeyb_keycode; diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index 7a41b271f22..5a0ca18d675 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -233,7 +233,7 @@ static int locomokbd_probe(struct locomo_dev *dev) input_dev->id.version = 0x0100; input_dev->dev.parent = &dev->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); input_dev->keycode = locomokbd->keycode; input_dev->keycodesize = sizeof(unsigned char); input_dev->keycodemax = ARRAY_SIZE(locomokbd_keycode); diff --git a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c index b97a41e3ee5..48d1cab0aa1 100644 --- a/drivers/input/keyboard/newtonkbd.c +++ b/drivers/input/keyboard/newtonkbd.c @@ -106,7 +106,7 @@ static int nkbd_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); input_dev->keycode = nkbd->keycode; input_dev->keycodesize = sizeof(unsigned char); input_dev->keycodemax = ARRAY_SIZE(nkbd_keycode); diff --git a/drivers/input/keyboard/pxa27x_keyboard.c b/drivers/input/keyboard/pxa27x_keyboard.c index b7061aa3881..bdd64ee4c5c 100644 --- a/drivers/input/keyboard/pxa27x_keyboard.c +++ b/drivers/input/keyboard/pxa27x_keyboard.c @@ -183,8 +183,9 @@ static int __devinit pxakbd_probe(struct platform_device *pdev) input_dev->close = pxakbd_close; input_dev->dev.parent = &pdev->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_REL); - input_dev->relbit[LONG(REL_WHEEL)] = BIT(REL_WHEEL); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | + BIT_MASK(EV_REL); + input_dev->relbit[BIT_WORD(REL_WHEEL)] = BIT_MASK(REL_WHEEL); for (row = 0; row < pdata->nr_rows; row++) { for (col = 0; col < pdata->nr_cols; col++) { int code = pdata->keycodes[row][col]; diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index 41b80385476..410d78a774d 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c @@ -381,7 +381,8 @@ static int __init spitzkbd_probe(struct platform_device *dev) input_dev->id.product = 0x0001; input_dev->id.version = 0x0100; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | + BIT_MASK(EV_PWR) | BIT_MASK(EV_SW); input_dev->keycode = spitzkbd->keycode; input_dev->keycodesize = sizeof(unsigned char); input_dev->keycodemax = ARRAY_SIZE(spitzkbd_keycode); diff --git a/drivers/input/keyboard/stowaway.c b/drivers/input/keyboard/stowaway.c index b44b0684d54..7437219370b 100644 --- a/drivers/input/keyboard/stowaway.c +++ b/drivers/input/keyboard/stowaway.c @@ -110,7 +110,7 @@ static int skbd_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); input_dev->keycode = skbd->keycode; input_dev->keycodesize = sizeof(unsigned char); input_dev->keycodemax = ARRAY_SIZE(skbd_keycode); diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c index 1d4e39624cf..be0f5d19d02 100644 --- a/drivers/input/keyboard/sunkbd.c +++ b/drivers/input/keyboard/sunkbd.c @@ -277,9 +277,11 @@ static int sunkbd_connect(struct serio *serio, struct serio_driver *drv) input_dev->event = sunkbd_event; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP); - input_dev->ledbit[0] = BIT(LED_CAPSL) | BIT(LED_COMPOSE) | BIT(LED_SCROLLL) | BIT(LED_NUML); - input_dev->sndbit[0] = BIT(SND_CLICK) | BIT(SND_BELL); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) | + BIT_MASK(EV_SND) | BIT_MASK(EV_REP); + input_dev->ledbit[0] = BIT_MASK(LED_CAPSL) | BIT_MASK(LED_COMPOSE) | + BIT_MASK(LED_SCROLLL) | BIT_MASK(LED_NUML); + input_dev->sndbit[0] = BIT_MASK(SND_CLICK) | BIT_MASK(SND_BELL); input_dev->keycode = sunkbd->keycode; input_dev->keycodesize = sizeof(unsigned char); diff --git a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c index f3a56eb58ed..152a2c07050 100644 --- a/drivers/input/keyboard/xtkbd.c +++ b/drivers/input/keyboard/xtkbd.c @@ -110,7 +110,7 @@ static int xtkbd_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); input_dev->keycode = xtkbd->keycode; input_dev->keycodesize = sizeof(unsigned char); input_dev->keycodemax = ARRAY_SIZE(xtkbd_keycode); diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c index 471aab20644..3a7937481ad 100644 --- a/drivers/input/misc/ati_remote.c +++ b/drivers/input/misc/ati_remote.c @@ -662,10 +662,10 @@ static void ati_remote_input_init(struct ati_remote *ati_remote) struct input_dev *idev = ati_remote->idev; int i; - idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - idev->keybit[LONG(BTN_MOUSE)] = ( BIT(BTN_LEFT) | BIT(BTN_RIGHT) | - BIT(BTN_SIDE) | BIT(BTN_EXTRA) ); - idev->relbit[0] = BIT(REL_X) | BIT(REL_Y); + idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + idev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); + idev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) if (ati_remote_tbl[i].type == EV_KEY) set_bit(ati_remote_tbl[i].code, idev->keybit); diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index 1031543e5c3..f2709b82485 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c @@ -346,9 +346,10 @@ static int ati_remote2_input_init(struct ati_remote2 *ar2) ar2->idev = idev; input_set_drvdata(idev, ar2); - idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_REL); - idev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT); - idev->relbit[0] = BIT(REL_X) | BIT(REL_Y); + idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | BIT_MASK(EV_REL); + idev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT); + idev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); for (i = 0; ati_remote2_key_table[i].key_code != KEY_RESERVED; i++) set_bit(ati_remote2_key_table[i].key_code, idev->keybit); diff --git a/drivers/input/misc/atlas_btns.c b/drivers/input/misc/atlas_btns.c index e43e92fd9e2..4e3ad657ed8 100644 --- a/drivers/input/misc/atlas_btns.c +++ b/drivers/input/misc/atlas_btns.c @@ -81,7 +81,7 @@ static int atlas_acpi_button_add(struct acpi_device *device) input_dev->name = "Atlas ACPI button driver"; input_dev->phys = "ASIM0000/atlas/input0"; input_dev->id.bustype = BUS_HOST; - input_dev->evbit[LONG(EV_KEY)] = BIT(EV_KEY); + input_dev->evbit[BIT_WORD(EV_KEY)] = BIT_MASK(EV_KEY); set_bit(KEY_F1, input_dev->keybit); set_bit(KEY_F2, input_dev->keybit); diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c index 064b0793601..1aef97ed5e8 100644 --- a/drivers/input/misc/cobalt_btns.c +++ b/drivers/input/misc/cobalt_btns.c @@ -104,7 +104,7 @@ static int __devinit cobalt_buttons_probe(struct platform_device *pdev) input->id.bustype = BUS_HOST; input->cdev.dev = &pdev->dev; - input->evbit[0] = BIT(EV_KEY); + input->evbit[0] = BIT_MASK(EV_KEY); for (i = 0; i < ARRAY_SIZE(buttons_map); i++) { set_bit(buttons_map[i].keycode, input->keybit); buttons_map[i].count = 0; diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c index e759944041a..d2ade7443b7 100644 --- a/drivers/input/misc/ixp4xx-beeper.c +++ b/drivers/input/misc/ixp4xx-beeper.c @@ -109,8 +109,8 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev) input_dev->id.version = 0x0100; input_dev->dev.parent = &dev->dev; - input_dev->evbit[0] = BIT(EV_SND); - input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); + input_dev->evbit[0] = BIT_MASK(EV_SND); + input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); input_dev->event = ixp4xx_spkr_event; err = request_irq(IRQ_IXP4XX_TIMER2, &ixp4xx_spkr_interrupt, diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index 1bffc9fa98c..fd74347047d 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c @@ -497,7 +497,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic usb_to_input_id(udev, &input_dev->id); input_dev->dev.parent = &interface->dev; - input_dev->evbit[0] = BIT(EV_KEY); /* We will only report KEY events. */ + input_dev->evbit[0] = BIT_MASK(EV_KEY); /* We will only report KEY events. */ for (i = 0; i < ARRAY_SIZE(keyspan_key_table); i++) if (keyspan_key_table[i] != KEY_RESERVED) set_bit(keyspan_key_table[i], input_dev->keybit); diff --git a/drivers/input/misc/m68kspkr.c b/drivers/input/misc/m68kspkr.c index e9f26e766b4..0c64d9bb718 100644 --- a/drivers/input/misc/m68kspkr.c +++ b/drivers/input/misc/m68kspkr.c @@ -65,8 +65,8 @@ static int __devinit m68kspkr_probe(struct platform_device *dev) input_dev->id.version = 0x0100; input_dev->dev.parent = &dev->dev; - input_dev->evbit[0] = BIT(EV_SND); - input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); + input_dev->evbit[0] = BIT_MASK(EV_SND); + input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); input_dev->event = m68kspkr_event; err = input_register_device(input_dev); diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c index c19f77fbaf2..4941a9e61e9 100644 --- a/drivers/input/misc/pcspkr.c +++ b/drivers/input/misc/pcspkr.c @@ -86,8 +86,8 @@ static int __devinit pcspkr_probe(struct platform_device *dev) pcspkr_dev->id.version = 0x0100; pcspkr_dev->dev.parent = &dev->dev; - pcspkr_dev->evbit[0] = BIT(EV_SND); - pcspkr_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); + pcspkr_dev->evbit[0] = BIT_MASK(EV_SND); + pcspkr_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); pcspkr_dev->event = pcspkr_event; err = input_register_device(pcspkr_dev); diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index 448a470d28f..7a7b8c7b963 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c @@ -363,10 +363,11 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i input_dev->event = powermate_input_event; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_MSC); - input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0); - input_dev->relbit[LONG(REL_DIAL)] = BIT(REL_DIAL); - input_dev->mscbit[LONG(MSC_PULSELED)] = BIT(MSC_PULSELED); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL) | + BIT_MASK(EV_MSC); + input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); + input_dev->relbit[BIT_WORD(REL_DIAL)] = BIT_MASK(REL_DIAL); + input_dev->mscbit[BIT_WORD(MSC_PULSELED)] = BIT_MASK(MSC_PULSELED); /* get a handle to the interrupt data pipe */ pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress); diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c index e36ec1d92be..a3637d87088 100644 --- a/drivers/input/misc/sparcspkr.c +++ b/drivers/input/misc/sparcspkr.c @@ -115,8 +115,8 @@ static int __devinit sparcspkr_probe(struct device *dev) input_dev->id.version = 0x0100; input_dev->dev.parent = dev; - input_dev->evbit[0] = BIT(EV_SND); - input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); + input_dev->evbit[0] = BIT_MASK(EV_SND); + input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); input_dev->event = state->event; diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index ab15880fd56..46279ef2b64 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c @@ -945,7 +945,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) /* input_dev->event = input_ev; TODO */ /* register available key events */ - input_dev->evbit[0] = BIT(EV_KEY); + input_dev->evbit[0] = BIT_MASK(EV_KEY); for (i = 0; i < 256; i++) { int k = map_p1k_to_key(i); if (k >= 0) { diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 64d70a9b714..2b5ed119c9a 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -455,24 +455,25 @@ int alps_init(struct psmouse *psmouse) if (alps_hw_init(psmouse, &version)) goto init_fail; - dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY); - dev1->keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH); - dev1->keybit[LONG(BTN_TOOL_FINGER)] |= BIT(BTN_TOOL_FINGER); - dev1->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); + dev1->evbit[BIT_WORD(EV_KEY)] |= BIT_MASK(EV_KEY); + dev1->keybit[BIT_WORD(BTN_TOUCH)] |= BIT_MASK(BTN_TOUCH); + dev1->keybit[BIT_WORD(BTN_TOOL_FINGER)] |= BIT_MASK(BTN_TOOL_FINGER); + dev1->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); - dev1->evbit[LONG(EV_ABS)] |= BIT(EV_ABS); + dev1->evbit[BIT_WORD(EV_ABS)] |= BIT_MASK(EV_ABS); input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0); input_set_abs_params(dev1, ABS_Y, 0, 767, 0, 0); input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0); if (priv->i->flags & ALPS_WHEEL) { - dev1->evbit[LONG(EV_REL)] |= BIT(EV_REL); - dev1->relbit[LONG(REL_WHEEL)] |= BIT(REL_WHEEL); + dev1->evbit[BIT_WORD(EV_REL)] |= BIT_MASK(EV_REL); + dev1->relbit[BIT_WORD(REL_WHEEL)] |= BIT_MASK(REL_WHEEL); } if (priv->i->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) { - dev1->keybit[LONG(BTN_FORWARD)] |= BIT(BTN_FORWARD); - dev1->keybit[LONG(BTN_BACK)] |= BIT(BTN_BACK); + dev1->keybit[BIT_WORD(BTN_FORWARD)] |= BIT_MASK(BTN_FORWARD); + dev1->keybit[BIT_WORD(BTN_BACK)] |= BIT_MASK(BTN_BACK); } snprintf(priv->phys, sizeof(priv->phys), "%s/input1", psmouse->ps2dev.serio->phys); @@ -483,9 +484,10 @@ int alps_init(struct psmouse *psmouse) dev2->id.product = PSMOUSE_ALPS; dev2->id.version = 0x0000; - dev2->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - dev2->relbit[LONG(REL_X)] |= BIT(REL_X) | BIT(REL_Y); - dev2->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); + dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + dev2->relbit[BIT_WORD(REL_X)] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y); + dev2->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); if (input_register_device(priv->dev2)) goto init_fail; diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c index 239a0e16d91..a185ac78a42 100644 --- a/drivers/input/mouse/amimouse.c +++ b/drivers/input/mouse/amimouse.c @@ -111,9 +111,10 @@ static int __init amimouse_init(void) amimouse_dev->id.product = 0x0002; amimouse_dev->id.version = 0x0100; - amimouse_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - amimouse_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); - amimouse_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); + amimouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + amimouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); + amimouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); amimouse_dev->open = amimouse_open; amimouse_dev->close = amimouse_close; diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c index c8c7244b48a..98a3561d4b0 100644 --- a/drivers/input/mouse/atarimouse.c +++ b/drivers/input/mouse/atarimouse.c @@ -137,9 +137,10 @@ static int __init atamouse_init(void) atamouse_dev->id.product = 0x0002; atamouse_dev->id.version = 0x0100; - atamouse_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - atamouse_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); - atamouse_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); + atamouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + atamouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); + atamouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); atamouse_dev->open = atamouse_open; atamouse_dev->close = atamouse_close; diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c index 449bf4dcbbc..27f88fbb713 100644 --- a/drivers/input/mouse/hil_ptr.c +++ b/drivers/input/mouse/hil_ptr.c @@ -298,12 +298,12 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) idd = ptr->idd + 1; txt = "unknown"; if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) { - ptr->dev->evbit[0] = BIT(EV_REL); + ptr->dev->evbit[0] = BIT_MASK(EV_REL); txt = "relative"; } if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_ABS) { - ptr->dev->evbit[0] = BIT(EV_ABS); + ptr->dev->evbit[0] = BIT_MASK(EV_ABS); txt = "absolute"; } if (!ptr->dev->evbit[0]) @@ -311,7 +311,7 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver) ptr->nbtn = HIL_IDD_NUM_BUTTONS(idd); if (ptr->nbtn) - ptr->dev->evbit[0] |= BIT(EV_KEY); + ptr->dev->evbit[0] |= BIT_MASK(EV_KEY); naxsets = HIL_IDD_NUM_AXSETS(*idd); ptr->naxes = HIL_IDD_NUM_AXES_PER_SET(*idd); diff --git a/drivers/input/mouse/inport.c b/drivers/input/mouse/inport.c index 79b624fe899..655a3921743 100644 --- a/drivers/input/mouse/inport.c +++ b/drivers/input/mouse/inport.c @@ -163,9 +163,10 @@ static int __init inport_init(void) inport_dev->id.product = 0x0001; inport_dev->id.version = 0x0100; - inport_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - inport_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); - inport_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); + inport_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + inport_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); + inport_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); inport_dev->open = inport_open; inport_dev->close = inport_close; diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index d7de4c53b3d..9ec57d80186 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c @@ -270,9 +270,10 @@ static int lifebook_create_relative_device(struct psmouse *psmouse) dev2->id.version = 0x0000; dev2->dev.parent = &psmouse->ps2dev.serio->dev; - dev2->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - dev2->relbit[LONG(REL_X)] = BIT(REL_X) | BIT(REL_Y); - dev2->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT); + dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + dev2->relbit[BIT_WORD(REL_X)] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); + dev2->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT); error = input_register_device(priv->dev2); if (error) @@ -295,9 +296,9 @@ int lifebook_init(struct psmouse *psmouse) if (lifebook_absolute_mode(psmouse)) return -1; - dev1->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY); + dev1->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); dev1->relbit[0] = 0; - dev1->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + dev1->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(dev1, ABS_X, 0, max_coord, 0, 0); input_set_abs_params(dev1, ABS_Y, 0, max_coord, 0, 0); diff --git a/drivers/input/mouse/logibm.c b/drivers/input/mouse/logibm.c index 26c3b2e2ca9..b23a4f3ea5c 100644 --- a/drivers/input/mouse/logibm.c +++ b/drivers/input/mouse/logibm.c @@ -156,9 +156,10 @@ static int __init logibm_init(void) logibm_dev->id.product = 0x0001; logibm_dev->id.version = 0x0100; - logibm_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - logibm_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); - logibm_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); + logibm_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + logibm_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); + logibm_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); logibm_dev->open = logibm_open; logibm_dev->close = logibm_close; diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c index 05d992e514f..8991ab0b4fe 100644 --- a/drivers/input/mouse/pc110pad.c +++ b/drivers/input/mouse/pc110pad.c @@ -144,9 +144,9 @@ static int __init pc110pad_init(void) pc110pad_dev->id.product = 0x0001; pc110pad_dev->id.version = 0x0100; - pc110pad_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - pc110pad_dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y); - pc110pad_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + pc110pad_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + pc110pad_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y); + pc110pad_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); pc110pad_dev->absmax[ABS_X] = 0x1ff; pc110pad_dev->absmax[ABS_Y] = 0x0ff; diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 07352575653..da316d13d7f 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -1115,9 +1115,10 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, const struct psmouse input_dev->dev.parent = &psmouse->ps2dev.serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); - input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); + input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); psmouse->set_rate = psmouse_set_rate; psmouse->set_resolution = psmouse_set_resolution; diff --git a/drivers/input/mouse/rpcmouse.c b/drivers/input/mouse/rpcmouse.c index 355efd0423e..18a48636ba4 100644 --- a/drivers/input/mouse/rpcmouse.c +++ b/drivers/input/mouse/rpcmouse.c @@ -78,9 +78,10 @@ static int __init rpcmouse_init(void) rpcmouse_dev->id.product = 0x0001; rpcmouse_dev->id.version = 0x0100; - rpcmouse_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - rpcmouse_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); - rpcmouse_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); + rpcmouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + rpcmouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); + rpcmouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); rpcmouse_lastx = (short) iomd_readl(IOMD_MOUSEX); rpcmouse_lasty = (short) iomd_readl(IOMD_MOUSEY); diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c index 77b8ee2b965..ed917bfd086 100644 --- a/drivers/input/mouse/sermouse.c +++ b/drivers/input/mouse/sermouse.c @@ -268,9 +268,10 @@ static int sermouse_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT); - input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT); + input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); if (c & 0x01) set_bit(BTN_MIDDLE, input_dev->keybit); if (c & 0x02) set_bit(BTN_SIDE, input_dev->keybit); diff --git a/drivers/input/mouse/touchkit_ps2.c b/drivers/input/mouse/touchkit_ps2.c index 7b977fd2357..3fadb2accac 100644 --- a/drivers/input/mouse/touchkit_ps2.c +++ b/drivers/input/mouse/touchkit_ps2.c @@ -85,7 +85,7 @@ int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties) return -ENODEV; if (set_properties) { - dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); + dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); set_bit(BTN_TOUCH, dev->keybit); input_set_abs_params(dev, ABS_X, 0, TOUCHKIT_MAX_XC, 0, 0); input_set_abs_params(dev, ABS_Y, 0, TOUCHKIT_MAX_YC, 0, 0); diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 79146d6ed2a..78c3ea75da2 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c @@ -998,34 +998,36 @@ static const struct input_device_id mousedev_ids[] = { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_RELBIT, - .evbit = { BIT(EV_KEY) | BIT(EV_REL) }, - .keybit = { [LONG(BTN_LEFT)] = BIT(BTN_LEFT) }, - .relbit = { BIT(REL_X) | BIT(REL_Y) }, + .evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_REL) }, + .keybit = { [BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) }, + .relbit = { BIT_MASK(REL_X) | BIT_MASK(REL_Y) }, }, /* A mouse like device, at least one button, two relative axes */ { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_RELBIT, - .evbit = { BIT(EV_KEY) | BIT(EV_REL) }, - .relbit = { BIT(REL_WHEEL) }, + .evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_REL) }, + .relbit = { BIT_MASK(REL_WHEEL) }, }, /* A separate scrollwheel */ { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, - .evbit = { BIT(EV_KEY) | BIT(EV_ABS) }, - .keybit = { [LONG(BTN_TOUCH)] = BIT(BTN_TOUCH) }, - .absbit = { BIT(ABS_X) | BIT(ABS_Y) }, + .evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) }, + .keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) }, + .absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) }, }, /* A tablet like device, at least touch detection, two absolute axes */ { .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT | INPUT_DEVICE_ID_MATCH_ABSBIT, - .evbit = { BIT(EV_KEY) | BIT(EV_ABS) }, - .keybit = { [LONG(BTN_TOOL_FINGER)] = BIT(BTN_TOOL_FINGER) }, - .absbit = { BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE) | - BIT(ABS_TOOL_WIDTH) }, + .evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) }, + .keybit = { [BIT_WORD(BTN_TOOL_FINGER)] = + BIT_MASK(BTN_TOOL_FINGER) }, + .absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) | + BIT_MASK(ABS_PRESSURE) | + BIT_MASK(ABS_TOOL_WIDTH) }, }, /* A touchpad */ { }, /* Terminating entry */ diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c index dd2310458c4..b973d0ef6d1 100644 --- a/drivers/input/tablet/acecad.c +++ b/drivers/input/tablet/acecad.c @@ -192,10 +192,14 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ input_dev->open = usb_acecad_open; input_dev->close = usb_acecad_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE); - input_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - input_dev->keybit[LONG(BTN_DIGI)] = BIT(BTN_TOOL_PEN) |BIT(BTN_TOUCH) | BIT(BTN_STYLUS) | BIT(BTN_STYLUS2); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) | + BIT_MASK(ABS_PRESSURE); + input_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); + input_dev->keybit[BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_TOOL_PEN) | + BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS) | + BIT_MASK(BTN_STYLUS2); switch (id->driver_info) { case 0: diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c index b2ca10f2fe0..d2c6da26472 100644 --- a/drivers/input/tablet/gtco.c +++ b/drivers/input/tablet/gtco.c @@ -573,10 +573,12 @@ static void gtco_setup_caps(struct input_dev *inputdev) struct gtco *device = input_get_drvdata(inputdev); /* Which events */ - inputdev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC); + inputdev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | + BIT_MASK(EV_MSC); /* Misc event menu block */ - inputdev->mscbit[0] = BIT(MSC_SCAN)|BIT(MSC_SERIAL)|BIT(MSC_RAW) ; + inputdev->mscbit[0] = BIT_MASK(MSC_SCAN) | BIT_MASK(MSC_SERIAL) | + BIT_MASK(MSC_RAW); /* Absolute values based on HID report info */ input_set_abs_params(inputdev, ABS_X, device->min_X, device->max_X, diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index 91e6d00d4a4..1182fc13316 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c @@ -153,10 +153,13 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i input_dev->open = kbtab_open; input_dev->close = kbtab_close; - input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC); - input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH); - input_dev->mscbit[0] |= BIT(MSC_SERIAL); + input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | + BIT_MASK(EV_MSC); + input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | + BIT_MASK(BTN_TOUCH); + input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); input_set_abs_params(input_dev, ABS_X, 0, 0x2000, 4, 0); input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0); input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0); diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 064e123c9b7..d64b1ea136b 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -140,48 +140,58 @@ static void wacom_close(struct input_dev *dev) void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { - input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_1) | BIT(BTN_5); + input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_1) | + BIT_MASK(BTN_5); input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); } void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { - input_dev->evbit[0] |= BIT(EV_MSC); - input_dev->mscbit[0] |= BIT(MSC_SERIAL); - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); - input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_4); + input_dev->evbit[0] |= BIT_MASK(EV_MSC); + input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); + input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | + BIT_MASK(BTN_4); } void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { - input_dev->evbit[0] |= BIT(EV_REL); - input_dev->relbit[0] |= BIT(REL_WHEEL); - input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_STYLUS2); + input_dev->evbit[0] |= BIT_MASK(EV_REL); + input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); + input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | + BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2); input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0); } void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); - input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER); + input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | + BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3); input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); } void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { - input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); + input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_4) | + BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7); input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); } void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { - input_dev->evbit[0] |= BIT(EV_MSC) | BIT(EV_REL); - input_dev->mscbit[0] |= BIT(MSC_SERIAL); - input_dev->relbit[0] |= BIT(REL_WHEEL); - input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA); - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH) - | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2); + input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL); + input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL); + input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); + input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) | + BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) | + BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_TOOL_BRUSH) | + BIT_MASK(BTN_TOOL_PENCIL) | BIT_MASK(BTN_TOOL_AIRBRUSH) | + BIT_MASK(BTN_TOOL_LENS) | BIT_MASK(BTN_STYLUS2); input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0); input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0); @@ -192,12 +202,13 @@ void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2) | BIT(BTN_TOOL_RUBBER); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2) | + BIT_MASK(BTN_TOOL_RUBBER); } void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER); } static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) @@ -243,12 +254,13 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i input_dev->open = wacom_open; input_dev->close = wacom_close; - input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); + input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) | + BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS); input_set_abs_params(input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0); input_set_abs_params(input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0); input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0); - input_dev->absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC); + input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC); wacom_init_input_dev(input_dev, wacom_wac); diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 51ae4fb7d12..f59aecf5ec1 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -917,8 +917,8 @@ static int __devinit ads7846_probe(struct spi_device *spi) input_dev->phys = ts->phys; input_dev->dev.parent = &spi->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(input_dev, ABS_X, pdata->x_min ? : 0, pdata->x_max ? : MAX_12BIT, diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c index e6a31d11878..b1b2e07bf08 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c @@ -302,8 +302,8 @@ static int __init corgits_probe(struct platform_device *pdev) input_dev->id.version = 0x0100; input_dev->dev.parent = &pdev->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(input_dev, ABS_X, X_AXIS_MIN, X_AXIS_MAX, 0, 0); input_set_abs_params(input_dev, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, 0, 0); input_set_abs_params(input_dev, ABS_PRESSURE, PRESSURE_MIN, PRESSURE_MAX, 0, 0); diff --git a/drivers/input/touchscreen/elo.c b/drivers/input/touchscreen/elo.c index 557d781719f..d20689cdbd5 100644 --- a/drivers/input/touchscreen/elo.c +++ b/drivers/input/touchscreen/elo.c @@ -320,8 +320,8 @@ static int elo_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); serio_set_drvdata(serio, elo); err = serio_open(serio, drv); diff --git a/drivers/input/touchscreen/fujitsu_ts.c b/drivers/input/touchscreen/fujitsu_ts.c index daf7a4afc93..80b21800355 100644 --- a/drivers/input/touchscreen/fujitsu_ts.c +++ b/drivers/input/touchscreen/fujitsu_ts.c @@ -122,8 +122,8 @@ static int fujitsu_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.vendor = SERIO_FUJITSU; input_dev->id.product = 0; input_dev->id.version = 0x0100; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(input_dev, ABS_X, 0, 4096, 0, 0); input_set_abs_params(input_dev, ABS_Y, 0, 4096, 0, 0); diff --git a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c index 39d602600d7..a48a15868c4 100644 --- a/drivers/input/touchscreen/gunze.c +++ b/drivers/input/touchscreen/gunze.c @@ -137,8 +137,8 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.product = 0x0051; input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(input_dev, ABS_X, 24, 1000, 0, 0); input_set_abs_params(input_dev, ABS_Y, 24, 1000, 0, 0); diff --git a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c index 09ed7803cb8..2ae6c6016a8 100644 --- a/drivers/input/touchscreen/h3600_ts_input.c +++ b/drivers/input/touchscreen/h3600_ts_input.c @@ -373,8 +373,9 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv) input_dev->event = h3600ts_event; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_LED) | BIT(EV_PWR); - input_dev->ledbit[0] = BIT(LED_SLEEP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) | + BIT_MASK(EV_LED) | BIT_MASK(EV_PWR); + input_dev->ledbit[0] = BIT_MASK(LED_SLEEP); input_set_abs_params(input_dev, ABS_X, 60, 985, 0, 0); input_set_abs_params(input_dev, ABS_Y, 35, 1024, 0, 0); diff --git a/drivers/input/touchscreen/hp680_ts_input.c b/drivers/input/touchscreen/hp680_ts_input.c index 1a15475aedf..c38d4e0f95c 100644 --- a/drivers/input/touchscreen/hp680_ts_input.c +++ b/drivers/input/touchscreen/hp680_ts_input.c @@ -81,8 +81,8 @@ static int __init hp680_ts_init(void) if (!hp680_ts_dev) return -ENOMEM; - hp680_ts_dev->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY); - hp680_ts_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + hp680_ts_dev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); + hp680_ts_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(hp680_ts_dev, ABS_X, HP680_TS_ABS_X_MIN, HP680_TS_ABS_X_MAX, 0, 0); diff --git a/drivers/input/touchscreen/mk712.c b/drivers/input/touchscreen/mk712.c index 44140feeffc..80a65886870 100644 --- a/drivers/input/touchscreen/mk712.c +++ b/drivers/input/touchscreen/mk712.c @@ -186,8 +186,8 @@ static int __init mk712_init(void) mk712_dev->open = mk712_open; mk712_dev->close = mk712_close; - mk712_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - mk712_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + mk712_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + mk712_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(mk712_dev, ABS_X, 0, 0xfff, 88, 0); input_set_abs_params(mk712_dev, ABS_Y, 0, 0xfff, 88, 0); diff --git a/drivers/input/touchscreen/mtouch.c b/drivers/input/touchscreen/mtouch.c index 4ec3b1f940c..9077228418b 100644 --- a/drivers/input/touchscreen/mtouch.c +++ b/drivers/input/touchscreen/mtouch.c @@ -151,8 +151,8 @@ static int mtouch_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.product = 0; input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(mtouch->dev, ABS_X, MTOUCH_MIN_XC, MTOUCH_MAX_XC, 0, 0); input_set_abs_params(mtouch->dev, ABS_Y, MTOUCH_MIN_YC, MTOUCH_MAX_YC, 0, 0); diff --git a/drivers/input/touchscreen/penmount.c b/drivers/input/touchscreen/penmount.c index f2c0d3c7149..c7f9cebebbb 100644 --- a/drivers/input/touchscreen/penmount.c +++ b/drivers/input/touchscreen/penmount.c @@ -113,8 +113,8 @@ static int pm_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(pm->dev, ABS_X, 0, 0x3ff, 0, 0); input_set_abs_params(pm->dev, ABS_Y, 0, 0x3ff, 0, 0); diff --git a/drivers/input/touchscreen/touchright.c b/drivers/input/touchscreen/touchright.c index 3def7bb1df4..3a5c142c2a7 100644 --- a/drivers/input/touchscreen/touchright.c +++ b/drivers/input/touchscreen/touchright.c @@ -125,8 +125,8 @@ static int tr_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.product = 0; input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(tr->dev, ABS_X, TR_MIN_XC, TR_MAX_XC, 0, 0); input_set_abs_params(tr->dev, ABS_Y, TR_MIN_YC, TR_MAX_YC, 0, 0); diff --git a/drivers/input/touchscreen/touchwin.c b/drivers/input/touchscreen/touchwin.c index ac4bdcf1866..763a656a59f 100644 --- a/drivers/input/touchscreen/touchwin.c +++ b/drivers/input/touchscreen/touchwin.c @@ -132,8 +132,8 @@ static int tw_connect(struct serio *serio, struct serio_driver *drv) input_dev->id.product = 0; input_dev->id.version = 0x0100; input_dev->dev.parent = &serio->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(tw->dev, ABS_X, TW_MIN_XC, TW_MAX_XC, 0, 0); input_set_abs_params(tw->dev, ABS_Y, TW_MIN_YC, TW_MAX_YC, 0, 0); diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 89373b01d8f..7549939b953 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c @@ -517,7 +517,7 @@ static int ucb1400_ts_probe(struct device *dev) idev->id.product = id; idev->open = ucb1400_ts_open; idev->close = ucb1400_ts_close; - idev->evbit[0] = BIT(EV_ABS); + idev->evbit[0] = BIT_MASK(EV_ABS); ucb1400_adc_enable(ucb); x_res = ucb1400_ts_read_xres(ucb); diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 9fb3d5c3099..5f34b78d5dd 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -868,8 +868,8 @@ static int usbtouch_probe(struct usb_interface *intf, input_dev->open = usbtouch_open; input_dev->close = usbtouch_close; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); input_set_abs_params(input_dev, ABS_X, type->min_xc, type->max_xc, 0, 0); input_set_abs_params(input_dev, ABS_Y, type->min_yc, type->max_yc, 0, 0); if (type->max_press) diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c index 428872b653e..669f6f67449 100644 --- a/drivers/isdn/hardware/avm/b1dma.c +++ b/drivers/isdn/hardware/avm/b1dma.c @@ -486,11 +486,13 @@ static void b1dma_handle_rx(avmcard *card) card->name); } else { memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen); - if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF) + if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF) { + spin_lock(&card->lock); capilib_data_b3_conf(&cinfo->ncci_head, ApplId, - CAPIMSG_NCCI(skb->data), - CAPIMSG_MSGID(skb->data)); - + CAPIMSG_NCCI(skb->data), + CAPIMSG_MSGID(skb->data)); + spin_unlock(&card->lock); + } capi_ctr_handle_message(ctrl, ApplId, skb); } break; @@ -500,9 +502,9 @@ static void b1dma_handle_rx(avmcard *card) ApplId = _get_word(&p); NCCI = _get_word(&p); WindowSize = _get_word(&p); - + spin_lock(&card->lock); capilib_new_ncci(&cinfo->ncci_head, ApplId, NCCI, WindowSize); - + spin_unlock(&card->lock); break; case RECEIVE_FREE_NCCI: @@ -510,9 +512,11 @@ static void b1dma_handle_rx(avmcard *card) ApplId = _get_word(&p); NCCI = _get_word(&p); - if (NCCI != 0xffffffff) + if (NCCI != 0xffffffff) { + spin_lock(&card->lock); capilib_free_ncci(&cinfo->ncci_head, ApplId, NCCI); - + spin_unlock(&card->lock); + } break; case RECEIVE_START: @@ -751,10 +755,10 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl) spin_lock_irqsave(&card->lock, flags); b1dma_reset(card); - spin_unlock_irqrestore(&card->lock, flags); memset(cinfo->version, 0, sizeof(cinfo->version)); capilib_release(&cinfo->ncci_head); + spin_unlock_irqrestore(&card->lock, flags); capi_ctr_reseted(ctrl); } @@ -803,8 +807,11 @@ void b1dma_release_appl(struct capi_ctr *ctrl, u16 appl) avmcard *card = cinfo->card; struct sk_buff *skb; void *p; + unsigned long flags; + spin_lock_irqsave(&card->lock, flags); capilib_release_appl(&cinfo->ncci_head, appl); + spin_unlock_irqrestore(&card->lock, flags); skb = alloc_skb(7, GFP_ATOMIC); if (!skb) { @@ -832,10 +839,13 @@ u16 b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u16 retval = CAPI_NOERROR; if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) { + unsigned long flags; + spin_lock_irqsave(&card->lock, flags); retval = capilib_data_b3_req(&cinfo->ncci_head, CAPIMSG_APPID(skb->data), CAPIMSG_NCCI(skb->data), CAPIMSG_MSGID(skb->data)); + spin_unlock_irqrestore(&card->lock, flags); } if (retval == CAPI_NOERROR) b1dma_queue_tx(card, skb); diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index 8710cf6214d..4bbbbe68807 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -678,7 +678,9 @@ static irqreturn_t c4_handle_interrupt(avmcard *card) for (i=0; i < card->nr_controllers; i++) { avmctrl_info *cinfo = &card->ctrlinfo[i]; memset(cinfo->version, 0, sizeof(cinfo->version)); + spin_lock_irqsave(&card->lock, flags); capilib_release(&cinfo->ncci_head); + spin_unlock_irqrestore(&card->lock, flags); capi_ctr_reseted(&cinfo->capi_ctrl); } card->nlogcontr = 0; diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c index c925020fe9b..6130724e46e 100644 --- a/drivers/isdn/hardware/avm/t1isa.c +++ b/drivers/isdn/hardware/avm/t1isa.c @@ -180,8 +180,8 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) ApplId = (unsigned) b1_get_word(card->port); MsgLen = t1_get_slice(card->port, card->msgbuf); - spin_unlock_irqrestore(&card->lock, flags); if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) { + spin_unlock_irqrestore(&card->lock, flags); printk(KERN_ERR "%s: incoming packet dropped\n", card->name); } else { @@ -190,7 +190,7 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) capilib_data_b3_conf(&cinfo->ncci_head, ApplId, CAPIMSG_NCCI(skb->data), CAPIMSG_MSGID(skb->data)); - + spin_unlock_irqrestore(&card->lock, flags); capi_ctr_handle_message(ctrl, ApplId, skb); } break; @@ -200,21 +200,17 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) ApplId = b1_get_word(card->port); NCCI = b1_get_word(card->port); WindowSize = b1_get_word(card->port); - spin_unlock_irqrestore(&card->lock, flags); - capilib_new_ncci(&cinfo->ncci_head, ApplId, NCCI, WindowSize); - + spin_unlock_irqrestore(&card->lock, flags); break; case RECEIVE_FREE_NCCI: ApplId = b1_get_word(card->port); NCCI = b1_get_word(card->port); - spin_unlock_irqrestore(&card->lock, flags); - if (NCCI != 0xffffffff) capilib_free_ncci(&cinfo->ncci_head, ApplId, NCCI); - + spin_unlock_irqrestore(&card->lock, flags); break; case RECEIVE_START: @@ -333,13 +329,16 @@ static void t1isa_reset_ctr(struct capi_ctr *ctrl) avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmcard *card = cinfo->card; unsigned int port = card->port; + unsigned long flags; t1_disable_irq(port); b1_reset(port); b1_reset(port); memset(cinfo->version, 0, sizeof(cinfo->version)); + spin_lock_irqsave(&card->lock, flags); capilib_release(&cinfo->ncci_head); + spin_unlock_irqrestore(&card->lock, flags); capi_ctr_reseted(ctrl); } @@ -466,29 +465,26 @@ static u16 t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data); u16 dlen, retval; + spin_lock_irqsave(&card->lock, flags); if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { retval = capilib_data_b3_req(&cinfo->ncci_head, CAPIMSG_APPID(skb->data), CAPIMSG_NCCI(skb->data), CAPIMSG_MSGID(skb->data)); - if (retval != CAPI_NOERROR) + if (retval != CAPI_NOERROR) { + spin_unlock_irqrestore(&card->lock, flags); return retval; - + } dlen = CAPIMSG_DATALEN(skb->data); - spin_lock_irqsave(&card->lock, flags); b1_put_byte(port, SEND_DATA_B3_REQ); t1_put_slice(port, skb->data, len); t1_put_slice(port, skb->data + len, dlen); - spin_unlock_irqrestore(&card->lock, flags); } else { - - spin_lock_irqsave(&card->lock, flags); b1_put_byte(port, SEND_MESSAGE); t1_put_slice(port, skb->data, len); - spin_unlock_irqrestore(&card->lock, flags); } - + spin_unlock_irqrestore(&card->lock, flags); dev_kfree_skb_any(skb); return CAPI_NOERROR; } diff --git a/drivers/isdn/sc/debug.h b/drivers/isdn/sc/debug.h deleted file mode 100644 index e9db96ede4b..00000000000 --- a/drivers/isdn/sc/debug.h +++ /dev/null @@ -1,19 +0,0 @@ -/* $Id: debug.h,v 1.2.8.1 2001/09/23 22:24:59 kai Exp $ - * - * Copyright (C) 1996 SpellCaster Telecommunications Inc. - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - * - * For more information, please contact gpl-info@spellcast.com or write: - * - * SpellCaster Telecommunications Inc. - * 5621 Finch Avenue East, Unit #3 - * Scarborough, Ontario Canada - * M1B 2T9 - * +1 (416) 297-8565 - * +1 (416) 297-6433 Facsimile - */ - -#define REQUEST_IRQ(a,b,c,d,e) request_irq(a,b,c,d,e) -#define FREE_IRQ(a,b) free_irq(a,b) diff --git a/drivers/isdn/sc/includes.h b/drivers/isdn/sc/includes.h index 5286e0c810a..4766e5b7737 100644 --- a/drivers/isdn/sc/includes.h +++ b/drivers/isdn/sc/includes.h @@ -14,4 +14,3 @@ #include <linux/timer.h> #include <linux/wait.h> #include <linux/isdnif.h> -#include "debug.h" diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c index 0bf76344a0d..d09c854cfac 100644 --- a/drivers/isdn/sc/init.c +++ b/drivers/isdn/sc/init.c @@ -404,7 +404,7 @@ static void __exit sc_exit(void) /* * Release the IRQ */ - FREE_IRQ(sc_adapter[i]->interrupt, NULL); + free_irq(sc_adapter[i]->interrupt, NULL); /* * Reset for a clean start diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c index 2766e4fc4ea..883da72b536 100644 --- a/drivers/macintosh/adbhid.c +++ b/drivers/macintosh/adbhid.c @@ -791,8 +791,10 @@ adbhid_input_register(int id, int default_id, int original_handler_id, if (hid->keycode[i]) set_bit(hid->keycode[i], input_dev->keybit); - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); - input_dev->ledbit[0] = BIT(LED_SCROLLL) | BIT(LED_CAPSL) | BIT(LED_NUML); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) | + BIT_MASK(EV_REP); + input_dev->ledbit[0] = BIT_MASK(LED_SCROLLL) | + BIT_MASK(LED_CAPSL) | BIT_MASK(LED_NUML); input_dev->event = adbhid_kbd_event; input_dev->keycodemax = KEY_FN; input_dev->keycodesize = sizeof(hid->keycode[0]); @@ -801,16 +803,18 @@ adbhid_input_register(int id, int default_id, int original_handler_id, case ADB_MOUSE: sprintf(hid->name, "ADB mouse"); - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); - input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); + input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); break; case ADB_MISC: switch (original_handler_id) { case 0x02: /* Adjustable keyboard button device */ sprintf(hid->name, "ADB adjustable keyboard buttons"); - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | + BIT_MASK(EV_REP); set_bit(KEY_SOUND, input_dev->keybit); set_bit(KEY_MUTE, input_dev->keybit); set_bit(KEY_VOLUMEUP, input_dev->keybit); @@ -818,7 +822,8 @@ adbhid_input_register(int id, int default_id, int original_handler_id, break; case 0x1f: /* Powerbook button device */ sprintf(hid->name, "ADB Powerbook buttons"); - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | + BIT_MASK(EV_REP); set_bit(KEY_MUTE, input_dev->keybit); set_bit(KEY_VOLUMEUP, input_dev->keybit); set_bit(KEY_VOLUMEDOWN, input_dev->keybit); diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index 33dee3a773e..89302309da9 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c @@ -117,9 +117,10 @@ static int emumousebtn_input_register(void) emumousebtn->id.product = 0x0001; emumousebtn->id.version = 0x0100; - emumousebtn->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - emumousebtn->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT); - emumousebtn->relbit[0] = BIT(REL_X) | BIT(REL_Y); + emumousebtn->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + emumousebtn->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT); + emumousebtn->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); ret = input_register_device(emumousebtn); if (ret) diff --git a/drivers/md/md.c b/drivers/md/md.c index c059ae6f37e..808cd954945 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4717,7 +4717,7 @@ mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev, void md_unregister_thread(mdk_thread_t *thread) { - dprintk("interrupting MD-thread pid %d\n", thread->tsk->pid); + dprintk("interrupting MD-thread pid %d\n", task_pid_nr(thread->tsk)); kthread_stop(thread->tsk); kfree(thread); diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c index 5a12b567955..154a7ce7cb8 100644 --- a/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/drivers/media/dvb/cinergyT2/cinergyT2.c @@ -820,7 +820,7 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2) input_dev->name = DRIVER_NAME " remote control"; input_dev->phys = cinergyt2->phys; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); for (i = 0; i < ARRAY_SIZE(rc_keys); i += 3) set_bit(rc_keys[i + 2], input_dev->keybit); input_dev->keycodesize = 0; diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c index 7b9f35bfb4f..c0c2c22ddd8 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c @@ -106,7 +106,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d) if (!input_dev) return -ENOMEM; - input_dev->evbit[0] = BIT(EV_KEY); + input_dev->evbit[0] = BIT_MASK(EV_KEY); input_dev->name = "IR-receiver inside an USB DVB receiver"; input_dev->phys = d->rc_phys; usb_to_input_id(d->udev, &input_dev->id); diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c index 5d19c402dad..a283e1de83f 100644 --- a/drivers/media/dvb/ttpci/av7110_ir.c +++ b/drivers/media/dvb/ttpci/av7110_ir.c @@ -27,7 +27,7 @@ #include <linux/module.h> #include <linux/proc_fs.h> #include <linux/kernel.h> -#include <asm/bitops.h> +#include <linux/bitops.h> #include "av7110.h" #include "av7110_hw.h" diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 5e691fd7990..1ec981d98b9 100644 --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -1198,7 +1198,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec) input_dev->name = "ttusb_dec remote control"; input_dev->phys = dec->rc_phys; - input_dev->evbit[0] = BIT(EV_KEY); + input_dev->evbit[0] = BIT_MASK(EV_KEY); input_dev->keycodesize = sizeof(u16); input_dev->keycodemax = 0x1a; input_dev->keycode = rc_keys; diff --git a/drivers/media/video/usbvideo/konicawc.c b/drivers/media/video/usbvideo/konicawc.c index 491505d6fde..3e93f805877 100644 --- a/drivers/media/video/usbvideo/konicawc.c +++ b/drivers/media/video/usbvideo/konicawc.c @@ -238,8 +238,8 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev usb_to_input_id(dev, &input_dev->id); input_dev->dev.parent = &dev->dev; - input_dev->evbit[0] = BIT(EV_KEY); - input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0); + input_dev->evbit[0] = BIT_MASK(EV_KEY); + input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); input_dev->private = cam; diff --git a/drivers/media/video/usbvideo/quickcam_messenger.c b/drivers/media/video/usbvideo/quickcam_messenger.c index dd1a6d6bbc9..d847273eeba 100644 --- a/drivers/media/video/usbvideo/quickcam_messenger.c +++ b/drivers/media/video/usbvideo/quickcam_messenger.c @@ -102,8 +102,8 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev) usb_to_input_id(dev, &input_dev->id); input_dev->dev.parent = &dev->dev; - input_dev->evbit[0] = BIT(EV_KEY); - input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0); + input_dev->evbit[0] = BIT_MASK(EV_KEY); + input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); input_dev->private = cam; diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c index 1c14fa2bd41..419e5af7853 100644 --- a/drivers/media/video/zoran_driver.c +++ b/drivers/media/video/zoran_driver.c @@ -1285,7 +1285,7 @@ zoran_open (struct inode *inode, } dprintk(1, KERN_INFO "%s: zoran_open(%s, pid=[%d]), users(-)=%d\n", - ZR_DEVNAME(zr), current->comm, current->pid, zr->user); + ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user); /* now, create the open()-specific file_ops struct */ fh = kzalloc(sizeof(struct zoran_fh), GFP_KERNEL); @@ -1358,7 +1358,7 @@ zoran_close (struct inode *inode, struct zoran *zr = fh->zr; dprintk(1, KERN_INFO "%s: zoran_close(%s, pid=[%d]), users(+)=%d\n", - ZR_DEVNAME(zr), current->comm, current->pid, zr->user); + ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user); /* kernel locks (fs/device.c), so don't do that ourselves * (prevents deadlocks) */ diff --git a/drivers/misc/ibmasm/remote.c b/drivers/misc/ibmasm/remote.c index 0550ce075fc..1d9defb1a10 100644 --- a/drivers/misc/ibmasm/remote.c +++ b/drivers/misc/ibmasm/remote.c @@ -226,9 +226,9 @@ int ibmasm_init_remote_input_dev(struct service_processor *sp) mouse_dev->id.product = pdev->device; mouse_dev->id.version = 1; mouse_dev->dev.parent = sp->dev; - mouse_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); - mouse_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | - BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); + mouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); + mouse_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); set_bit(BTN_TOUCH, mouse_dev->keybit); mouse_dev->name = "ibmasm RSA I remote mouse"; input_set_abs_params(mouse_dev, ABS_X, 0, MOUSE_X_MAX, 0, 0); @@ -239,7 +239,7 @@ int ibmasm_init_remote_input_dev(struct service_processor *sp) keybd_dev->id.product = pdev->device; keybd_dev->id.version = 2; keybd_dev->dev.parent = sp->dev; - keybd_dev->evbit[0] = BIT(EV_KEY); + keybd_dev->evbit[0] = BIT_MASK(EV_KEY); keybd_dev->name = "ibmasm RSA I remote keyboard"; for (i = 0; i < XLATE_SIZE; i++) { diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c index 5108b7c576d..cd221fd0fb9 100644 --- a/drivers/misc/phantom.c +++ b/drivers/misc/phantom.c @@ -9,6 +9,7 @@ * You need an userspace library to cooperate with this driver. It (and other * info) may be obtained here: * http://www.fi.muni.cz/~xslaby/phantom.html + * or alternatively, you might use OpenHaptics provided by Sensable. */ #include <linux/kernel.h> @@ -24,13 +25,14 @@ #include <asm/atomic.h> #include <asm/io.h> -#define PHANTOM_VERSION "n0.9.5" +#define PHANTOM_VERSION "n0.9.7" #define PHANTOM_MAX_MINORS 8 #define PHN_IRQCTL 0x4c /* irq control in caddr space */ #define PHB_RUNNING 1 +#define PHB_NOT_OH 2 static struct class *phantom_class; static int phantom_major; @@ -47,7 +49,11 @@ struct phantom_device { struct cdev cdev; struct mutex open_lock; - spinlock_t ioctl_lock; + spinlock_t regs_lock; + + /* used in NOT_OH mode */ + struct phm_regs oregs; + u32 ctl_reg; }; static unsigned char phantom_devices[PHANTOM_MAX_MINORS]; @@ -82,6 +88,7 @@ static long phantom_ioctl(struct file *file, unsigned int cmd, struct phm_regs rs; struct phm_reg r; void __user *argp = (void __user *)arg; + unsigned long flags; unsigned int i; if (_IOC_TYPE(cmd) != PH_IOC_MAGIC || @@ -96,32 +103,45 @@ static long phantom_ioctl(struct file *file, unsigned int cmd, if (r.reg > 7) return -EINVAL; - spin_lock(&dev->ioctl_lock); + spin_lock_irqsave(&dev->regs_lock, flags); if (r.reg == PHN_CONTROL && (r.value & PHN_CTL_IRQ) && phantom_status(dev, dev->status | PHB_RUNNING)){ - spin_unlock(&dev->ioctl_lock); + spin_unlock_irqrestore(&dev->regs_lock, flags); return -ENODEV; } pr_debug("phantom: writing %x to %u\n", r.value, r.reg); + + /* preserve amp bit (don't allow to change it when in NOT_OH) */ + if (r.reg == PHN_CONTROL && (dev->status & PHB_NOT_OH)) { + r.value &= ~PHN_CTL_AMP; + r.value |= dev->ctl_reg & PHN_CTL_AMP; + dev->ctl_reg = r.value; + } + iowrite32(r.value, dev->iaddr + r.reg); ioread32(dev->iaddr); /* PCI posting */ if (r.reg == PHN_CONTROL && !(r.value & PHN_CTL_IRQ)) phantom_status(dev, dev->status & ~PHB_RUNNING); - spin_unlock(&dev->ioctl_lock); + spin_unlock_irqrestore(&dev->regs_lock, flags); break; case PHN_SET_REGS: if (copy_from_user(&rs, argp, sizeof(rs))) return -EFAULT; pr_debug("phantom: SRS %u regs %x\n", rs.count, rs.mask); - spin_lock(&dev->ioctl_lock); - for (i = 0; i < min(rs.count, 8U); i++) - if ((1 << i) & rs.mask) - iowrite32(rs.values[i], dev->oaddr + i); - ioread32(dev->iaddr); /* PCI posting */ - spin_unlock(&dev->ioctl_lock); + spin_lock_irqsave(&dev->regs_lock, flags); + if (dev->status & PHB_NOT_OH) + memcpy(&dev->oregs, &rs, sizeof(rs)); + else { + u32 m = min(rs.count, 8U); + for (i = 0; i < m; i++) + if (rs.mask & BIT(i)) + iowrite32(rs.values[i], dev->oaddr + i); + ioread32(dev->iaddr); /* PCI posting */ + } + spin_unlock_irqrestore(&dev->regs_lock, flags); break; case PHN_GET_REG: if (copy_from_user(&r, argp, sizeof(r))) @@ -135,20 +155,35 @@ static long phantom_ioctl(struct file *file, unsigned int cmd, if (copy_to_user(argp, &r, sizeof(r))) return -EFAULT; break; - case PHN_GET_REGS: + case PHN_GET_REGS: { + u32 m; + if (copy_from_user(&rs, argp, sizeof(rs))) return -EFAULT; + m = min(rs.count, 8U); + pr_debug("phantom: GRS %u regs %x\n", rs.count, rs.mask); - spin_lock(&dev->ioctl_lock); - for (i = 0; i < min(rs.count, 8U); i++) - if ((1 << i) & rs.mask) + spin_lock_irqsave(&dev->regs_lock, flags); + for (i = 0; i < m; i++) + if (rs.mask & BIT(i)) rs.values[i] = ioread32(dev->iaddr + i); - spin_unlock(&dev->ioctl_lock); + spin_unlock_irqrestore(&dev->regs_lock, flags); if (copy_to_user(argp, &rs, sizeof(rs))) return -EFAULT; break; + } case PHN_NOT_OH: + spin_lock_irqsave(&dev->regs_lock, flags); + if (dev->status & PHB_RUNNING) { + printk(KERN_ERR "phantom: you need to set NOT_OH " + "before you start the device!\n"); + spin_unlock_irqrestore(&dev->regs_lock, flags); + return -EINVAL; + } + dev->status |= PHB_NOT_OH; + spin_unlock_irqrestore(&dev->regs_lock, flags); + break; default: return -ENOTTY; } @@ -171,8 +206,11 @@ static int phantom_open(struct inode *inode, struct file *file) return -EINVAL; } + WARN_ON(dev->status & PHB_NOT_OH); + file->private_data = dev; + atomic_set(&dev->counter, 0); dev->opened++; mutex_unlock(&dev->open_lock); @@ -187,6 +225,7 @@ static int phantom_release(struct inode *inode, struct file *file) dev->opened = 0; phantom_status(dev, dev->status & ~PHB_RUNNING); + dev->status &= ~PHB_NOT_OH; mutex_unlock(&dev->open_lock); @@ -220,12 +259,32 @@ static struct file_operations phantom_file_ops = { static irqreturn_t phantom_isr(int irq, void *data) { struct phantom_device *dev = data; + unsigned int i; + u32 ctl; - if (!(ioread32(dev->iaddr + PHN_CONTROL) & PHN_CTL_IRQ)) + spin_lock(&dev->regs_lock); + ctl = ioread32(dev->iaddr + PHN_CONTROL); + if (!(ctl & PHN_CTL_IRQ)) { + spin_unlock(&dev->regs_lock); return IRQ_NONE; + } iowrite32(0, dev->iaddr); iowrite32(0xc0, dev->iaddr); + + if (dev->status & PHB_NOT_OH) { + struct phm_regs *r = &dev->oregs; + u32 m = min(r->count, 8U); + + for (i = 0; i < m; i++) + if (r->mask & BIT(i)) + iowrite32(r->values[i], dev->oaddr + i); + + dev->ctl_reg ^= PHN_CTL_AMP; + iowrite32(dev->ctl_reg, dev->iaddr + PHN_CONTROL); + } + spin_unlock(&dev->regs_lock); + ioread32(dev->iaddr); /* PCI posting */ atomic_inc(&dev->counter); @@ -297,7 +356,7 @@ static int __devinit phantom_probe(struct pci_dev *pdev, } mutex_init(&pht->open_lock); - spin_lock_init(&pht->ioctl_lock); + spin_lock_init(&pht->regs_lock); init_waitqueue_head(&pht->wait); cdev_init(&pht->cdev, &phantom_file_ops); pht->cdev.owner = THIS_MODULE; @@ -378,6 +437,8 @@ static int phantom_suspend(struct pci_dev *pdev, pm_message_t state) iowrite32(0, dev->caddr + PHN_IRQCTL); ioread32(dev->caddr + PHN_IRQCTL); /* PCI posting */ + synchronize_irq(pdev->irq); + return 0; } diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index e73a71f04bb..86da96becd2 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c @@ -411,9 +411,9 @@ static int sony_laptop_setup_input(void) jog_dev->id.bustype = BUS_ISA; jog_dev->id.vendor = PCI_VENDOR_ID_SONY; - jog_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - jog_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_MIDDLE); - jog_dev->relbit[0] = BIT(REL_WHEEL); + jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE); + jog_dev->relbit[0] = BIT_MASK(REL_WHEEL); error = input_register_device(jog_dev); if (error) diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index a4f1bf33164..6330c8cc72b 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -1309,7 +1309,7 @@ static int ubi_thread(void *u) struct ubi_device *ubi = u; ubi_msg("background thread \"%s\" started, PID %d", - ubi->bgt_name, current->pid); + ubi->bgt_name, task_pid_nr(current)); set_freezable(); for (;;) { diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 96cee4badd2..da767d3d5af 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -26,7 +26,7 @@ #include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/dma-mapping.h> -#include <asm/bitops.h> +#include <linux/bitops.h> #include <asm/io.h> #include <asm/irq.h> #include <linux/delay.h> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 7a045a37056..084f0292ea6 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -126,7 +126,7 @@ static struct aggregator *__get_active_agg(struct aggregator *aggregator); // ================= main 802.3ad protocol functions ================== static int ad_lacpdu_send(struct port *port); -static int ad_marker_send(struct port *port, struct marker *marker); +static int ad_marker_send(struct port *port, struct bond_marker *marker); static void ad_mux_machine(struct port *port); static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port); static void ad_tx_machine(struct port *port); @@ -139,8 +139,8 @@ static void ad_initialize_port(struct port *port, int lacp_fast); static void ad_initialize_lacpdu(struct lacpdu *Lacpdu); static void ad_enable_collecting_distributing(struct port *port); static void ad_disable_collecting_distributing(struct port *port); -static void ad_marker_info_received(struct marker *marker_info, struct port *port); -static void ad_marker_response_received(struct marker *marker, struct port *port); +static void ad_marker_info_received(struct bond_marker *marker_info, struct port *port); +static void ad_marker_response_received(struct bond_marker *marker, struct port *port); ///////////////////////////////////////////////////////////////////////////////// @@ -889,12 +889,12 @@ static int ad_lacpdu_send(struct port *port) * Returns: 0 on success * < 0 on error */ -static int ad_marker_send(struct port *port, struct marker *marker) +static int ad_marker_send(struct port *port, struct bond_marker *marker) { struct slave *slave = port->slave; struct sk_buff *skb; - struct marker_header *marker_header; - int length = sizeof(struct marker_header); + struct bond_marker_header *marker_header; + int length = sizeof(struct bond_marker_header); struct mac_addr lacpdu_multicast_address = AD_MULTICAST_LACPDU_ADDR; skb = dev_alloc_skb(length + 16); @@ -909,7 +909,7 @@ static int ad_marker_send(struct port *port, struct marker *marker) skb->network_header = skb->mac_header + ETH_HLEN; skb->protocol = PKT_TYPE_LACPDU; - marker_header = (struct marker_header *)skb_put(skb, length); + marker_header = (struct bond_marker_header *)skb_put(skb, length); marker_header->ad_header.destination_address = lacpdu_multicast_address; /* Note: source addres is set to be the member's PERMANENT address, because we use it @@ -1709,7 +1709,7 @@ static void ad_disable_collecting_distributing(struct port *port) */ static void ad_marker_info_send(struct port *port) { - struct marker marker; + struct bond_marker marker; u16 index; // fill the marker PDU with the appropriate values @@ -1742,13 +1742,14 @@ static void ad_marker_info_send(struct port *port) * @port: the port we're looking at * */ -static void ad_marker_info_received(struct marker *marker_info,struct port *port) +static void ad_marker_info_received(struct bond_marker *marker_info, + struct port *port) { - struct marker marker; + struct bond_marker marker; // copy the received marker data to the response marker //marker = *marker_info; - memcpy(&marker, marker_info, sizeof(struct marker)); + memcpy(&marker, marker_info, sizeof(struct bond_marker)); // change the marker subtype to marker response marker.tlv_type=AD_MARKER_RESPONSE_SUBTYPE; // send the marker response @@ -1767,7 +1768,8 @@ static void ad_marker_info_received(struct marker *marker_info,struct port *port * response for marker PDU's, in this stage, but only to respond to marker * information. */ -static void ad_marker_response_received(struct marker *marker, struct port *port) +static void ad_marker_response_received(struct bond_marker *marker, + struct port *port) { marker=NULL; // just to satisfy the compiler port=NULL; // just to satisfy the compiler @@ -2164,15 +2166,15 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u case AD_TYPE_MARKER: // No need to convert fields to Little Endian since we don't use the marker's fields. - switch (((struct marker *)lacpdu)->tlv_type) { + switch (((struct bond_marker *)lacpdu)->tlv_type) { case AD_MARKER_INFORMATION_SUBTYPE: dprintk("Received Marker Information on port %d\n", port->actor_port_number); - ad_marker_info_received((struct marker *)lacpdu, port); + ad_marker_info_received((struct bond_marker *)lacpdu, port); break; case AD_MARKER_RESPONSE_SUBTYPE: dprintk("Received Marker Response on port %d\n", port->actor_port_number); - ad_marker_response_received((struct marker *)lacpdu, port); + ad_marker_response_received((struct bond_marker *)lacpdu, port); break; default: diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index 862952fa6fd..f1655726494 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h @@ -92,7 +92,7 @@ typedef enum { typedef enum { AD_MARKER_INFORMATION_SUBTYPE = 1, // marker imformation subtype AD_MARKER_RESPONSE_SUBTYPE // marker response subtype -} marker_subtype_t; +} bond_marker_subtype_t; // timers types(43.4.9 in the 802.3ad standard) typedef enum { @@ -148,7 +148,7 @@ typedef struct lacpdu_header { } lacpdu_header_t; // Marker Protocol Data Unit(PDU) structure(43.5.3.2 in the 802.3ad standard) -typedef struct marker { +typedef struct bond_marker { u8 subtype; // = 0x02 (marker PDU) u8 version_number; // = 0x01 u8 tlv_type; // = 0x01 (marker information) @@ -161,12 +161,12 @@ typedef struct marker { u8 tlv_type_terminator; // = 0x00 u8 terminator_length; // = 0x00 u8 reserved_90[90]; // = 0 -} marker_t; +} bond_marker_t; -typedef struct marker_header { +typedef struct bond_marker_header { struct ad_header ad_header; - struct marker marker; -} marker_header_t; + struct bond_marker marker; +} bond_marker_header_t; #pragma pack() diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c index 314b2f68f78..edd6828f0a7 100644 --- a/drivers/net/cris/eth_v10.c +++ b/drivers/net/cris/eth_v10.c @@ -234,6 +234,7 @@ #include <linux/spinlock.h> #include <linux/errno.h> #include <linux/init.h> +#include <linux/bitops.h> #include <linux/if.h> #include <linux/mii.h> @@ -247,7 +248,6 @@ #include <asm/irq.h> #include <asm/dma.h> #include <asm/system.h> -#include <asm/bitops.h> #include <asm/ethernet.h> #include <asm/cache.h> diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h index 04426170338..2a3df145850 100644 --- a/drivers/net/cxgb3/adapter.h +++ b/drivers/net/cxgb3/adapter.h @@ -41,9 +41,9 @@ #include <linux/timer.h> #include <linux/cache.h> #include <linux/mutex.h> +#include <linux/bitops.h> #include "t3cdev.h" #include <asm/semaphore.h> -#include <asm/bitops.h> #include <asm/io.h> typedef irqreturn_t(*intr_handler_t) (int, void *); diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c index 243fc6b354b..e3dd8b13690 100644 --- a/drivers/net/eth16i.c +++ b/drivers/net/eth16i.c @@ -170,7 +170,6 @@ static char *version = /* Few macros */ -#define BIT(a) ( (1 << (a)) ) #define BITSET(ioaddr, bnum) ((outb(((inb(ioaddr)) | (bnum)), ioaddr))) #define BITCLR(ioaddr, bnum) ((outb(((inb(ioaddr)) & (~(bnum))), ioaddr))) diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index bc02e469480..11b83dae00a 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c @@ -21,6 +21,7 @@ #include <linux/module.h> +#include <linux/bitops.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/if_arp.h> @@ -35,7 +36,6 @@ #include <linux/sockios.h> #include <linux/workqueue.h> #include <asm/atomic.h> -#include <asm/bitops.h> #include <asm/dma.h> #include <asm/io.h> #include <asm/irq.h> diff --git a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c index 30854f09496..a19b5958cee 100644 --- a/drivers/net/mac89x0.c +++ b/drivers/net/mac89x0.c @@ -99,9 +99,9 @@ static char *version = #include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/delay.h> +#include <linux/bitops.h> #include <asm/system.h> -#include <asm/bitops.h> #include <asm/io.h> #include <asm/hwtest.h> #include <asm/macints.h> diff --git a/drivers/net/meth.h b/drivers/net/meth.h index ea3b8fc86d1..a78dc1ca8c2 100644 --- a/drivers/net/meth.h +++ b/drivers/net/meth.h @@ -28,9 +28,6 @@ #define RX_BUFFER_OFFSET (sizeof(rx_status_vector)+2) /* staus vector + 2 bytes of padding */ #define RX_BUCKET_SIZE 256 -#undef BIT -#define BIT(x) (1UL << (x)) - /* For more detailed explanations of what each field menas, see Nick's great comments to #defines below (or docs, if you are lucky enough toget hold of them :)*/ diff --git a/drivers/net/s2io-regs.h b/drivers/net/s2io-regs.h index aef66e2d98d..01f08d726ac 100644 --- a/drivers/net/s2io-regs.h +++ b/drivers/net/s2io-regs.h @@ -20,17 +20,17 @@ struct XENA_dev_config { /* General Control-Status Registers */ u64 general_int_status; -#define GEN_INTR_TXPIC BIT(0) -#define GEN_INTR_TXDMA BIT(1) -#define GEN_INTR_TXMAC BIT(2) -#define GEN_INTR_TXXGXS BIT(3) -#define GEN_INTR_TXTRAFFIC BIT(8) -#define GEN_INTR_RXPIC BIT(32) -#define GEN_INTR_RXDMA BIT(33) -#define GEN_INTR_RXMAC BIT(34) -#define GEN_INTR_MC BIT(35) -#define GEN_INTR_RXXGXS BIT(36) -#define GEN_INTR_RXTRAFFIC BIT(40) +#define GEN_INTR_TXPIC s2BIT(0) +#define GEN_INTR_TXDMA s2BIT(1) +#define GEN_INTR_TXMAC s2BIT(2) +#define GEN_INTR_TXXGXS s2BIT(3) +#define GEN_INTR_TXTRAFFIC s2BIT(8) +#define GEN_INTR_RXPIC s2BIT(32) +#define GEN_INTR_RXDMA s2BIT(33) +#define GEN_INTR_RXMAC s2BIT(34) +#define GEN_INTR_MC s2BIT(35) +#define GEN_INTR_RXXGXS s2BIT(36) +#define GEN_INTR_RXTRAFFIC s2BIT(40) #define GEN_ERROR_INTR GEN_INTR_TXPIC | GEN_INTR_RXPIC | \ GEN_INTR_TXDMA | GEN_INTR_RXDMA | \ GEN_INTR_TXMAC | GEN_INTR_RXMAC | \ @@ -54,36 +54,36 @@ struct XENA_dev_config { u64 adapter_status; -#define ADAPTER_STATUS_TDMA_READY BIT(0) -#define ADAPTER_STATUS_RDMA_READY BIT(1) -#define ADAPTER_STATUS_PFC_READY BIT(2) -#define ADAPTER_STATUS_TMAC_BUF_EMPTY BIT(3) -#define ADAPTER_STATUS_PIC_QUIESCENT BIT(5) -#define ADAPTER_STATUS_RMAC_REMOTE_FAULT BIT(6) -#define ADAPTER_STATUS_RMAC_LOCAL_FAULT BIT(7) +#define ADAPTER_STATUS_TDMA_READY s2BIT(0) +#define ADAPTER_STATUS_RDMA_READY s2BIT(1) +#define ADAPTER_STATUS_PFC_READY s2BIT(2) +#define ADAPTER_STATUS_TMAC_BUF_EMPTY s2BIT(3) +#define ADAPTER_STATUS_PIC_QUIESCENT s2BIT(5) +#define ADAPTER_STATUS_RMAC_REMOTE_FAULT s2BIT(6) +#define ADAPTER_STATUS_RMAC_LOCAL_FAULT s2BIT(7) #define ADAPTER_STATUS_RMAC_PCC_IDLE vBIT(0xFF,8,8) #define ADAPTER_STATUS_RMAC_PCC_FOUR_IDLE vBIT(0x0F,8,8) #define ADAPTER_STATUS_RC_PRC_QUIESCENT vBIT(0xFF,16,8) -#define ADAPTER_STATUS_MC_DRAM_READY BIT(24) -#define ADAPTER_STATUS_MC_QUEUES_READY BIT(25) -#define ADAPTER_STATUS_M_PLL_LOCK BIT(30) -#define ADAPTER_STATUS_P_PLL_LOCK BIT(31) +#define ADAPTER_STATUS_MC_DRAM_READY s2BIT(24) +#define ADAPTER_STATUS_MC_QUEUES_READY s2BIT(25) +#define ADAPTER_STATUS_M_PLL_LOCK s2BIT(30) +#define ADAPTER_STATUS_P_PLL_LOCK s2BIT(31) u64 adapter_control; -#define ADAPTER_CNTL_EN BIT(7) -#define ADAPTER_EOI_TX_ON BIT(15) -#define ADAPTER_LED_ON BIT(23) +#define ADAPTER_CNTL_EN s2BIT(7) +#define ADAPTER_EOI_TX_ON s2BIT(15) +#define ADAPTER_LED_ON s2BIT(23) #define ADAPTER_UDPI(val) vBIT(val,36,4) -#define ADAPTER_WAIT_INT BIT(48) -#define ADAPTER_ECC_EN BIT(55) +#define ADAPTER_WAIT_INT s2BIT(48) +#define ADAPTER_ECC_EN s2BIT(55) u64 serr_source; -#define SERR_SOURCE_PIC BIT(0) -#define SERR_SOURCE_TXDMA BIT(1) -#define SERR_SOURCE_RXDMA BIT(2) -#define SERR_SOURCE_MAC BIT(3) -#define SERR_SOURCE_MC BIT(4) -#define SERR_SOURCE_XGXS BIT(5) +#define SERR_SOURCE_PIC s2BIT(0) +#define SERR_SOURCE_TXDMA s2BIT(1) +#define SERR_SOURCE_RXDMA s2BIT(2) +#define SERR_SOURCE_MAC s2BIT(3) +#define SERR_SOURCE_MC s2BIT(4) +#define SERR_SOURCE_XGXS s2BIT(5) #define SERR_SOURCE_ANY (SERR_SOURCE_PIC | \ SERR_SOURCE_TXDMA | \ SERR_SOURCE_RXDMA | \ @@ -101,41 +101,41 @@ struct XENA_dev_config { #define PCI_MODE_PCIX_M2_66 0x5 #define PCI_MODE_PCIX_M2_100 0x6 #define PCI_MODE_PCIX_M2_133 0x7 -#define PCI_MODE_UNSUPPORTED BIT(0) -#define PCI_MODE_32_BITS BIT(8) -#define PCI_MODE_UNKNOWN_MODE BIT(9) +#define PCI_MODE_UNSUPPORTED s2BIT(0) +#define PCI_MODE_32_BITS s2BIT(8) +#define PCI_MODE_UNKNOWN_MODE s2BIT(9) u8 unused_0[0x800 - 0x128]; /* PCI-X Controller registers */ u64 pic_int_status; u64 pic_int_mask; -#define PIC_INT_TX BIT(0) -#define PIC_INT_FLSH BIT(1) -#define PIC_INT_MDIO BIT(2) -#define PIC_INT_IIC BIT(3) -#define PIC_INT_GPIO BIT(4) -#define PIC_INT_RX BIT(32) +#define PIC_INT_TX s2BIT(0) +#define PIC_INT_FLSH s2BIT(1) +#define PIC_INT_MDIO s2BIT(2) +#define PIC_INT_IIC s2BIT(3) +#define PIC_INT_GPIO s2BIT(4) +#define PIC_INT_RX s2BIT(32) u64 txpic_int_reg; u64 txpic_int_mask; -#define PCIX_INT_REG_ECC_SG_ERR BIT(0) -#define PCIX_INT_REG_ECC_DB_ERR BIT(1) -#define PCIX_INT_REG_FLASHR_R_FSM_ERR BIT(8) -#define PCIX_INT_REG_FLASHR_W_FSM_ERR BIT(9) -#define PCIX_INT_REG_INI_TX_FSM_SERR BIT(10) -#define PCIX_INT_REG_INI_TXO_FSM_ERR BIT(11) -#define PCIX_INT_REG_TRT_FSM_SERR BIT(13) -#define PCIX_INT_REG_SRT_FSM_SERR BIT(14) -#define PCIX_INT_REG_PIFR_FSM_SERR BIT(15) -#define PCIX_INT_REG_WRC_TX_SEND_FSM_SERR BIT(21) -#define PCIX_INT_REG_RRC_TX_REQ_FSM_SERR BIT(23) -#define PCIX_INT_REG_INI_RX_FSM_SERR BIT(48) -#define PCIX_INT_REG_RA_RX_FSM_SERR BIT(50) +#define PCIX_INT_REG_ECC_SG_ERR s2BIT(0) +#define PCIX_INT_REG_ECC_DB_ERR s2BIT(1) +#define PCIX_INT_REG_FLASHR_R_FSM_ERR s2BIT(8) +#define PCIX_INT_REG_FLASHR_W_FSM_ERR s2BIT(9) +#define PCIX_INT_REG_INI_TX_FSM_SERR s2BIT(10) +#define PCIX_INT_REG_INI_TXO_FSM_ERR s2BIT(11) +#define PCIX_INT_REG_TRT_FSM_SERR s2BIT(13) +#define PCIX_INT_REG_SRT_FSM_SERR s2BIT(14) +#define PCIX_INT_REG_PIFR_FSM_SERR s2BIT(15) +#define PCIX_INT_REG_WRC_TX_SEND_FSM_SERR s2BIT(21) +#define PCIX_INT_REG_RRC_TX_REQ_FSM_SERR s2BIT(23) +#define PCIX_INT_REG_INI_RX_FSM_SERR s2BIT(48) +#define PCIX_INT_REG_RA_RX_FSM_SERR s2BIT(50) /* -#define PCIX_INT_REG_WRC_RX_SEND_FSM_SERR BIT(52) -#define PCIX_INT_REG_RRC_RX_REQ_FSM_SERR BIT(54) -#define PCIX_INT_REG_RRC_RX_SPLIT_FSM_SERR BIT(58) +#define PCIX_INT_REG_WRC_RX_SEND_FSM_SERR s2BIT(52) +#define PCIX_INT_REG_RRC_RX_REQ_FSM_SERR s2BIT(54) +#define PCIX_INT_REG_RRC_RX_SPLIT_FSM_SERR s2BIT(58) */ u64 txpic_alarms; u64 rxpic_int_reg; @@ -144,92 +144,92 @@ struct XENA_dev_config { u64 flsh_int_reg; u64 flsh_int_mask; -#define PIC_FLSH_INT_REG_CYCLE_FSM_ERR BIT(63) -#define PIC_FLSH_INT_REG_ERR BIT(62) +#define PIC_FLSH_INT_REG_CYCLE_FSM_ERR s2BIT(63) +#define PIC_FLSH_INT_REG_ERR s2BIT(62) u64 flash_alarms; u64 mdio_int_reg; u64 mdio_int_mask; -#define MDIO_INT_REG_MDIO_BUS_ERR BIT(0) -#define MDIO_INT_REG_DTX_BUS_ERR BIT(8) -#define MDIO_INT_REG_LASI BIT(39) +#define MDIO_INT_REG_MDIO_BUS_ERR s2BIT(0) +#define MDIO_INT_REG_DTX_BUS_ERR s2BIT(8) +#define MDIO_INT_REG_LASI s2BIT(39) u64 mdio_alarms; u64 iic_int_reg; u64 iic_int_mask; -#define IIC_INT_REG_BUS_FSM_ERR BIT(4) -#define IIC_INT_REG_BIT_FSM_ERR BIT(5) -#define IIC_INT_REG_CYCLE_FSM_ERR BIT(6) -#define IIC_INT_REG_REQ_FSM_ERR BIT(7) -#define IIC_INT_REG_ACK_ERR BIT(8) +#define IIC_INT_REG_BUS_FSM_ERR s2BIT(4) +#define IIC_INT_REG_BIT_FSM_ERR s2BIT(5) +#define IIC_INT_REG_CYCLE_FSM_ERR s2BIT(6) +#define IIC_INT_REG_REQ_FSM_ERR s2BIT(7) +#define IIC_INT_REG_ACK_ERR s2BIT(8) u64 iic_alarms; u8 unused4[0x08]; u64 gpio_int_reg; -#define GPIO_INT_REG_DP_ERR_INT BIT(0) -#define GPIO_INT_REG_LINK_DOWN BIT(1) -#define GPIO_INT_REG_LINK_UP BIT(2) +#define GPIO_INT_REG_DP_ERR_INT s2BIT(0) +#define GPIO_INT_REG_LINK_DOWN s2BIT(1) +#define GPIO_INT_REG_LINK_UP s2BIT(2) u64 gpio_int_mask; -#define GPIO_INT_MASK_LINK_DOWN BIT(1) -#define GPIO_INT_MASK_LINK_UP BIT(2) +#define GPIO_INT_MASK_LINK_DOWN s2BIT(1) +#define GPIO_INT_MASK_LINK_UP s2BIT(2) u64 gpio_alarms; u8 unused5[0x38]; u64 tx_traffic_int; -#define TX_TRAFFIC_INT_n(n) BIT(n) +#define TX_TRAFFIC_INT_n(n) s2BIT(n) u64 tx_traffic_mask; u64 rx_traffic_int; -#define RX_TRAFFIC_INT_n(n) BIT(n) +#define RX_TRAFFIC_INT_n(n) s2BIT(n) u64 rx_traffic_mask; /* PIC Control registers */ u64 pic_control; -#define PIC_CNTL_RX_ALARM_MAP_1 BIT(0) +#define PIC_CNTL_RX_ALARM_MAP_1 s2BIT(0) #define PIC_CNTL_SHARED_SPLITS(n) vBIT(n,11,5) u64 swapper_ctrl; -#define SWAPPER_CTRL_PIF_R_FE BIT(0) -#define SWAPPER_CTRL_PIF_R_SE BIT(1) -#define SWAPPER_CTRL_PIF_W_FE BIT(8) -#define SWAPPER_CTRL_PIF_W_SE BIT(9) -#define SWAPPER_CTRL_TXP_FE BIT(16) -#define SWAPPER_CTRL_TXP_SE BIT(17) -#define SWAPPER_CTRL_TXD_R_FE BIT(18) -#define SWAPPER_CTRL_TXD_R_SE BIT(19) -#define SWAPPER_CTRL_TXD_W_FE BIT(20) -#define SWAPPER_CTRL_TXD_W_SE BIT(21) -#define SWAPPER_CTRL_TXF_R_FE BIT(22) -#define SWAPPER_CTRL_TXF_R_SE BIT(23) -#define SWAPPER_CTRL_RXD_R_FE BIT(32) -#define SWAPPER_CTRL_RXD_R_SE BIT(33) -#define SWAPPER_CTRL_RXD_W_FE BIT(34) -#define SWAPPER_CTRL_RXD_W_SE BIT(35) -#define SWAPPER_CTRL_RXF_W_FE BIT(36) -#define SWAPPER_CTRL_RXF_W_SE BIT(37) -#define SWAPPER_CTRL_XMSI_FE BIT(40) -#define SWAPPER_CTRL_XMSI_SE BIT(41) -#define SWAPPER_CTRL_STATS_FE BIT(48) -#define SWAPPER_CTRL_STATS_SE BIT(49) +#define SWAPPER_CTRL_PIF_R_FE s2BIT(0) +#define SWAPPER_CTRL_PIF_R_SE s2BIT(1) +#define SWAPPER_CTRL_PIF_W_FE s2BIT(8) +#define SWAPPER_CTRL_PIF_W_SE s2BIT(9) +#define SWAPPER_CTRL_TXP_FE s2BIT(16) +#define SWAPPER_CTRL_TXP_SE s2BIT(17) +#define SWAPPER_CTRL_TXD_R_FE s2BIT(18) +#define SWAPPER_CTRL_TXD_R_SE s2BIT(19) +#define SWAPPER_CTRL_TXD_W_FE s2BIT(20) +#define SWAPPER_CTRL_TXD_W_SE s2BIT(21) +#define SWAPPER_CTRL_TXF_R_FE s2BIT(22) +#define SWAPPER_CTRL_TXF_R_SE s2BIT(23) +#define SWAPPER_CTRL_RXD_R_FE s2BIT(32) +#define SWAPPER_CTRL_RXD_R_SE s2BIT(33) +#define SWAPPER_CTRL_RXD_W_FE s2BIT(34) +#define SWAPPER_CTRL_RXD_W_SE s2BIT(35) +#define SWAPPER_CTRL_RXF_W_FE s2BIT(36) +#define SWAPPER_CTRL_RXF_W_SE s2BIT(37) +#define SWAPPER_CTRL_XMSI_FE s2BIT(40) +#define SWAPPER_CTRL_XMSI_SE s2BIT(41) +#define SWAPPER_CTRL_STATS_FE s2BIT(48) +#define SWAPPER_CTRL_STATS_SE s2BIT(49) u64 pif_rd_swapper_fb; #define IF_RD_SWAPPER_FB 0x0123456789ABCDEF u64 scheduled_int_ctrl; -#define SCHED_INT_CTRL_TIMER_EN BIT(0) -#define SCHED_INT_CTRL_ONE_SHOT BIT(1) +#define SCHED_INT_CTRL_TIMER_EN s2BIT(0) +#define SCHED_INT_CTRL_ONE_SHOT s2BIT(1) #define SCHED_INT_CTRL_INT2MSI(val) vBIT(val,10,6) #define SCHED_INT_PERIOD TBD u64 txreqtimeout; #define TXREQTO_VAL(val) vBIT(val,0,32) -#define TXREQTO_EN BIT(63) +#define TXREQTO_EN s2BIT(63) u64 statsreqtimeout; #define STATREQTO_VAL(n) TBD -#define STATREQTO_EN BIT(63) +#define STATREQTO_EN s2BIT(63) u64 read_retry_delay; u64 read_retry_acceleration; @@ -255,10 +255,10 @@ struct XENA_dev_config { /* Automated statistics collection */ u64 stat_cfg; -#define STAT_CFG_STAT_EN BIT(0) -#define STAT_CFG_ONE_SHOT_EN BIT(1) -#define STAT_CFG_STAT_NS_EN BIT(8) -#define STAT_CFG_STAT_RO BIT(9) +#define STAT_CFG_STAT_EN s2BIT(0) +#define STAT_CFG_ONE_SHOT_EN s2BIT(1) +#define STAT_CFG_STAT_NS_EN s2BIT(8) +#define STAT_CFG_STAT_RO s2BIT(9) #define STAT_TRSF_PER(n) TBD #define PER_SEC 0x208d5 #define SET_UPDT_PERIOD(n) vBIT((PER_SEC*n),32,32) @@ -290,18 +290,18 @@ struct XENA_dev_config { #define I2C_CONTROL_DEV_ID(id) vBIT(id,1,3) #define I2C_CONTROL_ADDR(addr) vBIT(addr,5,11) #define I2C_CONTROL_BYTE_CNT(cnt) vBIT(cnt,22,2) -#define I2C_CONTROL_READ BIT(24) -#define I2C_CONTROL_NACK BIT(25) +#define I2C_CONTROL_READ s2BIT(24) +#define I2C_CONTROL_NACK s2BIT(25) #define I2C_CONTROL_CNTL_START vBIT(0xE,28,4) #define I2C_CONTROL_CNTL_END(val) (val & vBIT(0x1,28,4)) #define I2C_CONTROL_GET_DATA(val) (u32)(val & 0xFFFFFFFF) #define I2C_CONTROL_SET_DATA(val) vBIT(val,32,32) u64 gpio_control; -#define GPIO_CTRL_GPIO_0 BIT(8) +#define GPIO_CTRL_GPIO_0 s2BIT(8) u64 misc_control; -#define FAULT_BEHAVIOUR BIT(0) -#define EXT_REQ_EN BIT(1) +#define FAULT_BEHAVIOUR s2BIT(0) +#define EXT_REQ_EN s2BIT(1) #define MISC_LINK_STABILITY_PRD(val) vBIT(val,29,3) u8 unused7_1[0x230 - 0x208]; @@ -317,29 +317,29 @@ struct XENA_dev_config { /* TxDMA registers */ u64 txdma_int_status; u64 txdma_int_mask; -#define TXDMA_PFC_INT BIT(0) -#define TXDMA_TDA_INT BIT(1) -#define TXDMA_PCC_INT BIT(2) -#define TXDMA_TTI_INT BIT(3) -#define TXDMA_LSO_INT BIT(4) -#define TXDMA_TPA_INT BIT(5) -#define TXDMA_SM_INT BIT(6) +#define TXDMA_PFC_INT s2BIT(0) +#define TXDMA_TDA_INT s2BIT(1) +#define TXDMA_PCC_INT s2BIT(2) +#define TXDMA_TTI_INT s2BIT(3) +#define TXDMA_LSO_INT s2BIT(4) +#define TXDMA_TPA_INT s2BIT(5) +#define TXDMA_SM_INT s2BIT(6) u64 pfc_err_reg; -#define PFC_ECC_SG_ERR BIT(7) -#define PFC_ECC_DB_ERR BIT(15) -#define PFC_SM_ERR_ALARM BIT(23) -#define PFC_MISC_0_ERR BIT(31) -#define PFC_MISC_1_ERR BIT(32) -#define PFC_PCIX_ERR BIT(39) +#define PFC_ECC_SG_ERR s2BIT(7) +#define PFC_ECC_DB_ERR s2BIT(15) +#define PFC_SM_ERR_ALARM s2BIT(23) +#define PFC_MISC_0_ERR s2BIT(31) +#define PFC_MISC_1_ERR s2BIT(32) +#define PFC_PCIX_ERR s2BIT(39) u64 pfc_err_mask; u64 pfc_err_alarm; u64 tda_err_reg; #define TDA_Fn_ECC_SG_ERR vBIT(0xff,0,8) #define TDA_Fn_ECC_DB_ERR vBIT(0xff,8,8) -#define TDA_SM0_ERR_ALARM BIT(22) -#define TDA_SM1_ERR_ALARM BIT(23) -#define TDA_PCIX_ERR BIT(39) +#define TDA_SM0_ERR_ALARM s2BIT(22) +#define TDA_SM1_ERR_ALARM s2BIT(23) +#define TDA_PCIX_ERR s2BIT(39) u64 tda_err_mask; u64 tda_err_alarm; @@ -351,40 +351,40 @@ struct XENA_dev_config { #define PCC_SM_ERR_ALARM vBIT(0xff,32,8) #define PCC_WR_ERR_ALARM vBIT(0xff,40,8) #define PCC_N_SERR vBIT(0xff,48,8) -#define PCC_6_COF_OV_ERR BIT(56) -#define PCC_7_COF_OV_ERR BIT(57) -#define PCC_6_LSO_OV_ERR BIT(58) -#define PCC_7_LSO_OV_ERR BIT(59) +#define PCC_6_COF_OV_ERR s2BIT(56) +#define PCC_7_COF_OV_ERR s2BIT(57) +#define PCC_6_LSO_OV_ERR s2BIT(58) +#define PCC_7_LSO_OV_ERR s2BIT(59) #define PCC_ENABLE_FOUR vBIT(0x0F,0,8) u64 pcc_err_mask; u64 pcc_err_alarm; u64 tti_err_reg; -#define TTI_ECC_SG_ERR BIT(7) -#define TTI_ECC_DB_ERR BIT(15) -#define TTI_SM_ERR_ALARM BIT(23) +#define TTI_ECC_SG_ERR s2BIT(7) +#define TTI_ECC_DB_ERR s2BIT(15) +#define TTI_SM_ERR_ALARM s2BIT(23) u64 tti_err_mask; u64 tti_err_alarm; u64 lso_err_reg; -#define LSO6_SEND_OFLOW BIT(12) -#define LSO7_SEND_OFLOW BIT(13) -#define LSO6_ABORT BIT(14) -#define LSO7_ABORT BIT(15) -#define LSO6_SM_ERR_ALARM BIT(22) -#define LSO7_SM_ERR_ALARM BIT(23) +#define LSO6_SEND_OFLOW s2BIT(12) +#define LSO7_SEND_OFLOW s2BIT(13) +#define LSO6_ABORT s2BIT(14) +#define LSO7_ABORT s2BIT(15) +#define LSO6_SM_ERR_ALARM s2BIT(22) +#define LSO7_SM_ERR_ALARM s2BIT(23) u64 lso_err_mask; u64 lso_err_alarm; u64 tpa_err_reg; -#define TPA_TX_FRM_DROP BIT(7) -#define TPA_SM_ERR_ALARM BIT(23) +#define TPA_TX_FRM_DROP s2BIT(7) +#define TPA_SM_ERR_ALARM s2BIT(23) u64 tpa_err_mask; u64 tpa_err_alarm; u64 sm_err_reg; -#define SM_SM_ERR_ALARM BIT(15) +#define SM_SM_ERR_ALARM s2BIT(15) u64 sm_err_mask; u64 sm_err_alarm; @@ -397,7 +397,7 @@ struct XENA_dev_config { #define X_MAX_FIFOS 8 #define X_FIFO_MAX_LEN 0x1FFF /*8191 */ u64 tx_fifo_partition_0; -#define TX_FIFO_PARTITION_EN BIT(0) +#define TX_FIFO_PARTITION_EN s2BIT(0) #define TX_FIFO_PARTITION_0_PRI(val) vBIT(val,5,3) #define TX_FIFO_PARTITION_0_LEN(val) vBIT(val,19,13) #define TX_FIFO_PARTITION_1_PRI(val) vBIT(val,37,3) @@ -437,16 +437,16 @@ struct XENA_dev_config { u64 tx_w_round_robin_4; u64 tti_command_mem; -#define TTI_CMD_MEM_WE BIT(7) -#define TTI_CMD_MEM_STROBE_NEW_CMD BIT(15) -#define TTI_CMD_MEM_STROBE_BEING_EXECUTED BIT(15) +#define TTI_CMD_MEM_WE s2BIT(7) +#define TTI_CMD_MEM_STROBE_NEW_CMD s2BIT(15) +#define TTI_CMD_MEM_STROBE_BEING_EXECUTED s2BIT(15) #define TTI_CMD_MEM_OFFSET(n) vBIT(n,26,6) u64 tti_data1_mem; #define TTI_DATA1_MEM_TX_TIMER_VAL(n) vBIT(n,6,26) #define TTI_DATA1_MEM_TX_TIMER_AC_CI(n) vBIT(n,38,2) -#define TTI_DATA1_MEM_TX_TIMER_AC_EN BIT(38) -#define TTI_DATA1_MEM_TX_TIMER_CI_EN BIT(39) +#define TTI_DATA1_MEM_TX_TIMER_AC_EN s2BIT(38) +#define TTI_DATA1_MEM_TX_TIMER_CI_EN s2BIT(39) #define TTI_DATA1_MEM_TX_URNG_A(n) vBIT(n,41,7) #define TTI_DATA1_MEM_TX_URNG_B(n) vBIT(n,49,7) #define TTI_DATA1_MEM_TX_URNG_C(n) vBIT(n,57,7) @@ -459,11 +459,11 @@ struct XENA_dev_config { /* Tx Protocol assist */ u64 tx_pa_cfg; -#define TX_PA_CFG_IGNORE_FRM_ERR BIT(1) -#define TX_PA_CFG_IGNORE_SNAP_OUI BIT(2) -#define TX_PA_CFG_IGNORE_LLC_CTRL BIT(3) -#define TX_PA_CFG_IGNORE_L2_ERR BIT(6) -#define RX_PA_CFG_STRIP_VLAN_TAG BIT(15) +#define TX_PA_CFG_IGNORE_FRM_ERR s2BIT(1) +#define TX_PA_CFG_IGNORE_SNAP_OUI s2BIT(2) +#define TX_PA_CFG_IGNORE_LLC_CTRL s2BIT(3) +#define TX_PA_CFG_IGNORE_L2_ERR s2BIT(6) +#define RX_PA_CFG_STRIP_VLAN_TAG s2BIT(15) /* Recent add, used only debug purposes. */ u64 pcc_enable; @@ -477,31 +477,31 @@ struct XENA_dev_config { /* RxDMA Registers */ u64 rxdma_int_status; u64 rxdma_int_mask; -#define RXDMA_INT_RC_INT_M BIT(0) -#define RXDMA_INT_RPA_INT_M BIT(1) -#define RXDMA_INT_RDA_INT_M BIT(2) -#define RXDMA_INT_RTI_INT_M BIT(3) +#define RXDMA_INT_RC_INT_M s2BIT(0) +#define RXDMA_INT_RPA_INT_M s2BIT(1) +#define RXDMA_INT_RDA_INT_M s2BIT(2) +#define RXDMA_INT_RTI_INT_M s2BIT(3) u64 rda_err_reg; #define RDA_RXDn_ECC_SG_ERR vBIT(0xFF,0,8) #define RDA_RXDn_ECC_DB_ERR vBIT(0xFF,8,8) -#define RDA_FRM_ECC_SG_ERR BIT(23) -#define RDA_FRM_ECC_DB_N_AERR BIT(31) -#define RDA_SM1_ERR_ALARM BIT(38) -#define RDA_SM0_ERR_ALARM BIT(39) -#define RDA_MISC_ERR BIT(47) -#define RDA_PCIX_ERR BIT(55) -#define RDA_RXD_ECC_DB_SERR BIT(63) +#define RDA_FRM_ECC_SG_ERR s2BIT(23) +#define RDA_FRM_ECC_DB_N_AERR s2BIT(31) +#define RDA_SM1_ERR_ALARM s2BIT(38) +#define RDA_SM0_ERR_ALARM s2BIT(39) +#define RDA_MISC_ERR s2BIT(47) +#define RDA_PCIX_ERR s2BIT(55) +#define RDA_RXD_ECC_DB_SERR s2BIT(63) u64 rda_err_mask; u64 rda_err_alarm; u64 rc_err_reg; #define RC_PRCn_ECC_SG_ERR vBIT(0xFF,0,8) #define RC_PRCn_ECC_DB_ERR vBIT(0xFF,8,8) -#define RC_FTC_ECC_SG_ERR BIT(23) -#define RC_FTC_ECC_DB_ERR BIT(31) +#define RC_FTC_ECC_SG_ERR s2BIT(23) +#define RC_FTC_ECC_DB_ERR s2BIT(31) #define RC_PRCn_SM_ERR_ALARM vBIT(0xFF,32,8) -#define RC_FTC_SM_ERR_ALARM BIT(47) +#define RC_FTC_SM_ERR_ALARM s2BIT(47) #define RC_RDA_FAIL_WR_Rn vBIT(0xFF,48,8) u64 rc_err_mask; u64 rc_err_alarm; @@ -517,18 +517,18 @@ struct XENA_dev_config { u64 prc_pcix_err_alarm; u64 rpa_err_reg; -#define RPA_ECC_SG_ERR BIT(7) -#define RPA_ECC_DB_ERR BIT(15) -#define RPA_FLUSH_REQUEST BIT(22) -#define RPA_SM_ERR_ALARM BIT(23) -#define RPA_CREDIT_ERR BIT(31) +#define RPA_ECC_SG_ERR s2BIT(7) +#define RPA_ECC_DB_ERR s2BIT(15) +#define RPA_FLUSH_REQUEST s2BIT(22) +#define RPA_SM_ERR_ALARM s2BIT(23) +#define RPA_CREDIT_ERR s2BIT(31) u64 rpa_err_mask; u64 rpa_err_alarm; u64 rti_err_reg; -#define RTI_ECC_SG_ERR BIT(7) -#define RTI_ECC_DB_ERR BIT(15) -#define RTI_SM_ERR_ALARM BIT(23) +#define RTI_ECC_SG_ERR s2BIT(7) +#define RTI_ECC_DB_ERR s2BIT(15) +#define RTI_SM_ERR_ALARM s2BIT(23) u64 rti_err_mask; u64 rti_err_alarm; @@ -568,49 +568,49 @@ struct XENA_dev_config { #endif u64 prc_rxd0_n[RX_MAX_RINGS]; u64 prc_ctrl_n[RX_MAX_RINGS]; -#define PRC_CTRL_RC_ENABLED BIT(7) -#define PRC_CTRL_RING_MODE (BIT(14)|BIT(15)) +#define PRC_CTRL_RC_ENABLED s2BIT(7) +#define PRC_CTRL_RING_MODE (s2BIT(14)|s2BIT(15)) #define PRC_CTRL_RING_MODE_1 vBIT(0,14,2) #define PRC_CTRL_RING_MODE_3 vBIT(1,14,2) #define PRC_CTRL_RING_MODE_5 vBIT(2,14,2) #define PRC_CTRL_RING_MODE_x vBIT(3,14,2) -#define PRC_CTRL_NO_SNOOP (BIT(22)|BIT(23)) -#define PRC_CTRL_NO_SNOOP_DESC BIT(22) -#define PRC_CTRL_NO_SNOOP_BUFF BIT(23) -#define PRC_CTRL_BIMODAL_INTERRUPT BIT(37) -#define PRC_CTRL_GROUP_READS BIT(38) +#define PRC_CTRL_NO_SNOOP (s2BIT(22)|s2BIT(23)) +#define PRC_CTRL_NO_SNOOP_DESC s2BIT(22) +#define PRC_CTRL_NO_SNOOP_BUFF s2BIT(23) +#define PRC_CTRL_BIMODAL_INTERRUPT s2BIT(37) +#define PRC_CTRL_GROUP_READS s2BIT(38) #define PRC_CTRL_RXD_BACKOFF_INTERVAL(val) vBIT(val,40,24) u64 prc_alarm_action; -#define PRC_ALARM_ACTION_RR_R0_STOP BIT(3) -#define PRC_ALARM_ACTION_RW_R0_STOP BIT(7) -#define PRC_ALARM_ACTION_RR_R1_STOP BIT(11) -#define PRC_ALARM_ACTION_RW_R1_STOP BIT(15) -#define PRC_ALARM_ACTION_RR_R2_STOP BIT(19) -#define PRC_ALARM_ACTION_RW_R2_STOP BIT(23) -#define PRC_ALARM_ACTION_RR_R3_STOP BIT(27) -#define PRC_ALARM_ACTION_RW_R3_STOP BIT(31) -#define PRC_ALARM_ACTION_RR_R4_STOP BIT(35) -#define PRC_ALARM_ACTION_RW_R4_STOP BIT(39) -#define PRC_ALARM_ACTION_RR_R5_STOP BIT(43) -#define PRC_ALARM_ACTION_RW_R5_STOP BIT(47) -#define PRC_ALARM_ACTION_RR_R6_STOP BIT(51) -#define PRC_ALARM_ACTION_RW_R6_STOP BIT(55) -#define PRC_ALARM_ACTION_RR_R7_STOP BIT(59) -#define PRC_ALARM_ACTION_RW_R7_STOP BIT(63) +#define PRC_ALARM_ACTION_RR_R0_STOP s2BIT(3) +#define PRC_ALARM_ACTION_RW_R0_STOP s2BIT(7) +#define PRC_ALARM_ACTION_RR_R1_STOP s2BIT(11) +#define PRC_ALARM_ACTION_RW_R1_STOP s2BIT(15) +#define PRC_ALARM_ACTION_RR_R2_STOP s2BIT(19) +#define PRC_ALARM_ACTION_RW_R2_STOP s2BIT(23) +#define PRC_ALARM_ACTION_RR_R3_STOP s2BIT(27) +#define PRC_ALARM_ACTION_RW_R3_STOP s2BIT(31) +#define PRC_ALARM_ACTION_RR_R4_STOP s2BIT(35) +#define PRC_ALARM_ACTION_RW_R4_STOP s2BIT(39) +#define PRC_ALARM_ACTION_RR_R5_STOP s2BIT(43) +#define PRC_ALARM_ACTION_RW_R5_STOP s2BIT(47) +#define PRC_ALARM_ACTION_RR_R6_STOP s2BIT(51) +#define PRC_ALARM_ACTION_RW_R6_STOP s2BIT(55) +#define PRC_ALARM_ACTION_RR_R7_STOP s2BIT(59) +#define PRC_ALARM_ACTION_RW_R7_STOP s2BIT(63) /* Receive traffic interrupts */ u64 rti_command_mem; -#define RTI_CMD_MEM_WE BIT(7) -#define RTI_CMD_MEM_STROBE BIT(15) -#define RTI_CMD_MEM_STROBE_NEW_CMD BIT(15) -#define RTI_CMD_MEM_STROBE_CMD_BEING_EXECUTED BIT(15) +#define RTI_CMD_MEM_WE s2BIT(7) +#define RTI_CMD_MEM_STROBE s2BIT(15) +#define RTI_CMD_MEM_STROBE_NEW_CMD s2BIT(15) +#define RTI_CMD_MEM_STROBE_CMD_BEING_EXECUTED s2BIT(15) #define RTI_CMD_MEM_OFFSET(n) vBIT(n,29,3) u64 rti_data1_mem; #define RTI_DATA1_MEM_RX_TIMER_VAL(n) vBIT(n,3,29) -#define RTI_DATA1_MEM_RX_TIMER_AC_EN BIT(38) -#define RTI_DATA1_MEM_RX_TIMER_CI_EN BIT(39) +#define RTI_DATA1_MEM_RX_TIMER_AC_EN s2BIT(38) +#define RTI_DATA1_MEM_RX_TIMER_CI_EN s2BIT(39) #define RTI_DATA1_MEM_RX_URNG_A(n) vBIT(n,41,7) #define RTI_DATA1_MEM_RX_URNG_B(n) vBIT(n,49,7) #define RTI_DATA1_MEM_RX_URNG_C(n) vBIT(n,57,7) @@ -622,10 +622,10 @@ struct XENA_dev_config { #define RTI_DATA2_MEM_RX_UFC_D(n) vBIT(n,48,16) u64 rx_pa_cfg; -#define RX_PA_CFG_IGNORE_FRM_ERR BIT(1) -#define RX_PA_CFG_IGNORE_SNAP_OUI BIT(2) -#define RX_PA_CFG_IGNORE_LLC_CTRL BIT(3) -#define RX_PA_CFG_IGNORE_L2_ERR BIT(6) +#define RX_PA_CFG_IGNORE_FRM_ERR s2BIT(1) +#define RX_PA_CFG_IGNORE_SNAP_OUI s2BIT(2) +#define RX_PA_CFG_IGNORE_LLC_CTRL s2BIT(3) +#define RX_PA_CFG_IGNORE_L2_ERR s2BIT(6) u64 unused_11_1; @@ -641,64 +641,64 @@ struct XENA_dev_config { /* Media Access Controller Register */ u64 mac_int_status; u64 mac_int_mask; -#define MAC_INT_STATUS_TMAC_INT BIT(0) -#define MAC_INT_STATUS_RMAC_INT BIT(1) +#define MAC_INT_STATUS_TMAC_INT s2BIT(0) +#define MAC_INT_STATUS_RMAC_INT s2BIT(1) u64 mac_tmac_err_reg; -#define TMAC_ECC_SG_ERR BIT(7) -#define TMAC_ECC_DB_ERR BIT(15) -#define TMAC_TX_BUF_OVRN BIT(23) -#define TMAC_TX_CRI_ERR BIT(31) -#define TMAC_TX_SM_ERR BIT(39) -#define TMAC_DESC_ECC_SG_ERR BIT(47) -#define TMAC_DESC_ECC_DB_ERR BIT(55) +#define TMAC_ECC_SG_ERR s2BIT(7) +#define TMAC_ECC_DB_ERR s2BIT(15) +#define TMAC_TX_BUF_OVRN s2BIT(23) +#define TMAC_TX_CRI_ERR s2BIT(31) +#define TMAC_TX_SM_ERR s2BIT(39) +#define TMAC_DESC_ECC_SG_ERR s2BIT(47) +#define TMAC_DESC_ECC_DB_ERR s2BIT(55) u64 mac_tmac_err_mask; u64 mac_tmac_err_alarm; u64 mac_rmac_err_reg; -#define RMAC_RX_BUFF_OVRN BIT(0) -#define RMAC_FRM_RCVD_INT BIT(1) -#define RMAC_UNUSED_INT BIT(2) -#define RMAC_RTS_PNUM_ECC_SG_ERR BIT(5) -#define RMAC_RTS_DS_ECC_SG_ERR BIT(6) -#define RMAC_RD_BUF_ECC_SG_ERR BIT(7) -#define RMAC_RTH_MAP_ECC_SG_ERR BIT(8) -#define RMAC_RTH_SPDM_ECC_SG_ERR BIT(9) -#define RMAC_RTS_VID_ECC_SG_ERR BIT(10) -#define RMAC_DA_SHADOW_ECC_SG_ERR BIT(11) -#define RMAC_RTS_PNUM_ECC_DB_ERR BIT(13) -#define RMAC_RTS_DS_ECC_DB_ERR BIT(14) -#define RMAC_RD_BUF_ECC_DB_ERR BIT(15) -#define RMAC_RTH_MAP_ECC_DB_ERR BIT(16) -#define RMAC_RTH_SPDM_ECC_DB_ERR BIT(17) -#define RMAC_RTS_VID_ECC_DB_ERR BIT(18) -#define RMAC_DA_SHADOW_ECC_DB_ERR BIT(19) -#define RMAC_LINK_STATE_CHANGE_INT BIT(31) -#define RMAC_RX_SM_ERR BIT(39) -#define RMAC_SINGLE_ECC_ERR (BIT(5) | BIT(6) | BIT(7) |\ - BIT(8) | BIT(9) | BIT(10)|\ - BIT(11)) -#define RMAC_DOUBLE_ECC_ERR (BIT(13) | BIT(14) | BIT(15) |\ - BIT(16) | BIT(17) | BIT(18)|\ - BIT(19)) +#define RMAC_RX_BUFF_OVRN s2BIT(0) +#define RMAC_FRM_RCVD_INT s2BIT(1) +#define RMAC_UNUSED_INT s2BIT(2) +#define RMAC_RTS_PNUM_ECC_SG_ERR s2BIT(5) +#define RMAC_RTS_DS_ECC_SG_ERR s2BIT(6) +#define RMAC_RD_BUF_ECC_SG_ERR s2BIT(7) +#define RMAC_RTH_MAP_ECC_SG_ERR s2BIT(8) +#define RMAC_RTH_SPDM_ECC_SG_ERR s2BIT(9) +#define RMAC_RTS_VID_ECC_SG_ERR s2BIT(10) +#define RMAC_DA_SHADOW_ECC_SG_ERR s2BIT(11) +#define RMAC_RTS_PNUM_ECC_DB_ERR s2BIT(13) +#define RMAC_RTS_DS_ECC_DB_ERR s2BIT(14) +#define RMAC_RD_BUF_ECC_DB_ERR s2BIT(15) +#define RMAC_RTH_MAP_ECC_DB_ERR s2BIT(16) +#define RMAC_RTH_SPDM_ECC_DB_ERR s2BIT(17) +#define RMAC_RTS_VID_ECC_DB_ERR s2BIT(18) +#define RMAC_DA_SHADOW_ECC_DB_ERR s2BIT(19) +#define RMAC_LINK_STATE_CHANGE_INT s2BIT(31) +#define RMAC_RX_SM_ERR s2BIT(39) +#define RMAC_SINGLE_ECC_ERR (s2BIT(5) | s2BIT(6) | s2BIT(7) |\ + s2BIT(8) | s2BIT(9) | s2BIT(10)|\ + s2BIT(11)) +#define RMAC_DOUBLE_ECC_ERR (s2BIT(13) | s2BIT(14) | s2BIT(15) |\ + s2BIT(16) | s2BIT(17) | s2BIT(18)|\ + s2BIT(19)) u64 mac_rmac_err_mask; u64 mac_rmac_err_alarm; u8 unused14[0x100 - 0x40]; u64 mac_cfg; -#define MAC_CFG_TMAC_ENABLE BIT(0) -#define MAC_CFG_RMAC_ENABLE BIT(1) -#define MAC_CFG_LAN_NOT_WAN BIT(2) -#define MAC_CFG_TMAC_LOOPBACK BIT(3) -#define MAC_CFG_TMAC_APPEND_PAD BIT(4) -#define MAC_CFG_RMAC_STRIP_FCS BIT(5) -#define MAC_CFG_RMAC_STRIP_PAD BIT(6) -#define MAC_CFG_RMAC_PROM_ENABLE BIT(7) -#define MAC_RMAC_DISCARD_PFRM BIT(8) -#define MAC_RMAC_BCAST_ENABLE BIT(9) -#define MAC_RMAC_ALL_ADDR_ENABLE BIT(10) +#define MAC_CFG_TMAC_ENABLE s2BIT(0) +#define MAC_CFG_RMAC_ENABLE s2BIT(1) +#define MAC_CFG_LAN_NOT_WAN s2BIT(2) +#define MAC_CFG_TMAC_LOOPBACK s2BIT(3) +#define MAC_CFG_TMAC_APPEND_PAD s2BIT(4) +#define MAC_CFG_RMAC_STRIP_FCS s2BIT(5) +#define MAC_CFG_RMAC_STRIP_PAD s2BIT(6) +#define MAC_CFG_RMAC_PROM_ENABLE s2BIT(7) +#define MAC_RMAC_DISCARD_PFRM s2BIT(8) +#define MAC_RMAC_BCAST_ENABLE s2BIT(9) +#define MAC_RMAC_ALL_ADDR_ENABLE s2BIT(10) #define MAC_RMAC_INVLD_IPG_THR(val) vBIT(val,16,8) u64 tmac_avg_ipg; @@ -710,14 +710,14 @@ struct XENA_dev_config { #define RMAC_MAX_PYLD_LEN_JUMBO_DEF vBIT(9600,2,14) u64 rmac_err_cfg; -#define RMAC_ERR_FCS BIT(0) -#define RMAC_ERR_FCS_ACCEPT BIT(1) -#define RMAC_ERR_TOO_LONG BIT(1) -#define RMAC_ERR_TOO_LONG_ACCEPT BIT(1) -#define RMAC_ERR_RUNT BIT(2) -#define RMAC_ERR_RUNT_ACCEPT BIT(2) -#define RMAC_ERR_LEN_MISMATCH BIT(3) -#define RMAC_ERR_LEN_MISMATCH_ACCEPT BIT(3) +#define RMAC_ERR_FCS s2BIT(0) +#define RMAC_ERR_FCS_ACCEPT s2BIT(1) +#define RMAC_ERR_TOO_LONG s2BIT(1) +#define RMAC_ERR_TOO_LONG_ACCEPT s2BIT(1) +#define RMAC_ERR_RUNT s2BIT(2) +#define RMAC_ERR_RUNT_ACCEPT s2BIT(2) +#define RMAC_ERR_LEN_MISMATCH s2BIT(3) +#define RMAC_ERR_LEN_MISMATCH_ACCEPT s2BIT(3) u64 rmac_cfg_key; #define RMAC_CFG_KEY(val) vBIT(val,0,16) @@ -728,15 +728,15 @@ struct XENA_dev_config { #define MAC_MC_ADDR_START_OFFSET 16 #define MAC_MC_ALL_MC_ADDR_OFFSET 63 /* enables all multicast pkts */ u64 rmac_addr_cmd_mem; -#define RMAC_ADDR_CMD_MEM_WE BIT(7) +#define RMAC_ADDR_CMD_MEM_WE s2BIT(7) #define RMAC_ADDR_CMD_MEM_RD 0 -#define RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD BIT(15) -#define RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING BIT(15) +#define RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD s2BIT(15) +#define RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING s2BIT(15) #define RMAC_ADDR_CMD_MEM_OFFSET(n) vBIT(n,26,6) u64 rmac_addr_data0_mem; #define RMAC_ADDR_DATA0_MEM_ADDR(n) vBIT(n,0,48) -#define RMAC_ADDR_DATA0_MEM_USER BIT(48) +#define RMAC_ADDR_DATA0_MEM_USER s2BIT(48) u64 rmac_addr_data1_mem; #define RMAC_ADDR_DATA1_MEM_MASK(n) vBIT(n,0,48) @@ -753,10 +753,10 @@ struct XENA_dev_config { u64 tmac_ipg_cfg; u64 rmac_pause_cfg; -#define RMAC_PAUSE_GEN BIT(0) -#define RMAC_PAUSE_GEN_ENABLE BIT(0) -#define RMAC_PAUSE_RX BIT(1) -#define RMAC_PAUSE_RX_ENABLE BIT(1) +#define RMAC_PAUSE_GEN s2BIT(0) +#define RMAC_PAUSE_GEN_ENABLE s2BIT(0) +#define RMAC_PAUSE_RX s2BIT(1) +#define RMAC_PAUSE_RX_ENABLE s2BIT(1) #define RMAC_PAUSE_HG_PTIME_DEF vBIT(0xFFFF,16,16) #define RMAC_PAUSE_HG_PTIME(val) vBIT(val,16,16) @@ -787,29 +787,29 @@ struct XENA_dev_config { #define MAX_DIX_MAP 4 u64 rts_dix_map_n[MAX_DIX_MAP]; #define RTS_DIX_MAP_ETYPE(val) vBIT(val,0,16) -#define RTS_DIX_MAP_SCW(val) BIT(val,21) +#define RTS_DIX_MAP_SCW(val) s2BIT(val,21) u64 rts_q_alternates; u64 rts_default_q; u64 rts_ctrl; -#define RTS_CTRL_IGNORE_SNAP_OUI BIT(2) -#define RTS_CTRL_IGNORE_LLC_CTRL BIT(3) +#define RTS_CTRL_IGNORE_SNAP_OUI s2BIT(2) +#define RTS_CTRL_IGNORE_LLC_CTRL s2BIT(3) u64 rts_pn_cam_ctrl; -#define RTS_PN_CAM_CTRL_WE BIT(7) -#define RTS_PN_CAM_CTRL_STROBE_NEW_CMD BIT(15) -#define RTS_PN_CAM_CTRL_STROBE_BEING_EXECUTED BIT(15) +#define RTS_PN_CAM_CTRL_WE s2BIT(7) +#define RTS_PN_CAM_CTRL_STROBE_NEW_CMD s2BIT(15) +#define RTS_PN_CAM_CTRL_STROBE_BEING_EXECUTED s2BIT(15) #define RTS_PN_CAM_CTRL_OFFSET(n) vBIT(n,24,8) u64 rts_pn_cam_data; -#define RTS_PN_CAM_DATA_TCP_SELECT BIT(7) +#define RTS_PN_CAM_DATA_TCP_SELECT s2BIT(7) #define RTS_PN_CAM_DATA_PORT(val) vBIT(val,8,16) #define RTS_PN_CAM_DATA_SCW(val) vBIT(val,24,8) u64 rts_ds_mem_ctrl; -#define RTS_DS_MEM_CTRL_WE BIT(7) -#define RTS_DS_MEM_CTRL_STROBE_NEW_CMD BIT(15) -#define RTS_DS_MEM_CTRL_STROBE_CMD_BEING_EXECUTED BIT(15) +#define RTS_DS_MEM_CTRL_WE s2BIT(7) +#define RTS_DS_MEM_CTRL_STROBE_NEW_CMD s2BIT(15) +#define RTS_DS_MEM_CTRL_STROBE_CMD_BEING_EXECUTED s2BIT(15) #define RTS_DS_MEM_CTRL_OFFSET(n) vBIT(n,26,6) u64 rts_ds_mem_data; #define RTS_DS_MEM_DATA(n) vBIT(n,0,8) @@ -823,23 +823,23 @@ struct XENA_dev_config { /* memory controller registers */ u64 mc_int_status; -#define MC_INT_STATUS_MC_INT BIT(0) +#define MC_INT_STATUS_MC_INT s2BIT(0) u64 mc_int_mask; -#define MC_INT_MASK_MC_INT BIT(0) +#define MC_INT_MASK_MC_INT s2BIT(0) u64 mc_err_reg; -#define MC_ERR_REG_ECC_DB_ERR_L BIT(14) -#define MC_ERR_REG_ECC_DB_ERR_U BIT(15) -#define MC_ERR_REG_MIRI_ECC_DB_ERR_0 BIT(18) -#define MC_ERR_REG_MIRI_ECC_DB_ERR_1 BIT(20) -#define MC_ERR_REG_MIRI_CRI_ERR_0 BIT(22) -#define MC_ERR_REG_MIRI_CRI_ERR_1 BIT(23) -#define MC_ERR_REG_SM_ERR BIT(31) -#define MC_ERR_REG_ECC_ALL_SNG (BIT(2) | BIT(3) | BIT(4) | BIT(5) |\ - BIT(17) | BIT(19)) -#define MC_ERR_REG_ECC_ALL_DBL (BIT(10) | BIT(11) | BIT(12) |\ - BIT(13) | BIT(18) | BIT(20)) -#define PLL_LOCK_N BIT(39) +#define MC_ERR_REG_ECC_DB_ERR_L s2BIT(14) +#define MC_ERR_REG_ECC_DB_ERR_U s2BIT(15) +#define MC_ERR_REG_MIRI_ECC_DB_ERR_0 s2BIT(18) +#define MC_ERR_REG_MIRI_ECC_DB_ERR_1 s2BIT(20) +#define MC_ERR_REG_MIRI_CRI_ERR_0 s2BIT(22) +#define MC_ERR_REG_MIRI_CRI_ERR_1 s2BIT(23) +#define MC_ERR_REG_SM_ERR s2BIT(31) +#define MC_ERR_REG_ECC_ALL_SNG (s2BIT(2) | s2BIT(3) | s2BIT(4) | s2BIT(5) |\ + s2BIT(17) | s2BIT(19)) +#define MC_ERR_REG_ECC_ALL_DBL (s2BIT(10) | s2BIT(11) | s2BIT(12) |\ + s2BIT(13) | s2BIT(18) | s2BIT(20)) +#define PLL_LOCK_N s2BIT(39) u64 mc_err_mask; u64 mc_err_alarm; @@ -857,8 +857,8 @@ struct XENA_dev_config { #define RX_QUEUE_CFG_Q7_SZ(n) vBIT(n,56,8) u64 mc_rldram_mrs; -#define MC_RLDRAM_QUEUE_SIZE_ENABLE BIT(39) -#define MC_RLDRAM_MRS_ENABLE BIT(47) +#define MC_RLDRAM_QUEUE_SIZE_ENABLE s2BIT(39) +#define MC_RLDRAM_MRS_ENABLE s2BIT(47) u64 mc_rldram_interleave; @@ -871,11 +871,11 @@ struct XENA_dev_config { u64 mc_rldram_ref_per; u8 unused20[0x220 - 0x208]; u64 mc_rldram_test_ctrl; -#define MC_RLDRAM_TEST_MODE BIT(47) -#define MC_RLDRAM_TEST_WRITE BIT(7) -#define MC_RLDRAM_TEST_GO BIT(15) -#define MC_RLDRAM_TEST_DONE BIT(23) -#define MC_RLDRAM_TEST_PASS BIT(31) +#define MC_RLDRAM_TEST_MODE s2BIT(47) +#define MC_RLDRAM_TEST_WRITE s2BIT(7) +#define MC_RLDRAM_TEST_GO s2BIT(15) +#define MC_RLDRAM_TEST_DONE s2BIT(23) +#define MC_RLDRAM_TEST_PASS s2BIT(31) u8 unused21[0x240 - 0x228]; u64 mc_rldram_test_add; @@ -888,7 +888,7 @@ struct XENA_dev_config { u8 unused24_1[0x360 - 0x308]; u64 mc_rldram_ctrl; -#define MC_RLDRAM_ENABLE_ODT BIT(7) +#define MC_RLDRAM_ENABLE_ODT s2BIT(7) u8 unused24_2[0x640 - 0x368]; u64 mc_rldram_ref_per_herc; @@ -906,24 +906,24 @@ struct XENA_dev_config { /* XGXS control registers */ u64 xgxs_int_status; -#define XGXS_INT_STATUS_TXGXS BIT(0) -#define XGXS_INT_STATUS_RXGXS BIT(1) +#define XGXS_INT_STATUS_TXGXS s2BIT(0) +#define XGXS_INT_STATUS_RXGXS s2BIT(1) u64 xgxs_int_mask; -#define XGXS_INT_MASK_TXGXS BIT(0) -#define XGXS_INT_MASK_RXGXS BIT(1) +#define XGXS_INT_MASK_TXGXS s2BIT(0) +#define XGXS_INT_MASK_RXGXS s2BIT(1) u64 xgxs_txgxs_err_reg; -#define TXGXS_ECC_SG_ERR BIT(7) -#define TXGXS_ECC_DB_ERR BIT(15) -#define TXGXS_ESTORE_UFLOW BIT(31) -#define TXGXS_TX_SM_ERR BIT(39) +#define TXGXS_ECC_SG_ERR s2BIT(7) +#define TXGXS_ECC_DB_ERR s2BIT(15) +#define TXGXS_ESTORE_UFLOW s2BIT(31) +#define TXGXS_TX_SM_ERR s2BIT(39) u64 xgxs_txgxs_err_mask; u64 xgxs_txgxs_err_alarm; u64 xgxs_rxgxs_err_reg; -#define RXGXS_ESTORE_OFLOW BIT(7) -#define RXGXS_RX_SM_ERR BIT(39) +#define RXGXS_ESTORE_OFLOW s2BIT(7) +#define RXGXS_RX_SM_ERR s2BIT(39) u64 xgxs_rxgxs_err_mask; u64 xgxs_rxgxs_err_alarm; @@ -942,10 +942,10 @@ struct XENA_dev_config { #define SPI_CONTROL_BYTECNT(cnt) vBIT(cnt,29,3) #define SPI_CONTROL_CMD(cmd) vBIT(cmd,32,8) #define SPI_CONTROL_ADDR(addr) vBIT(addr,40,24) -#define SPI_CONTROL_SEL1 BIT(4) -#define SPI_CONTROL_REQ BIT(7) -#define SPI_CONTROL_NACK BIT(5) -#define SPI_CONTROL_DONE BIT(6) +#define SPI_CONTROL_SEL1 s2BIT(4) +#define SPI_CONTROL_REQ s2BIT(7) +#define SPI_CONTROL_NACK s2BIT(5) +#define SPI_CONTROL_DONE s2BIT(6) u64 spi_data; #define SPI_DATA_WRITE(data,len) vBIT(data,0,len) }; diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 22e4054d4fc..b8c0e7b4ca1 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -1716,7 +1716,7 @@ static int init_nic(struct s2io_nic *nic) MISC_LINK_STABILITY_PRD(3); writeq(val64, &bar0->misc_control); val64 = readq(&bar0->pic_control2); - val64 &= ~(BIT(13)|BIT(14)|BIT(15)); + val64 &= ~(s2BIT(13)|s2BIT(14)|s2BIT(15)); writeq(val64, &bar0->pic_control2); } if (strstr(nic->product_name, "CX4")) { @@ -2427,7 +2427,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) } if ((rxdp->Control_1 & RXD_OWN_XENA) && ((nic->rxd_mode == RXD_MODE_3B) && - (rxdp->Control_2 & BIT(0)))) { + (rxdp->Control_2 & s2BIT(0)))) { mac_control->rings[ring_no].rx_curr_put_info. offset = off; goto end; @@ -2540,7 +2540,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) rxdp->Control_2 |= SET_BUFFER2_SIZE_3 (dev->mtu + 4); } - rxdp->Control_2 |= BIT(0); + rxdp->Control_2 |= s2BIT(0); } rxdp->Host_Control = (unsigned long) (skb); if (alloc_tab & ((1 << rxsync_frequency) - 1)) @@ -3377,7 +3377,7 @@ static void s2io_reset(struct s2io_nic * sp) pci_write_config_dword(sp->pdev, 0x68, 0x7C); /* Clearing PCI_STATUS error reflected here */ - writeq(BIT(62), &bar0->txpic_int_reg); + writeq(s2BIT(62), &bar0->txpic_int_reg); } /* Reset device statistics maintained by OS */ @@ -3575,7 +3575,7 @@ static int wait_for_msix_trans(struct s2io_nic *nic, int i) do { val64 = readq(&bar0->xmsi_access); - if (!(val64 & BIT(15))) + if (!(val64 & s2BIT(15))) break; mdelay(1); cnt++; @@ -3597,7 +3597,7 @@ static void restore_xmsi_data(struct s2io_nic *nic) for (i=0; i < MAX_REQUESTED_MSI_X; i++) { writeq(nic->msix_info[i].addr, &bar0->xmsi_address); writeq(nic->msix_info[i].data, &bar0->xmsi_data); - val64 = (BIT(7) | BIT(15) | vBIT(i, 26, 6)); + val64 = (s2BIT(7) | s2BIT(15) | vBIT(i, 26, 6)); writeq(val64, &bar0->xmsi_access); if (wait_for_msix_trans(nic, i)) { DBG_PRINT(ERR_DBG, "failed in %s\n", __FUNCTION__); @@ -3614,7 +3614,7 @@ static void store_xmsi_data(struct s2io_nic *nic) /* Store and display */ for (i=0; i < MAX_REQUESTED_MSI_X; i++) { - val64 = (BIT(15) | vBIT(i, 26, 6)); + val64 = (s2BIT(15) | vBIT(i, 26, 6)); writeq(val64, &bar0->xmsi_access); if (wait_for_msix_trans(nic, i)) { DBG_PRINT(ERR_DBG, "failed in %s\n", __FUNCTION__); @@ -4634,7 +4634,7 @@ static void s2io_updt_stats(struct s2io_nic *sp) do { udelay(100); val64 = readq(&bar0->stat_cfg); - if (!(val64 & BIT(0))) + if (!(val64 & s2BIT(0))) break; cnt++; if (cnt == 5) diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index f6b45565304..cc1797a071a 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h @@ -14,7 +14,7 @@ #define _S2IO_H #define TBD 0 -#define BIT(loc) (0x8000000000000000ULL >> (loc)) +#define s2BIT(loc) (0x8000000000000000ULL >> (loc)) #define vBIT(val, loc, sz) (((u64)val) << (64-loc-sz)) #define INV(d) ((d&0xff)<<24) | (((d>>8)&0xff)<<16) | (((d>>16)&0xff)<<8)| ((d>>24)&0xff) @@ -473,42 +473,42 @@ struct TxFIFO_element { u64 List_Control; #define TX_FIFO_LAST_TXD_NUM( val) vBIT(val,0,8) -#define TX_FIFO_FIRST_LIST BIT(14) -#define TX_FIFO_LAST_LIST BIT(15) +#define TX_FIFO_FIRST_LIST s2BIT(14) +#define TX_FIFO_LAST_LIST s2BIT(15) #define TX_FIFO_FIRSTNLAST_LIST vBIT(3,14,2) -#define TX_FIFO_SPECIAL_FUNC BIT(23) -#define TX_FIFO_DS_NO_SNOOP BIT(31) -#define TX_FIFO_BUFF_NO_SNOOP BIT(30) +#define TX_FIFO_SPECIAL_FUNC s2BIT(23) +#define TX_FIFO_DS_NO_SNOOP s2BIT(31) +#define TX_FIFO_BUFF_NO_SNOOP s2BIT(30) }; /* Tx descriptor structure */ struct TxD { u64 Control_1; /* bit mask */ -#define TXD_LIST_OWN_XENA BIT(7) -#define TXD_T_CODE (BIT(12)|BIT(13)|BIT(14)|BIT(15)) +#define TXD_LIST_OWN_XENA s2BIT(7) +#define TXD_T_CODE (s2BIT(12)|s2BIT(13)|s2BIT(14)|s2BIT(15)) #define TXD_T_CODE_OK(val) (|(val & TXD_T_CODE)) #define GET_TXD_T_CODE(val) ((val & TXD_T_CODE)<<12) -#define TXD_GATHER_CODE (BIT(22) | BIT(23)) -#define TXD_GATHER_CODE_FIRST BIT(22) -#define TXD_GATHER_CODE_LAST BIT(23) -#define TXD_TCP_LSO_EN BIT(30) -#define TXD_UDP_COF_EN BIT(31) -#define TXD_UFO_EN BIT(31) | BIT(30) +#define TXD_GATHER_CODE (s2BIT(22) | s2BIT(23)) +#define TXD_GATHER_CODE_FIRST s2BIT(22) +#define TXD_GATHER_CODE_LAST s2BIT(23) +#define TXD_TCP_LSO_EN s2BIT(30) +#define TXD_UDP_COF_EN s2BIT(31) +#define TXD_UFO_EN s2BIT(31) | s2BIT(30) #define TXD_TCP_LSO_MSS(val) vBIT(val,34,14) #define TXD_UFO_MSS(val) vBIT(val,34,14) #define TXD_BUFFER0_SIZE(val) vBIT(val,48,16) u64 Control_2; -#define TXD_TX_CKO_CONTROL (BIT(5)|BIT(6)|BIT(7)) -#define TXD_TX_CKO_IPV4_EN BIT(5) -#define TXD_TX_CKO_TCP_EN BIT(6) -#define TXD_TX_CKO_UDP_EN BIT(7) -#define TXD_VLAN_ENABLE BIT(15) +#define TXD_TX_CKO_CONTROL (s2BIT(5)|s2BIT(6)|s2BIT(7)) +#define TXD_TX_CKO_IPV4_EN s2BIT(5) +#define TXD_TX_CKO_TCP_EN s2BIT(6) +#define TXD_TX_CKO_UDP_EN s2BIT(7) +#define TXD_VLAN_ENABLE s2BIT(15) #define TXD_VLAN_TAG(val) vBIT(val,16,16) #define TXD_INT_NUMBER(val) vBIT(val,34,6) -#define TXD_INT_TYPE_PER_LIST BIT(47) -#define TXD_INT_TYPE_UTILZ BIT(46) +#define TXD_INT_TYPE_PER_LIST s2BIT(47) +#define TXD_INT_TYPE_UTILZ s2BIT(46) #define TXD_SET_MARKER vBIT(0x6,0,4) u64 Buffer_Pointer; @@ -525,14 +525,14 @@ struct list_info_hold { struct RxD_t { u64 Host_Control; /* reserved for host */ u64 Control_1; -#define RXD_OWN_XENA BIT(7) -#define RXD_T_CODE (BIT(12)|BIT(13)|BIT(14)|BIT(15)) +#define RXD_OWN_XENA s2BIT(7) +#define RXD_T_CODE (s2BIT(12)|s2BIT(13)|s2BIT(14)|s2BIT(15)) #define RXD_FRAME_PROTO vBIT(0xFFFF,24,8) -#define RXD_FRAME_PROTO_IPV4 BIT(27) -#define RXD_FRAME_PROTO_IPV6 BIT(28) -#define RXD_FRAME_IP_FRAG BIT(29) -#define RXD_FRAME_PROTO_TCP BIT(30) -#define RXD_FRAME_PROTO_UDP BIT(31) +#define RXD_FRAME_PROTO_IPV4 s2BIT(27) +#define RXD_FRAME_PROTO_IPV6 s2BIT(28) +#define RXD_FRAME_IP_FRAG s2BIT(29) +#define RXD_FRAME_PROTO_TCP s2BIT(30) +#define RXD_FRAME_PROTO_UDP s2BIT(31) #define TCP_OR_UDP_FRAME (RXD_FRAME_PROTO_TCP | RXD_FRAME_PROTO_UDP) #define RXD_GET_L3_CKSUM(val) ((u16)(val>> 16) & 0xFFFF) #define RXD_GET_L4_CKSUM(val) ((u16)(val) & 0xFFFF) @@ -998,26 +998,26 @@ static inline void SPECIAL_REG_WRITE(u64 val, void __iomem *addr, int order) /* Interrupt masks for the general interrupt mask register */ #define DISABLE_ALL_INTRS 0xFFFFFFFFFFFFFFFFULL -#define TXPIC_INT_M BIT(0) -#define TXDMA_INT_M BIT(1) -#define TXMAC_INT_M BIT(2) -#define TXXGXS_INT_M BIT(3) -#define TXTRAFFIC_INT_M BIT(8) -#define PIC_RX_INT_M BIT(32) -#define RXDMA_INT_M BIT(33) -#define RXMAC_INT_M BIT(34) -#define MC_INT_M BIT(35) -#define RXXGXS_INT_M BIT(36) -#define RXTRAFFIC_INT_M BIT(40) +#define TXPIC_INT_M s2BIT(0) +#define TXDMA_INT_M s2BIT(1) +#define TXMAC_INT_M s2BIT(2) +#define TXXGXS_INT_M s2BIT(3) +#define TXTRAFFIC_INT_M s2BIT(8) +#define PIC_RX_INT_M s2BIT(32) +#define RXDMA_INT_M s2BIT(33) +#define RXMAC_INT_M s2BIT(34) +#define MC_INT_M s2BIT(35) +#define RXXGXS_INT_M s2BIT(36) +#define RXTRAFFIC_INT_M s2BIT(40) /* PIC level Interrupts TODO*/ /* DMA level Inressupts */ -#define TXDMA_PFC_INT_M BIT(0) -#define TXDMA_PCC_INT_M BIT(2) +#define TXDMA_PFC_INT_M s2BIT(0) +#define TXDMA_PCC_INT_M s2BIT(2) /* PFC block interrupts */ -#define PFC_MISC_ERR_1 BIT(0) /* Interrupt to indicate FIFO full */ +#define PFC_MISC_ERR_1 s2BIT(0) /* Interrupt to indicate FIFO full */ /* PCC block interrupts. */ #define PCC_FB_ECC_ERR vBIT(0xff, 16, 8) /* Interrupt to indicate diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index fab055ffcc9..571060a3c91 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c @@ -46,7 +46,7 @@ #include <linux/vmalloc.h> #include <linux/wait.h> #include <linux/workqueue.h> -#include <asm/bitops.h> +#include <linux/bitops.h> #include <asm/pci-bridge.h> #include <net/checksum.h> diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index 76e55612430..a7afeea156b 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c @@ -34,9 +34,9 @@ #include <linux/delay.h> #include <linux/spinlock.h> #include <linux/dma-mapping.h> +#include <linux/bitops.h> #include <asm/processor.h> -#include <asm/bitops.h> #include <asm/io.h> #include <asm/dma.h> #include <asm/uaccess.h> diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_leds.c b/drivers/net/wireless/bcm43xx/bcm43xx_leds.c index 8f198befba3..cb51dc51cce 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_leds.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_leds.c @@ -29,7 +29,7 @@ #include "bcm43xx_radio.h" #include "bcm43xx.h" -#include <asm/bitops.h> +#include <linux/bitops.h> static void bcm43xx_led_changestate(struct bcm43xx_led *led) diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h index ceb7f1e5e9e..517f8984514 100644 --- a/drivers/net/wireless/hostap/hostap_common.h +++ b/drivers/net/wireless/hostap/hostap_common.h @@ -4,9 +4,6 @@ #include <linux/types.h> #include <linux/if_ether.h> -#define BIT(x) (1 << (x)) - - /* IEEE 802.11 defines */ /* Information Element IDs */ diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 40f516d42c5..d8f5efcfcab 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c @@ -2920,7 +2920,7 @@ static int prism2_ioctl_priv_monitor(struct net_device *dev, int *i) printk(KERN_DEBUG "%s: process %d (%s) used deprecated iwpriv monitor " "- update software to use iwconfig mode monitor\n", - dev->name, current->pid, current->comm); + dev->name, task_pid_nr(current), current->comm); /* Backward compatibility code - this can be removed at some point */ diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c index 67d28ee80f2..c5e0d89c3ec 100644 --- a/drivers/pcmcia/m32r_pcc.c +++ b/drivers/pcmcia/m32r_pcc.c @@ -22,9 +22,9 @@ #include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/platform_device.h> +#include <linux/bitops.h> #include <asm/irq.h> #include <asm/io.h> -#include <asm/bitops.h> #include <asm/system.h> #include <asm/addrspace.h> diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index b0198549846..d182760f035 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c @@ -48,9 +48,9 @@ #include <linux/delay.h> #include <linux/interrupt.h> #include <linux/fsl_devices.h> +#include <linux/bitops.h> #include <asm/io.h> -#include <asm/bitops.h> #include <asm/system.h> #include <asm/time.h> #include <asm/mpc8xx.h> diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index 397f4ce849d..87b3493d88e 100644 --- a/drivers/ps3/ps3av.c +++ b/drivers/ps3/ps3av.c @@ -729,7 +729,7 @@ static void ps3av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info * static const struct ps3av_monitor_quirk { const char *monitor_name; - u32 clear_60, clear_50, clear_vesa; + u32 clear_60; } ps3av_monitor_quirks[] = { { .monitor_name = "DELL 2007WFP", @@ -757,10 +757,6 @@ static void ps3av_fixup_monitor_info(struct ps3av_info_monitor *info) quirk->monitor_name); info->res_60.res_bits &= ~quirk->clear_60; info->res_60.native &= ~quirk->clear_60; - info->res_50.res_bits &= ~quirk->clear_50; - info->res_50.native &= ~quirk->clear_50; - info->res_vesa.res_bits &= ~quirk->clear_vesa; - info->res_vesa.native &= ~quirk->clear_vesa; break; } } diff --git a/drivers/ps3/vuart.c b/drivers/ps3/vuart.c index bea25a1391e..9dea585ef80 100644 --- a/drivers/ps3/vuart.c +++ b/drivers/ps3/vuart.c @@ -22,11 +22,11 @@ #include <linux/module.h> #include <linux/interrupt.h> #include <linux/workqueue.h> +#include <linux/bitops.h> #include <asm/ps3.h> #include <asm/firmware.h> #include <asm/lv1call.h> -#include <asm/bitops.h> #include "vuart.h" diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index e4bf68ca96f..2fd49edcc71 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -21,11 +21,11 @@ #include <linux/interrupt.h> #include <linux/string.h> #include <linux/pm.h> +#include <linux/bitops.h> #include <linux/amba/bus.h> #include <asm/io.h> -#include <asm/bitops.h> #include <asm/hardware.h> #include <asm/irq.h> #include <asm/rtc.h> diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index 0918b787c4d..6f1e9a9804b 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c @@ -29,8 +29,8 @@ #include <linux/interrupt.h> #include <linux/string.h> #include <linux/pm.h> +#include <linux/bitops.h> -#include <asm/bitops.h> #include <asm/hardware.h> #include <asm/irq.h> #include <asm/rtc.h> diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c index 16ea828e99f..ef7bc0a125e 100644 --- a/drivers/s390/cio/idset.c +++ b/drivers/s390/cio/idset.c @@ -6,7 +6,7 @@ */ #include <linux/slab.h> -#include <asm/bitops.h> +#include <linux/bitops.h> #include "idset.h" #include "css.h" diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index 399695f7b1a..3561982749e 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -59,13 +59,13 @@ * 1.15 Changed for 2.6 Kernel No longer compiles on 2.4 or lower * 1.25 Added Packing support */ -#include <asm/bitops.h> #include <asm/ccwdev.h> #include <asm/ccwgroup.h> #include <asm/debug.h> #include <asm/idals.h> #include <asm/io.h> +#include <linux/bitops.h> #include <linux/ctype.h> #include <linux/delay.h> #include <linux/errno.h> diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c index a7f916c0c9c..1c9078191d9 100644 --- a/drivers/scsi/FlashPoint.c +++ b/drivers/scsi/FlashPoint.c @@ -25,9 +25,6 @@ #define FAILURE 0xFFFFFFFFL -#define BIT(x) ((unsigned char)(1<<(x))) /* single-bit mask in bit position x */ -#define BITW(x) ((unsigned short)(1<<(x))) /* single-bit mask in bit position x */ - struct sccb; typedef void (*CALL_BK_FN) (struct sccb *); @@ -374,9 +371,9 @@ typedef struct SCCBscam_info { #define SCAM_ENABLED BIT(2) #define SCAM_LEVEL2 BIT(3) -#define RENEGO_ENA BITW(10) -#define CONNIO_ENA BITW(11) -#define GREEN_PC_ENA BITW(12) +#define RENEGO_ENA BIT(10) +#define CONNIO_ENA BIT(11) +#define GREEN_PC_ENA BIT(12) #define AUTO_RATE_00 00 #define AUTO_RATE_05 01 @@ -511,23 +508,23 @@ typedef struct SCCBscam_info { #define hp_intena 0x40 -#define RESET BITW(7) -#define PROG_HLT BITW(6) -#define PARITY BITW(5) -#define FIFO BITW(4) -#define SEL BITW(3) -#define SCAM_SEL BITW(2) -#define RSEL BITW(1) -#define TIMEOUT BITW(0) -#define BUS_FREE BITW(15) -#define XFER_CNT_0 BITW(14) -#define PHASE BITW(13) -#define IUNKWN BITW(12) -#define ICMD_COMP BITW(11) -#define ITICKLE BITW(10) -#define IDO_STRT BITW(9) -#define ITAR_DISC BITW(8) -#define AUTO_INT (BITW(12)+BITW(11)+BITW(10)+BITW(9)+BITW(8)) +#define RESET BIT(7) +#define PROG_HLT BIT(6) +#define PARITY BIT(5) +#define FIFO BIT(4) +#define SEL BIT(3) +#define SCAM_SEL BIT(2) +#define RSEL BIT(1) +#define TIMEOUT BIT(0) +#define BUS_FREE BIT(15) +#define XFER_CNT_0 BIT(14) +#define PHASE BIT(13) +#define IUNKWN BIT(12) +#define ICMD_COMP BIT(11) +#define ITICKLE BIT(10) +#define IDO_STRT BIT(9) +#define ITAR_DISC BIT(8) +#define AUTO_INT (BIT(12)+BIT(11)+BIT(10)+BIT(9)+BIT(8)) #define CLR_ALL_INT 0xFFFF #define CLR_ALL_INT_1 0xFF00 @@ -674,37 +671,37 @@ typedef struct SCCBscam_info { #define BIOS_DATA_OFFSET 0x60 #define BIOS_RELATIVE_CARD 0x64 -#define AR3 (BITW(9) + BITW(8)) -#define SDATA BITW(10) +#define AR3 (BIT(9) + BIT(8)) +#define SDATA BIT(10) -#define CRD_OP BITW(11) /* Cmp Reg. w/ Data */ +#define CRD_OP BIT(11) /* Cmp Reg. w/ Data */ -#define CRR_OP BITW(12) /* Cmp Reg. w. Reg. */ +#define CRR_OP BIT(12) /* Cmp Reg. w. Reg. */ -#define CPE_OP (BITW(14)+BITW(11)) /* Cmp SCSI phs & Branch EQ */ +#define CPE_OP (BIT(14)+BIT(11)) /* Cmp SCSI phs & Branch EQ */ -#define CPN_OP (BITW(14)+BITW(12)) /* Cmp SCSI phs & Branch NOT EQ */ +#define CPN_OP (BIT(14)+BIT(12)) /* Cmp SCSI phs & Branch NOT EQ */ #define ADATA_OUT 0x00 -#define ADATA_IN BITW(8) -#define ACOMMAND BITW(10) -#define ASTATUS (BITW(10)+BITW(8)) -#define AMSG_OUT (BITW(10)+BITW(9)) -#define AMSG_IN (BITW(10)+BITW(9)+BITW(8)) +#define ADATA_IN BIT(8) +#define ACOMMAND BIT(10) +#define ASTATUS (BIT(10)+BIT(8)) +#define AMSG_OUT (BIT(10)+BIT(9)) +#define AMSG_IN (BIT(10)+BIT(9)+BIT(8)) -#define BRH_OP BITW(13) /* Branch */ +#define BRH_OP BIT(13) /* Branch */ #define ALWAYS 0x00 -#define EQUAL BITW(8) -#define NOT_EQ BITW(9) +#define EQUAL BIT(8) +#define NOT_EQ BIT(9) -#define TCB_OP (BITW(13)+BITW(11)) /* Test condition & branch */ +#define TCB_OP (BIT(13)+BIT(11)) /* Test condition & branch */ -#define FIFO_0 BITW(10) +#define FIFO_0 BIT(10) -#define MPM_OP BITW(15) /* Match phase and move data */ +#define MPM_OP BIT(15) /* Match phase and move data */ -#define MRR_OP BITW(14) /* Move DReg. to Reg. */ +#define MRR_OP BIT(14) /* Move DReg. to Reg. */ #define S_IDREG (BIT(2)+BIT(1)+BIT(0)) @@ -712,9 +709,9 @@ typedef struct SCCBscam_info { #define D_AR1 BIT(0) #define D_BUCKET (BIT(2) + BIT(1) + BIT(0)) -#define RAT_OP (BITW(14)+BITW(13)+BITW(11)) +#define RAT_OP (BIT(14)+BIT(13)+BIT(11)) -#define SSI_OP (BITW(15)+BITW(11)) +#define SSI_OP (BIT(15)+BIT(11)) #define SSI_ITAR_DISC (ITAR_DISC >> 8) #define SSI_IDO_STRT (IDO_STRT >> 8) diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 30905cebefb..a5763c6e936 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -521,7 +521,7 @@ config SCSI_DPT_I2O config SCSI_ADVANSYS tristate "AdvanSys SCSI support" - depends on SCSI + depends on SCSI && VIRT_TO_BUS depends on ISA || EISA || PCI help This is a driver for all SCSI host adapters manufactured by diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index fa7ba64483f..252d1806467 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -47,9 +47,9 @@ #include <linux/scatterlist.h> #include <linux/delay.h> #include <linux/mutex.h> +#include <linux/bitops.h> #include <asm/io.h> -#include <asm/bitops.h> #include <asm/uaccess.h> #include <scsi/scsi.h> diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 7ef0afc3cd6..5f3a0d7b18d 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -285,7 +285,7 @@ static void sas_discover_domain(struct work_struct *work) dev = port->port_dev; SAS_DPRINTK("DOING DISCOVERY on port %d, pid:%d\n", port->id, - current->pid); + task_pid_nr(current)); switch (dev->dev_type) { case SAS_END_DEV: @@ -320,7 +320,7 @@ static void sas_discover_domain(struct work_struct *work) } SAS_DPRINTK("DONE DISCOVERY on port %d, pid:%d, result:%d\n", port->id, - current->pid, error); + task_pid_nr(current), error); } static void sas_revalidate_domain(struct work_struct *work) @@ -334,12 +334,12 @@ static void sas_revalidate_domain(struct work_struct *work) &port->disc.pending); SAS_DPRINTK("REVALIDATING DOMAIN on port %d, pid:%d\n", port->id, - current->pid); + task_pid_nr(current)); if (port->port_dev) res = sas_ex_revalidate_domain(port->port_dev); SAS_DPRINTK("done REVALIDATING DOMAIN on port %d, pid:%d, res 0x%x\n", - port->id, current->pid, res); + port->id, task_pid_nr(current), res); } /* ---------- Events ---------- */ diff --git a/drivers/scsi/nsp32.h b/drivers/scsi/nsp32.h index a976e8193d1..6715ecb3bfc 100644 --- a/drivers/scsi/nsp32.h +++ b/drivers/scsi/nsp32.h @@ -69,11 +69,6 @@ typedef u32 u32_le; typedef u16 u16_le; /* - * MACRO - */ -#define BIT(x) (1UL << (x)) - -/* * BASIC Definitions */ #ifndef TRUE diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index b7f0fa24641..98397559c53 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h @@ -24,7 +24,6 @@ /************************************ * Some useful macros... */ -#define BIT(x) (1L << (x)) /* SCSI initiator must be ID 7 */ #define NSP_INITIATOR_ID 7 diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/drivers/scsi/qla4xxx/ql4_fw.h index 9bb3d1d2a92..fe415ec8565 100644 --- a/drivers/scsi/qla4xxx/ql4_fw.h +++ b/drivers/scsi/qla4xxx/ql4_fw.h @@ -671,7 +671,7 @@ struct continuation_t1_entry { #define ET_CONTINUE ET_CONT_T1 /* Marker entry structure*/ -struct marker_entry { +struct qla4_marker_entry { struct qla4_header hdr; /* 00-03 */ uint32_t system_defined; /* 04-07 */ diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c index 5006ecb3ef5..e4461b5d767 100644 --- a/drivers/scsi/qla4xxx/ql4_iocb.c +++ b/drivers/scsi/qla4xxx/ql4_iocb.c @@ -69,7 +69,7 @@ static int qla4xxx_get_req_pkt(struct scsi_qla_host *ha, static int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha, struct ddb_entry *ddb_entry, int lun) { - struct marker_entry *marker_entry; + struct qla4_marker_entry *marker_entry; unsigned long flags = 0; uint8_t status = QLA_SUCCESS; diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 72229df9dc1..40604a09292 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -263,15 +263,15 @@ static unsigned int pl01x_get_mctrl(struct uart_port *port) unsigned int result = 0; unsigned int status = readw(uap->port.membase + UART01x_FR); -#define BIT(uartbit, tiocmbit) \ +#define TIOCMBIT(uartbit, tiocmbit) \ if (status & uartbit) \ result |= tiocmbit - BIT(UART01x_FR_DCD, TIOCM_CAR); - BIT(UART01x_FR_DSR, TIOCM_DSR); - BIT(UART01x_FR_CTS, TIOCM_CTS); - BIT(UART011_FR_RI, TIOCM_RNG); -#undef BIT + TIOCMBIT(UART01x_FR_DCD, TIOCM_CAR); + TIOCMBIT(UART01x_FR_DSR, TIOCM_DSR); + TIOCMBIT(UART01x_FR_CTS, TIOCM_CTS); + TIOCMBIT(UART011_FR_RI, TIOCM_RNG); +#undef TIOCMBIT return result; } @@ -282,18 +282,18 @@ static void pl011_set_mctrl(struct uart_port *port, unsigned int mctrl) cr = readw(uap->port.membase + UART011_CR); -#define BIT(tiocmbit, uartbit) \ +#define TIOCMBIT(tiocmbit, uartbit) \ if (mctrl & tiocmbit) \ cr |= uartbit; \ else \ cr &= ~uartbit - BIT(TIOCM_RTS, UART011_CR_RTS); - BIT(TIOCM_DTR, UART011_CR_DTR); - BIT(TIOCM_OUT1, UART011_CR_OUT1); - BIT(TIOCM_OUT2, UART011_CR_OUT2); - BIT(TIOCM_LOOP, UART011_CR_LBE); -#undef BIT + TIOCMBIT(TIOCM_RTS, UART011_CR_RTS); + TIOCMBIT(TIOCM_DTR, UART011_CR_DTR); + TIOCMBIT(TIOCM_OUT1, UART011_CR_OUT1); + TIOCMBIT(TIOCM_OUT2, UART011_CR_OUT2); + TIOCMBIT(TIOCM_LOOP, UART011_CR_LBE); +#undef TIOCMBIT writew(cr, uap->port.membase + UART011_CR); } diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index 7e8724d3571..f523cdf4b02 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c @@ -442,11 +442,11 @@ static char *serial_version = "$Revision: 1.25 $"; #include <asm/uaccess.h> #include <linux/kernel.h> #include <linux/mutex.h> +#include <linux/bitops.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/system.h> -#include <asm/bitops.h> #include <linux/delay.h> #include <asm/arch/svinto.h> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index f013b4012c9..1f4f6d02fe2 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -460,7 +460,7 @@ static int checkintf(struct dev_state *ps, unsigned int ifnum) return 0; /* if not yet claimed, claim it for the driver */ dev_warn(&ps->dev->dev, "usbfs: process %d (%s) did not claim interface %u before use\n", - current->pid, current->comm, ifnum); + task_pid_nr(current), current->comm, ifnum); return claimintf(ps, ifnum); } diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 73726c570a6..1d174dcb3ac 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -4006,7 +4006,7 @@ static int __init fsg_bind(struct usb_gadget *gadget) DBG(fsg, "removable=%d, stall=%d, buflen=%u\n", mod_data.removable, mod_data.can_stall, mod_data.buflen); - DBG(fsg, "I/O thread pid: %d\n", fsg->thread_task->pid); + DBG(fsg, "I/O thread pid: %d\n", task_pid_nr(fsg->thread_task)); set_bit(REGISTERED, &fsg->atomic_bitflags); diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 9bb2cbfe4a3..5fb8675e0d6 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c @@ -62,7 +62,7 @@ struct cfb_info { struct display_switch *dispsw; struct display *display; struct pci_dev *dev; - unsigned char __iomem *region; + unsigned char __iomem *region; unsigned char __iomem *regs; u_int id; int func_use_count; @@ -97,11 +97,11 @@ MODULE_PARM_DESC(default_font, "Default font name"); /* * Our access methods. */ -#define cyber2000fb_writel(val,reg,cfb) writel(val, (cfb)->regs + (reg)) -#define cyber2000fb_writew(val,reg,cfb) writew(val, (cfb)->regs + (reg)) -#define cyber2000fb_writeb(val,reg,cfb) writeb(val, (cfb)->regs + (reg)) +#define cyber2000fb_writel(val, reg, cfb) writel(val, (cfb)->regs + (reg)) +#define cyber2000fb_writew(val, reg, cfb) writew(val, (cfb)->regs + (reg)) +#define cyber2000fb_writeb(val, reg, cfb) writeb(val, (cfb)->regs + (reg)) -#define cyber2000fb_readb(reg,cfb) readb((cfb)->regs + (reg)) +#define cyber2000fb_readb(reg, cfb) readb((cfb)->regs + (reg)) static inline void cyber2000_crtcw(unsigned int reg, unsigned int val, struct cfb_info *cfb) @@ -221,12 +221,8 @@ cyber2000fb_copyarea(struct fb_info *info, const struct fb_copyarea *region) static void cyber2000fb_imageblit(struct fb_info *info, const struct fb_image *image) { -// struct cfb_info *cfb = (struct cfb_info *)info; - -// if (!(cfb->fb.var.accel_flags & FB_ACCELF_TEXT)) { - cfb_imageblit(info, image); - return; -// } + cfb_imageblit(info, image); + return; } static int cyber2000fb_sync(struct fb_info *info) @@ -277,12 +273,12 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, /* * Pseudocolour: - * 8 8 + * 8 8 * pixel --/--+--/--> red lut --> red dac - * | 8 - * +--/--> green lut --> green dac - * | 8 - * +--/--> blue lut --> blue dac + * | 8 + * +--/--> green lut --> green dac + * | 8 + * +--/--> blue lut --> blue dac */ case FB_VISUAL_PSEUDOCOLOR: if (regno >= NR_PALETTE) @@ -292,9 +288,9 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, green >>= 8; blue >>= 8; - cfb->palette[regno].red = red; + cfb->palette[regno].red = red; cfb->palette[regno].green = green; - cfb->palette[regno].blue = blue; + cfb->palette[regno].blue = blue; cyber2000fb_writeb(regno, 0x3c8, cfb); cyber2000fb_writeb(red, 0x3c9, cfb); @@ -304,12 +300,12 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, /* * Direct colour: - * n rl - * pixel --/--+--/--> red lut --> red dac - * | gl - * +--/--> green lut --> green dac - * | bl - * +--/--> blue lut --> blue dac + * n rl + * pixel --/--+--/--> red lut --> red dac + * | gl + * +--/--> green lut --> green dac + * | bl + * +--/--> blue lut --> blue dac * n = bpp, rl = red length, gl = green length, bl = blue length */ case FB_VISUAL_DIRECTCOLOR: @@ -325,9 +321,11 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, * to the high 6 bits of the LUT. */ cyber2000fb_writeb(regno << 2, 0x3c8, cfb); - cyber2000fb_writeb(cfb->palette[regno >> 1].red, 0x3c9, cfb); + cyber2000fb_writeb(cfb->palette[regno >> 1].red, + 0x3c9, cfb); cyber2000fb_writeb(green, 0x3c9, cfb); - cyber2000fb_writeb(cfb->palette[regno >> 1].blue, 0x3c9, cfb); + cyber2000fb_writeb(cfb->palette[regno >> 1].blue, + 0x3c9, cfb); green = cfb->palette[regno << 3].green; @@ -335,9 +333,9 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, } if (var->green.length >= 5 && regno < 32) { - cfb->palette[regno << 3].red = red; + cfb->palette[regno << 3].red = red; cfb->palette[regno << 3].green = green; - cfb->palette[regno << 3].blue = blue; + cfb->palette[regno << 3].blue = blue; /* * The 5 bits of each colour component are @@ -351,9 +349,9 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, } if (var->green.length == 4 && regno < 16) { - cfb->palette[regno << 4].red = red; + cfb->palette[regno << 4].red = red; cfb->palette[regno << 4].green = green; - cfb->palette[regno << 4].blue = blue; + cfb->palette[regno << 4].blue = blue; /* * The 5 bits of each colour component are @@ -377,12 +375,12 @@ cyber2000fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, /* * True colour: - * n rl - * pixel --/--+--/--> red dac - * | gl - * +--/--> green dac - * | bl - * +--/--> blue dac + * n rl + * pixel --/--+--/--> red dac + * | gl + * +--/--> green dac + * | bl + * +--/--> blue dac * n = bpp, rl = red length, gl = green length, bl = blue length */ case FB_VISUAL_TRUECOLOR: @@ -494,9 +492,9 @@ static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw) /* PLL registers */ cyber2000_grphw(EXT_DCLK_MULT, hw->clock_mult, cfb); - cyber2000_grphw(EXT_DCLK_DIV, hw->clock_div, cfb); + cyber2000_grphw(EXT_DCLK_DIV, hw->clock_div, cfb); cyber2000_grphw(EXT_MCLK_MULT, cfb->mclk_mult, cfb); - cyber2000_grphw(EXT_MCLK_DIV, cfb->mclk_div, cfb); + cyber2000_grphw(EXT_MCLK_DIV, cfb->mclk_div, cfb); cyber2000_grphw(0x90, 0x01, cfb); cyber2000_grphw(0xb9, 0x80, cfb); cyber2000_grphw(0xb9, 0x00, cfb); @@ -515,8 +513,8 @@ static void cyber2000fb_set_timing(struct cfb_info *cfb, struct par_info *hw) /* * Set up accelerator registers */ - cyber2000fb_writew(hw->width, CO_REG_SRC_WIDTH, cfb); - cyber2000fb_writew(hw->width, CO_REG_DEST_WIDTH, cfb); + cyber2000fb_writew(hw->width, CO_REG_SRC_WIDTH, cfb); + cyber2000fb_writew(hw->width, CO_REG_DEST_WIDTH, cfb); cyber2000fb_writeb(hw->co_pixfmt, CO_REG_PIXFMT, cfb); } @@ -549,15 +547,15 @@ cyber2000fb_decode_crtc(struct par_info *hw, struct cfb_info *cfb, { u_int Htotal, Hblankend, Hsyncend; u_int Vtotal, Vdispend, Vblankstart, Vblankend, Vsyncstart, Vsyncend; -#define BIT(v,b1,m,b2) (((v >> b1) & m) << b2) +#define ENCODE_BIT(v, b1, m, b2) ((((v) >> (b1)) & (m)) << (b2)) hw->crtc[13] = hw->pitch; hw->crtc[17] = 0xe3; hw->crtc[14] = 0; hw->crtc[8] = 0; - Htotal = var->xres + var->right_margin + - var->hsync_len + var->left_margin; + Htotal = var->xres + var->right_margin + + var->hsync_len + var->left_margin; if (Htotal > 2080) return -EINVAL; @@ -567,15 +565,15 @@ cyber2000fb_decode_crtc(struct par_info *hw, struct cfb_info *cfb, hw->crtc[2] = var->xres >> 3; hw->crtc[4] = (var->xres + var->right_margin) >> 3; - Hblankend = (Htotal - 4*8) >> 3; + Hblankend = (Htotal - 4 * 8) >> 3; - hw->crtc[3] = BIT(Hblankend, 0, 0x1f, 0) | - BIT(1, 0, 0x01, 7); + hw->crtc[3] = ENCODE_BIT(Hblankend, 0, 0x1f, 0) | + ENCODE_BIT(1, 0, 0x01, 7); Hsyncend = (var->xres + var->right_margin + var->hsync_len) >> 3; - hw->crtc[5] = BIT(Hsyncend, 0, 0x1f, 0) | - BIT(Hblankend, 5, 0x01, 7); + hw->crtc[5] = ENCODE_BIT(Hsyncend, 0, 0x1f, 0) | + ENCODE_BIT(Hblankend, 5, 0x01, 7); Vdispend = var->yres - 1; Vsyncstart = var->yres + var->lower_margin; @@ -590,20 +588,20 @@ cyber2000fb_decode_crtc(struct par_info *hw, struct cfb_info *cfb, Vblankend = Vtotal - 10; hw->crtc[6] = Vtotal; - hw->crtc[7] = BIT(Vtotal, 8, 0x01, 0) | - BIT(Vdispend, 8, 0x01, 1) | - BIT(Vsyncstart, 8, 0x01, 2) | - BIT(Vblankstart,8, 0x01, 3) | - BIT(1, 0, 0x01, 4) | - BIT(Vtotal, 9, 0x01, 5) | - BIT(Vdispend, 9, 0x01, 6) | - BIT(Vsyncstart, 9, 0x01, 7); - hw->crtc[9] = BIT(0, 0, 0x1f, 0) | - BIT(Vblankstart,9, 0x01, 5) | - BIT(1, 0, 0x01, 6); + hw->crtc[7] = ENCODE_BIT(Vtotal, 8, 0x01, 0) | + ENCODE_BIT(Vdispend, 8, 0x01, 1) | + ENCODE_BIT(Vsyncstart, 8, 0x01, 2) | + ENCODE_BIT(Vblankstart, 8, 0x01, 3) | + ENCODE_BIT(1, 0, 0x01, 4) | + ENCODE_BIT(Vtotal, 9, 0x01, 5) | + ENCODE_BIT(Vdispend, 9, 0x01, 6) | + ENCODE_BIT(Vsyncstart, 9, 0x01, 7); + hw->crtc[9] = ENCODE_BIT(0, 0, 0x1f, 0) | + ENCODE_BIT(Vblankstart, 9, 0x01, 5) | + ENCODE_BIT(1, 0, 0x01, 6); hw->crtc[10] = Vsyncstart; - hw->crtc[11] = BIT(Vsyncend, 0, 0x0f, 0) | - BIT(1, 0, 0x01, 7); + hw->crtc[11] = ENCODE_BIT(Vsyncend, 0, 0x0f, 0) | + ENCODE_BIT(1, 0, 0x01, 7); hw->crtc[12] = Vdispend; hw->crtc[15] = Vblankstart; hw->crtc[16] = Vblankend; @@ -615,10 +613,10 @@ cyber2000fb_decode_crtc(struct par_info *hw, struct cfb_info *cfb, * 4=LINECOMP:10 5-IVIDEO 6=FIXCNT */ hw->crtc_ofl = - BIT(Vtotal, 10, 0x01, 0) | - BIT(Vdispend, 10, 0x01, 1) | - BIT(Vsyncstart, 10, 0x01, 2) | - BIT(Vblankstart,10, 0x01, 3) | + ENCODE_BIT(Vtotal, 10, 0x01, 0) | + ENCODE_BIT(Vdispend, 10, 0x01, 1) | + ENCODE_BIT(Vsyncstart, 10, 0x01, 2) | + ENCODE_BIT(Vblankstart, 10, 0x01, 3) | EXT_CRT_VRTOFL_LINECOMP10; /* woody: set the interlaced bit... */ @@ -750,11 +748,11 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) var->red.msb_right = 0; var->green.msb_right = 0; var->blue.msb_right = 0; + var->transp.offset = 0; + var->transp.length = 0; switch (var->bits_per_pixel) { case 8: /* PSEUDOCOLOUR, 256 */ - var->transp.offset = 0; - var->transp.length = 0; var->red.offset = 0; var->red.length = 8; var->green.offset = 0; @@ -766,8 +764,6 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) case 16:/* DIRECTCOLOUR, 64k or 32k */ switch (var->green.length) { case 6: /* RGB565, 64k */ - var->transp.offset = 0; - var->transp.length = 0; var->red.offset = 11; var->red.length = 5; var->green.offset = 5; @@ -778,8 +774,6 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) default: case 5: /* RGB555, 32k */ - var->transp.offset = 0; - var->transp.length = 0; var->red.offset = 10; var->red.length = 5; var->green.offset = 5; @@ -802,8 +796,6 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) break; case 24:/* TRUECOLOUR, 16m */ - var->transp.offset = 0; - var->transp.length = 0; var->red.offset = 16; var->red.length = 8; var->green.offset = 8; @@ -830,7 +822,7 @@ cyber2000fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) mem = var->xres_virtual * var->yres_virtual * (var->bits_per_pixel / 8); if (mem > cfb->fb.fix.smem_len) var->yres_virtual = cfb->fb.fix.smem_len * 8 / - (var->bits_per_pixel * var->xres_virtual); + (var->bits_per_pixel * var->xres_virtual); if (var->yres > var->yres_virtual) var->yres = var->yres_virtual; @@ -921,7 +913,7 @@ static int cyber2000fb_set_par(struct fb_info *info) hw.fetch <<= 1; hw.fetch += 1; - cfb->fb.fix.line_length = var->xres_virtual * var->bits_per_pixel / 8; + cfb->fb.fix.line_length = var->xres_virtual * var->bits_per_pixel / 8; /* * Same here - if the size of the video mode exceeds the @@ -952,7 +944,6 @@ static int cyber2000fb_set_par(struct fb_info *info) return 0; } - /* * Pan or Wrap the Display */ @@ -1002,15 +993,15 @@ static int cyber2000fb_blank(int blank, struct fb_info *info) switch (blank) { case FB_BLANK_POWERDOWN: /* powerdown - both sync lines down */ sync = EXT_SYNC_CTL_VS_0 | EXT_SYNC_CTL_HS_0; - break; + break; case FB_BLANK_HSYNC_SUSPEND: /* hsync off */ sync = EXT_SYNC_CTL_VS_NORMAL | EXT_SYNC_CTL_HS_0; - break; + break; case FB_BLANK_VSYNC_SUSPEND: /* vsync off */ sync = EXT_SYNC_CTL_VS_0 | EXT_SYNC_CTL_HS_NORMAL; break; - case FB_BLANK_NORMAL: /* soft blank */ - default: /* unblank */ + case FB_BLANK_NORMAL: /* soft blank */ + default: /* unblank */ break; } @@ -1018,7 +1009,8 @@ static int cyber2000fb_blank(int blank, struct fb_info *info) if (blank <= 1) { /* turn on ramdacs */ - cfb->ramdac_powerdown &= ~(RAMDAC_DACPWRDN | RAMDAC_BYPASS | RAMDAC_RAMPWRDN); + cfb->ramdac_powerdown &= ~(RAMDAC_DACPWRDN | RAMDAC_BYPASS | + RAMDAC_RAMPWRDN); cyber2000fb_write_ramdac_ctrl(cfb); } @@ -1043,7 +1035,8 @@ static int cyber2000fb_blank(int blank, struct fb_info *info) if (blank >= 2) { /* turn off ramdacs */ - cfb->ramdac_powerdown |= RAMDAC_DACPWRDN | RAMDAC_BYPASS | RAMDAC_RAMPWRDN; + cfb->ramdac_powerdown |= RAMDAC_DACPWRDN | RAMDAC_BYPASS | + RAMDAC_RAMPWRDN; cyber2000fb_write_ramdac_ctrl(cfb); } @@ -1068,7 +1061,7 @@ static struct fb_ops cyber2000fb_ops = { * of this driver. It is here solely at the moment to support the other * CyberPro modules external to this driver. */ -static struct cfb_info *int_cfb_info; +static struct cfb_info *int_cfb_info; /* * Enable access to the extended registers @@ -1085,6 +1078,7 @@ void cyber2000fb_enable_extregs(struct cfb_info *cfb) cyber2000_grphw(EXT_FUNC_CTL, old, cfb); } } +EXPORT_SYMBOL(cyber2000fb_enable_extregs); /* * Disable access to the extended registers @@ -1104,11 +1098,13 @@ void cyber2000fb_disable_extregs(struct cfb_info *cfb) else cfb->func_use_count -= 1; } +EXPORT_SYMBOL(cyber2000fb_disable_extregs); void cyber2000fb_get_fb_var(struct cfb_info *cfb, struct fb_var_screeninfo *var) { memcpy(var, &cfb->fb.var, sizeof(struct fb_var_screeninfo)); } +EXPORT_SYMBOL(cyber2000fb_get_fb_var); /* * Attach a capture/tv driver to the core CyberX0X0 driver. @@ -1122,13 +1118,15 @@ int cyber2000fb_attach(struct cyberpro_info *info, int idx) info->fb_size = int_cfb_info->fb.fix.smem_len; info->enable_extregs = cyber2000fb_enable_extregs; info->disable_extregs = cyber2000fb_disable_extregs; - info->info = int_cfb_info; + info->info = int_cfb_info; - strlcpy(info->dev_name, int_cfb_info->fb.fix.id, sizeof(info->dev_name)); + strlcpy(info->dev_name, int_cfb_info->fb.fix.id, + sizeof(info->dev_name)); } return int_cfb_info != NULL; } +EXPORT_SYMBOL(cyber2000fb_attach); /* * Detach a capture/tv driver from the core CyberX0X0 driver. @@ -1136,12 +1134,7 @@ int cyber2000fb_attach(struct cyberpro_info *info, int idx) void cyber2000fb_detach(int idx) { } - -EXPORT_SYMBOL(cyber2000fb_attach); EXPORT_SYMBOL(cyber2000fb_detach); -EXPORT_SYMBOL(cyber2000fb_enable_extregs); -EXPORT_SYMBOL(cyber2000fb_disable_extregs); -EXPORT_SYMBOL(cyber2000fb_get_fb_var); /* * These parameters give @@ -1205,7 +1198,7 @@ static void cyberpro_init_hw(struct cfb_info *cfb) int i; for (i = 0; i < sizeof(igs_regs); i += 2) - cyber2000_grphw(igs_regs[i], igs_regs[i+1], cfb); + cyber2000_grphw(igs_regs[i], igs_regs[i + 1], cfb); if (cfb->id == ID_CYBERPRO_5000) { unsigned char val; @@ -1215,8 +1208,8 @@ static void cyberpro_init_hw(struct cfb_info *cfb) } } -static struct cfb_info * __devinit -cyberpro_alloc_fb_info(unsigned int id, char *name) +static struct cfb_info __devinit *cyberpro_alloc_fb_info(unsigned int id, + char *name) { struct cfb_info *cfb; @@ -1228,9 +1221,9 @@ cyberpro_alloc_fb_info(unsigned int id, char *name) cfb->id = id; if (id == ID_CYBERPRO_5000) - cfb->ref_ps = 40690; // 24.576 MHz + cfb->ref_ps = 40690; /* 24.576 MHz */ else - cfb->ref_ps = 69842; // 14.31818 MHz (69841?) + cfb->ref_ps = 69842; /* 14.31818 MHz (69841?) */ cfb->divisors[0] = 1; cfb->divisors[1] = 2; @@ -1282,8 +1275,7 @@ cyberpro_alloc_fb_info(unsigned int id, char *name) return cfb; } -static void -cyberpro_free_fb_info(struct cfb_info *cfb) +static void cyberpro_free_fb_info(struct cfb_info *cfb) { if (cfb) { /* @@ -1300,8 +1292,7 @@ cyberpro_free_fb_info(struct cfb_info *cfb) * video=cyber2000:font:fontname */ #ifndef MODULE -static int -cyber2000fb_setup(char *options) +static int cyber2000fb_setup(char *options) { char *opt; @@ -1315,7 +1306,8 @@ cyber2000fb_setup(char *options) if (strncmp(opt, "font:", 5) == 0) { static char default_font_storage[40]; - strlcpy(default_font_storage, opt + 5, sizeof(default_font_storage)); + strlcpy(default_font_storage, opt + 5, + sizeof(default_font_storage)); default_font = default_font_storage; continue; } @@ -1354,10 +1346,18 @@ static int __devinit cyberpro_common_probe(struct cfb_info *cfb) * Determine the size of the memory. */ switch (cfb->mem_ctl2 & MEM_CTL2_SIZE_MASK) { - case MEM_CTL2_SIZE_4MB: smem_size = 0x00400000; break; - case MEM_CTL2_SIZE_2MB: smem_size = 0x00200000; break; - case MEM_CTL2_SIZE_1MB: smem_size = 0x00100000; break; - default: smem_size = 0x00100000; break; + case MEM_CTL2_SIZE_4MB: + smem_size = 0x00400000; + break; + case MEM_CTL2_SIZE_2MB: + smem_size = 0x00200000; + break; + case MEM_CTL2_SIZE_1MB: + smem_size = 0x00100000; + break; + default: + smem_size = 0x00100000; + break; } cfb->fb.fix.smem_len = smem_size; @@ -1366,8 +1366,8 @@ static int __devinit cyberpro_common_probe(struct cfb_info *cfb) err = -EINVAL; if (!fb_find_mode(&cfb->fb.var, &cfb->fb, NULL, NULL, 0, - &cyber2000fb_default_mode, 8)) { - printk("%s: no valid mode found\n", cfb->fb.fix.id); + &cyber2000fb_default_mode, 8)) { + printk(KERN_ERR "%s: no valid mode found\n", cfb->fb.fix.id); goto failed; } @@ -1377,7 +1377,7 @@ static int __devinit cyberpro_common_probe(struct cfb_info *cfb) if (cfb->fb.var.yres_virtual < cfb->fb.var.yres) cfb->fb.var.yres_virtual = cfb->fb.var.yres; -// fb_set_var(&cfb->fb.var, -1, &cfb->fb); +/* fb_set_var(&cfb->fb.var, -1, &cfb->fb); */ /* * Calculate the hsync and vsync frequencies. Note that @@ -1425,20 +1425,20 @@ static void cyberpro_common_resume(struct cfb_info *cfb) #include <asm/arch/hardware.h> -static int __devinit -cyberpro_vl_probe(void) +static int __devinit cyberpro_vl_probe(void) { struct cfb_info *cfb; int err = -ENOMEM; - if (!request_mem_region(FB_START,FB_SIZE,"CyberPro2010")) return err; + if (!request_mem_region(FB_START, FB_SIZE, "CyberPro2010")) + return err; cfb = cyberpro_alloc_fb_info(ID_CYBERPRO_2010, "CyberPro2010"); if (!cfb) goto failed_release; cfb->dev = NULL; - cfb->region = ioremap(FB_START,FB_SIZE); + cfb->region = ioremap(FB_START, FB_SIZE); if (!cfb->region) goto failed_ioremap; @@ -1475,7 +1475,7 @@ failed: failed_ioremap: cyberpro_free_fb_info(cfb); failed_release: - release_mem_region(FB_START,FB_SIZE); + release_mem_region(FB_START, FB_SIZE); return err; } @@ -1538,7 +1538,8 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb) * Allow the CyberPro to accept PCI burst accesses */ if (cfb->id == ID_CYBERPRO_2010) { - printk(KERN_INFO "%s: NOT enabling PCI bursts\n", cfb->fb.fix.id); + printk(KERN_INFO "%s: NOT enabling PCI bursts\n", + cfb->fb.fix.id); } else { val = cyber2000_grphr(EXT_BUS_CTL, cfb); if (!(val & EXT_BUS_CTL_PCIBURST_WRITE)) { @@ -1688,9 +1689,10 @@ static int cyberpro_pci_resume(struct pci_dev *dev) } static struct pci_device_id cyberpro_pci_table[] = { -// Not yet -// { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, -// PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 }, +/* Not yet + * { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, + * PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 }, + */ { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 }, { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010, @@ -1700,7 +1702,7 @@ static struct pci_device_id cyberpro_pci_table[] = { { 0, } }; -MODULE_DEVICE_TABLE(pci,cyberpro_pci_table); +MODULE_DEVICE_TABLE(pci, cyberpro_pci_table); static struct pci_driver cyberpro_driver = { .name = "CyberPro", diff --git a/drivers/video/pnx4008/sdum.h b/drivers/video/pnx4008/sdum.h index e8c5dcdd881..189c3d64138 100644 --- a/drivers/video/pnx4008/sdum.h +++ b/drivers/video/pnx4008/sdum.h @@ -77,9 +77,6 @@ #define CONF_DIRTYDETECTION_OFF (0x600) #define CONF_DIRTYDETECTION_ON (0x601) -/* Set the corresponding bit. */ -#define BIT(n) (0x1U << (n)) - struct dumchannel_uf { int channelnr; u32 *dirty; diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c index 38bd3737259..a684b1e8737 100644 --- a/drivers/watchdog/at91rm9200_wdt.c +++ b/drivers/watchdog/at91rm9200_wdt.c @@ -9,6 +9,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/bitops.h> #include <linux/errno.h> #include <linux/fs.h> #include <linux/init.h> @@ -19,7 +20,6 @@ #include <linux/platform_device.h> #include <linux/types.h> #include <linux/watchdog.h> -#include <asm/bitops.h> #include <asm/uaccess.h> #include <asm/arch/at91_st.h> diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c index 7150fb945ea..e3a29c30230 100644 --- a/drivers/watchdog/ks8695_wdt.c +++ b/drivers/watchdog/ks8695_wdt.c @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ +#include <linux/bitops.h> #include <linux/errno.h> #include <linux/fs.h> #include <linux/init.h> @@ -18,7 +19,6 @@ #include <linux/platform_device.h> #include <linux/types.h> #include <linux/watchdog.h> -#include <asm/bitops.h> #include <asm/io.h> #include <asm/uaccess.h> #include <asm/arch/regs-timer.h> diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 719b066f73c..635ca454f56 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -39,11 +39,11 @@ #include <linux/platform_device.h> #include <linux/moduleparam.h> #include <linux/clk.h> +#include <linux/bitops.h> #include <asm/io.h> #include <asm/uaccess.h> #include <asm/hardware.h> -#include <asm/bitops.h> #include <asm/arch/prcm.h> diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index 3475f47aaa4..34a2b3b8180 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c @@ -25,13 +25,13 @@ #include <linux/miscdevice.h> #include <linux/watchdog.h> #include <linux/init.h> +#include <linux/bitops.h> #ifdef CONFIG_ARCH_PXA #include <asm/arch/pxa-regs.h> #endif #include <asm/hardware.h> -#include <asm/bitops.h> #include <asm/uaccess.h> #define OSCR_FREQ CLOCK_TICK_RATE |