[PATCH] mconf.c: Honor $LINES and $COLUMNS if TIOCGWINSZ failed
While reading code, I found this buglet. If the TIOCGWINSZ fails,
mconf.c assumes 24/80 as screen size, without honoring the LINES and
COLUMNS environment variables. This is the shorter and IMHO more
correct version.
Alexander Viro [Wed, 14 Jul 2004 02:40:17 +0000 (19:40 -0700)]
[PATCH] mcdx irq handling cleanup
mcdx has different IRQ numbers for all drives; irq handler needs a
pointer to structure describing the drive in question. However, instead
of passing such pointer at request_irq() time and having it passed to
mcdx_intr() for free, mcdx.c sticks the pointer in question into an
array indexed by IRQ number and has mcdx_intr() go look it up there.
Alexander Viro [Wed, 14 Jul 2004 02:38:57 +0000 (19:38 -0700)]
[PATCH] sparse: sound compat ioctls annotations
Trivial annotations + typo fix in _snd_ioctl32_hwdep_dsp_image()
(we want to copy 32bit structure from userland, convert it to native one
and do normal ioctl on it; see the first changed line below for what's
really happening...)
Alexander Viro [Wed, 14 Jul 2004 02:37:38 +0000 (19:37 -0700)]
[PATCH] sparse: __forced added to casts in arch-specific code
Casts from __user to address-space-agnostic in amd64 and i386
made explicit (__force added; in these places we pass userland pointer
to arch-specific code that handles kernel and userland pointers the
same way).
csum_partial_copy_*() annotated properly
Alexander Viro [Wed, 14 Jul 2004 02:37:04 +0000 (19:37 -0700)]
[PATCH] sparse: read_descriptor_t annotation
We have a fun situation with read_descriptor_t - all its instances end
up passed to some actor; these actors use desc->buf as their private
data; there are 5 of them and they expect resp:
IOW, there is no type safety whatsoever; the field is essentially untyped,
we rely on the fact that actor is chosen by the same code that sets ->buf
and expect it to put something of the right type there.
Right now desc->buf is declared as char __user *. Moreover, the last
argument of ->sendfile() (what should be stored in ->buf) is void __user *,
even though it's actually _never_ a userland pointer.
If nothing else, ->sendfile() should take void * instead; that alone removes
a bunch of bogus warnings. I went further and replaced desc->buf with a
union of void * and char __user *.
Rename PCDP_TABLE_GUID back to HCDP_TABLE_GUID to get the file to compile
again. This change is against current 2.6 BK and is under
CONFIG_IA64_EARLY_PRINTK_UART.
Michael Hunold [Wed, 14 Jul 2004 02:27:27 +0000 (19:27 -0700)]
[PATCH] fix saa7146 compilation
From: Colin Leroy <colin@colino.net>
This patch fixes a compilation error on 2.6.8-rc1. Here's the error:
drivers/media/common/saa7146_video.c:3: conflicting types for `memory'
include/asm-m68k/setup.h:365: previous declaration of `memory' make[3]: ***
[drivers/media/common/saa7146_video.o] Error 1
Signed-off-by: Colin Leroy <colin@colino.net> Signed-off-by: Michael Hunold <hunold@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] Fix 3c59x.c uses of plain integer as NULL pointer
This patch will fix 3Com "Vortex" and "Boomerang" ethernet driver sparse
warnings about using plain integer as NULL pointer.
Signed-off-by: Petri T. Koistinen <petri.koistinen@iki.fi> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alexander Viro [Tue, 13 Jul 2004 04:30:17 +0000 (21:30 -0700)]
[PATCH] compat_fillonedir() warning fix
access_ok() expects a pointer, not unsigned long. It's not a
problem on platforms that have this guy done as a macro (or ones that
do not use fs/compat.c at all), but that's still wrong and on some
platforms that care we actually have access_ok() as inlined function.
Bogus cast removed.
Alexander Viro [Tue, 13 Jul 2004 04:16:58 +0000 (21:16 -0700)]
[PATCH] __vfs_follow_link() made inline again
__vfs_follow_link() really should be inline; that's a special case since
we are in the middle of recursion and really want to conserve stack
space. Moved before the first use, made inline again.
Alexander Viro [Tue, 13 Jul 2004 04:03:08 +0000 (21:03 -0700)]
[PATCH] sparse: gemtek ioctl fix
Dumb Typo(tm) - the first bug caught by 0/NULL checks (arg is
really a kernel pointer there, so memset() is actually OK - results
will be copied to userland by caller. Or would be, if we would not
oops ;-)
Alexander Viro [Tue, 13 Jul 2004 04:02:33 +0000 (21:02 -0700)]
[PATCH] sparse: signal annotation
ss_sp in struct sigaltstack made __user
->si_addr and ->sival_ptr made __user
your ->sa_restorer and ->sa_handler changes propagated
users of these guys annotated on i386/amd64/alpha/sparc/sparc64
Alexander Viro [Tue, 13 Jul 2004 04:02:10 +0000 (21:02 -0700)]
[PATCH] sparse: alpha sparse infrastructure
* added usual CHECK assignment in Makefile
* switched uaccess.h to __check_uptr()
* added L on long constants (ones missed earlier)
* added __user in osf_sys.c (duh - I've added __user to cast in
the initializer, but forgot to add it in declaration)
Alexander Viro [Tue, 13 Jul 2004 04:01:35 +0000 (21:01 -0700)]
[PATCH] sparse: drivers/sbus fixes
a) vfc is not 64bit-clean, marked as such in Kconfig
b) aurora is simply broken - still uses tqueues. Marked as broken.
c) vfc does dereferencing of userland pointer, right after having
carefully copied the data to kernel space ;-) Fixed.
d) vfc ->mmap() had missed prototype change. Fixed.
e) BPP ioctls are misdeclared - they should've been _IO(...) instead
of _IOR(..., void). Too late to fix, but we can at least make them
_IOR(..., char) - same value, but doesn't try to find sizeof(void).
Alexander Viro [Tue, 13 Jul 2004 04:01:12 +0000 (21:01 -0700)]
[PATCH] sparse: tms380tr.c fix
tms380tr is used both by ISA and PCI drivers. Enabling/disabling
DMA is done only for ISA ones (it's protected by if (dev->dma > 0) and
PCI ones leave it 0), but it's compiled unconditionally. Which breaks
on platforms that don't have that ISA crap at all, but support PCI just
fine. Code in question placed under ifdef CONFIG_ISA.
Alexander Viro [Tue, 13 Jul 2004 04:00:39 +0000 (21:00 -0700)]
[PATCH] sparse: isdn compile fix for platforms with HZ > 1000
Division by zero is an ugly thing... We are safe wrt overflows,
since the maximal value we ever pass is 10000 - not enough to overflow
unless you've got a platform with HZ > 200000.
Alexander Viro [Tue, 13 Jul 2004 04:00:16 +0000 (21:00 -0700)]
[PATCH] sparse: VIDIOCSWIN compat_ioctl fixes
In handling of VIDIOCSWIN for 32bit on 64bit platforms:
* switched to compat_alloc_user_space()
* fixed memory corruption in copying arguments from userland
* fixed arithmetic overflows
* added missing checks for get_user() results
and corresponding returns with -EFAULT.
Fixes calculation of how many bytes in the RX/TX FIFOs.
Previous code failed to check wether the full flags
where set before returning the byte counter. This
should ensure that the serial driver behaves correctly
when the FIFO fills, and not just ignore the input
data
Jack Steiner [Mon, 12 Jul 2004 07:27:49 +0000 (00:27 -0700)]
[PATCH] ia64: Reduce TLB flushing during process migration
This patch adds an architecture-specific callout after explicit
processor migrations. The callout allows architectures (or platforms)
to update TLB specific information (ex., cpu_vm_mask).
Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: David Mosberger <davidm@hpl.hp.com>
copy_from_user() moved from dvb_ringbuffer_{write,pkt_write}() to callers;
these functions are always getting kernel pointer now. "usermem" argument
killed, code annotated.
x86: fix stackframe ownership confusion in sys_sigaltstack()
gcc doesn't understand that "asmlinkage" routines have the
argument stack owned by the assembly-language caller, and the
recent sparse cleanup made gcc think it owns enough stack
frame space to make a tailcall by overwriting "struct pt_regs"
that is set up by the low-level system call code.
Hide that problem again.
The real fix would be to tell gcc that the caller owns the
stack frame that it set up, but we don't have any such
interfaces, so for now the best we can do is to hide it.
Martin Josefsson [Sun, 11 Jul 2004 10:49:02 +0000 (03:49 -0700)]
[NETFILTER]: Add timestamping to ipt_ULOG
After Andi's timestamp optimizations we don't have any timestamps on the
packets unless someone requested them. Here's a patch for 2.6 to
explicitly timestamp the packets before we log them.
Harald approved it some time ago, he's pretty busy so I'm sending it
instead.
Signed-off-by: Martin Josefsson <gandalf@netfilter.org> Signed-off-by: David S. Miller <davem@redhat.com>