From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: Preparing btier for kernel inclusion
Date: Tue, 12 Feb 2013 11:26:18 +0000 [thread overview]
Message-ID: <20130212112618.GO4937@mwanda> (raw)
In-Reply-To: <5119FBC9.7030308@gmail.com>
On Tue, Feb 12, 2013 at 11:09:00AM +0100, Mark Ruijter wrote:
>
> Hi Dan,
>
> Thanks for your elaborate and fast response.
> I will change things as suggested and get back afterwards.
>
> On quick question about indenting:
> Is there a set of options to indent that can produce indented code
> that is acceptable?
> Like : indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1 *.c
>
> Or is manual labour a requirement? ;-)
Don't look for shortcuts. Just go through it manually and rewrite
every function slightly.
Starting from the top with tier_sysfs_init(). Change it to:
static int tier_sysfs_init(struct tier_device *dev)
{
return sysfs_create_group(&disk_to_dev(dev->gd)->kobj,
&tier_attribute_group);
}
Next function read_device_magic():
1) Use sizeof(*dmagic) instead of sizeof(struct devicemagic). This
means we don't have to look up how "struct devicemagic" and
*dmagic are related.
2) There is no error handling for the kzalloc().
3) Space after comma in "dev,count".
4) The "(char *)dmagic" cast is ugly. tier_file_read() should take
a void pointer instead of a char pointer.
5) Use sizeof(*dmagic) instead of sizoef(struct devicemagic) again.
6) The call to tier_file_read() is less than 80 characters long so
it can fit on one line.
7) Why does the call to tier_file_read() not have error handling?
8) tier_file_read() should take a pointer to dev->backdev[count]
instead of count. It's ugly how count is passed to the lowest
levels.
Just do it slowly and methodically. There is about 40 hours of
cleanup here before it can go for review to the block dev people.
If that seems like a lot, then you might want to ask the block
layer people to review the idea and see if it's worth investing the
time to tidy up the code.
Btw, my thinking is that after cleanup you should send this directly
to the block dev people instead of trying to merge it through
staging. When it's in staging then it's mostly Greg KH and I who
review those patches. I'm not able to review block layer code
properly and that's where the more important and difficult review
will happen.
regards,
dan carpenter
prev parent reply other threads:[~2013-02-12 11:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-12 8:22 Preparing btier for kernel inclusion Mark Ruijter
2013-02-12 9:47 ` Dan Carpenter
2013-02-12 10:09 ` Mark Ruijter
2013-02-12 10:23 ` walter harms
2013-02-12 11:26 ` Dan Carpenter [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=20130212112618.GO4937@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/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