Skip to contentSkip to conversation

procfs: Fix sparse warnings

PATCH In review Alexey Dobriyan 2 participants 6 messages Feb 15, 2005 – Feb 16, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 procfs: Fix sparse warnings

fs/proc/base.c +4 -4
Index: linux-warnings/fs/proc/base.c
===================================================================
@@ -689,7 +689,7 @@
 	.open		= mem_open,
 };
 
-static ssize_t oom_adjust_read(struct file *file, char *buf,
+static ssize_t oom_adjust_read(struct file *file, char __user *buf,
 				size_t count, loff_t *ppos)
 {
 	struct task_struct *task = proc_task(file->f_dentry->d_inode);
@@ -709,7 +709,7 @@
 	return count;
 }
 
-static ssize_t oom_adjust_write(struct file *file, const char *buf,
+static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
 				size_t count, loff_t *ppos)
 {
 	struct task_struct *task = proc_task(file->f_dentry->d_inode);
@@ -735,8 +735,8 @@
 }
 
 static struct file_operations proc_oom_adjust_operations = {
-	read:		oom_adjust_read,
-	write:		oom_adjust_write,
+	.read		= oom_adjust_read,
+	.write		= oom_adjust_write,
 };
 
 static struct inode_operations proc_mem_inode_operations = {
#1 lore raw

On Tue, Feb 15, 2005 at 02:55:55PM +0200, Alexey Dobriyan wrote:

[snip]

Let's hold this kind of stuff until 2.6.11, OK?

Al, sitting on more than a megabyte of such patches...

#2 lore raw
Quoted 5 lines · Al Viro

On Tue, Feb 15, 2005 at 02:55:55PM +0200, Alexey Dobriyan wrote:

Let's hold this kind of stuff until 2.6.11, OK?

Al, sitting on more than a megabyte of such patches...

Could you send diffstat or something? I did "make allyesconfig" with -Wbitwise and digging slowly from the beginning. Now at fs/qnx4.

Alexey

#3 lore raw
Quoted 9 lines · Alexey Dobriyan
Quoted 5 lines · Al Viro

On Tue, Feb 15, 2005 at 02:55:55PM +0200, Alexey Dobriyan wrote:

Let's hold this kind of stuff until 2.6.11, OK?

Al, sitting on more than a megabyte of such patches...

Could you send diffstat or something? I did "make allyesconfig" with -Wbitwise and digging slowly from the beginning. Now at fs/qnx4.

Umm... Let's do it that way: I'll get carving the sucker up to relatively sane point and post it again (-bird, that is). Give me until tomorrow morning and then feel free to send stuff my way - I'll merge it and feed upstream when 2.6.11 opens (credited, obviously).

Keep in mind that for endianness patches you *really* need to check on at least some big-endian targets and both on 32 and 64bit ones. I've got a decent cross-build environment (tracking 14 targets now); if you need help with setting up something similar, I can help.

#4 lore raw
Quoted 4 lines · Al Viro

Umm... Let's do it that way: I'll get carving the sucker up to relatively sane point and post it again (-bird, that is). Give me until tomorrow morning and then feel free to send stuff my way - I'll merge it and feed upstream when 2.6.11 opens (credited, obviously).

Gaack... My apologies - I've seriously underestimated the amount of RL crap, so no, it won't be ready today. I'll try to do that ASAP, but I can't make a good estimate of how much I'll be able to do during the next week. Crap...

OK, let's do it that way - send the stuff my way, I'll port it if needed and if there are duplicates, your patches win. FWIW, stuff in fs/* is
* a bunch of patches in fs/reiserfs/* (carved up, see R[0-4]-* on
ftp.linux.org.uk/pub/people/viro)
* nfs, nfsd, lockd and net/sunrpc along with them (not carved up
into sane form and that will be needed to even start talking about merge)
* compat_ioctl.c (part of i2c annotations)
* fs/hostfs/* (part of UML patches, so that'll a part of further split
once the things stabilize a bit)
* couple of trivial ones - procfs (duplicate of your patch) and
ncpfs (ncp_request_reply.sign made be32[6])
* include-ectomy in a lot of places, but that's not likely to clash
with your stuff.

Most of the mess is in drivers/*, arch/* and (for endianness patches) net/*...

#5 lore raw

"__be32 s_addr" ? (was Re: [PATCH] procfs: Fix sparse warnings)

Quoted 1 line · Al Viro

Most of the mess is in drivers/*, arch/* and (for endianness patches) net/*...

Yes, net/*. Many do X.s_addr = htonl(blah). Is this correct?

include/linux/in.h +1 -1
@@ -51,7 +51,7 @@ enum {
 
 /* Internet address. */
 struct in_addr {
-	__u32	s_addr;
+	__be32	s_addr;
 };
 
 #define IP_TOS		1

It gives approximately "486 insertions(+), 183 deletions(-)" between two logs without and with this change (adds more then removes as is).

Alexey