2005-02-15 11:56:14

by Alexey Dobriyan

[permalink] [raw]
Subject: [PATCH] procfs: Fix sparse warnings

Signed-off-by: Alexey Dobriyan <[email protected]>

Index: linux-warnings/fs/proc/base.c
===================================================================
--- linux-warnings/fs/proc/base.c (revision 25)
+++ linux-warnings/fs/proc/base.c (revision 29)
@@ -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 = {


2005-02-15 11:59:38

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] procfs: Fix sparse warnings

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...

2005-02-15 12:14:16

by Alexey Dobriyan

[permalink] [raw]
Subject: Re: [PATCH] procfs: Fix sparse warnings

On Tuesday 15 February 2005 13:59, Al Viro wrote:
> 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

2005-02-15 19:26:31

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] procfs: Fix sparse warnings

On Tue, Feb 15, 2005 at 03:12:37PM +0200, Alexey Dobriyan wrote:
> On Tuesday 15 February 2005 13:59, Al Viro wrote:
> > 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.

2005-02-16 08:35:58

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] procfs: Fix sparse warnings

On Tue, Feb 15, 2005 at 07:26:18PM +0000, Al Viro wrote:
> 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/*...

2005-02-16 09:28:16

by Alexey Dobriyan

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

On Wednesday 16 February 2005 10:35, Al Viro wrote:

> 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?

--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -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