From: Alexey Dobriyan <adobriyan@mail.ru>
To: Ed L Cashin <ecashin@coraid.com>
Cc: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] aoe: fix abuse of arrays and sparse warnings
Date: Fri, 25 Feb 2005 00:52:17 +0200 [thread overview]
Message-ID: <200502250052.17919.adobriyan@mail.ru> (raw)
In-Reply-To: <87k6oxan3a.fsf@coraid.com>
On Thursday 24 February 2005 19:23, Ed L Cashin wrote:
> Have you tested it?
Not yet.
> If you don't have any
> ATA over Ethernet hardware, you can using the alpha vblade program for
> testing.
OK. Will try.
> I was trying to determine what sparse warnings you see, so I got
> sparse from bk://sparse.bkbits.net/sparse and ran it. Your patch cuts
> down significantly on the complaints, but there are some that persist.
> Maybe you're using an older version of sparse?
No. Those three were deliberately left as is because they aren't local to
AOE.
> drivers/block/aoe/aoechr.c:236:24: warning: symbol 'aoe_fops' was not declared. Should it be static?
> drivers/block/aoe/aoecmd.c:27:17: warning: incorrect type in assignment (different base types)
> drivers/block/aoe/aoecmd.c:27:17: expected unsigned short [unsigned] protocol
> drivers/block/aoe/aoecmd.c:27:17: got restricted unsigned short [usertype] [force] <noident>
> drivers/block/aoe/aoenet.c:156:10: warning: incorrect type in initializer (different base types)
> drivers/block/aoe/aoenet.c:156:10: expected unsigned short [unsigned] type
> drivers/block/aoe/aoenet.c:156:10: got restricted unsigned short [usertype] [force] <noident>
> The "array abuse" is something that I'm not all that enthusiastic
> about changing,
I am.
> since it's mostly a style issue,
It isn't.
struct aoe_hdr {
unsigned char tag[4];
};
struct aoe_hdr *h;
u32 net_tag;
net_tag = __cpu_to_be32(n);
memcpy(h->tag, &net_tag, sizeof net_tag);
This code is plain ugly. When AOE was merged there were _plenty_ of examples
of LE and BE fields in structs.
> and last time I
> changed it the way your patch does, the original author of the patch
> changed it back.
Please, show him include/linux/ext2_fs.h::struct ext2_group_desc{} and
fs/ext2/super.c::ext2_check_descriptors(), for example.
> But you've figured out how to make sparse happy, and
> for that I'm grateful! :)
:)
Alexey
prev parent reply other threads:[~2005-02-24 21:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200502240318.23155.adobriyan@mail.ru>
2005-02-24 17:23 ` Ed L Cashin
2005-02-24 22:52 ` Alexey Dobriyan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200502250052.17919.adobriyan@mail.ru \
--to=adobriyan@mail.ru \
--cc=ecashin@coraid.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®