From: Joe Perches <joe@perches.com>
To: Yorick Rommers <yorick-rommers@hotmail.com>
Cc: gregkh@linuxfoundation.org, markh@compro.net,
lidza.louina@gmail.com, driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH 2/2] Staging: dgnc: fixed code style issues, mainly line width issues.
Date: Sat, 18 Apr 2015 18:28:20 -0700 [thread overview]
Message-ID: <1429406900.2947.16.camel@perches.com> (raw)
In-Reply-To: <BLU437-SMTP987834A05A6A5C52B97C039EE10@phx.gbl>
On Sun, 2015-04-19 at 02:04 +0200, Yorick Rommers wrote:
> A patch for dgnc_mgmt.c and dgnc_neo.c to fix some code style issues.
trivial notes:
Try breaking up the patches you send into more discrete
chucks that do just one thing, not mostly one thing
and some other things.
> diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
[]
> @@ -148,7 +148,9 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> di.info_bdstate = dgnc_Board[brd]->dpastatus;
> di.info_ioport = 0;
> di.info_physaddr = (ulong) dgnc_Board[brd]->membase;
> - di.info_physsize = (ulong) dgnc_Board[brd]->membase - dgnc_Board[brd]->membase_end;
It may be better to use a temporary for brd like:
struct dgnc_board *bd = dgnc_Board[brd];
as is done a few other places.
> + di.info_physsize =
> + (ulong) dgnc_Board[brd]->membase - dgnc_Board[brd]->membase_end;
so this becomes
di.info->physsize = bd->membase - bd->membase_end;
though I wonder if this is a defect and size
should be bd->membase_end - bd->membase + 1
It doesn't need a cast as membase and membase_end
are ulong already.
It also seems this physsize variable isn't used.
> diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
[]
> @@ -79,7 +79,8 @@ struct board_ops dgnc_neo_ops = {
> .send_immediate_char = neo_send_immediate_char
> };
>
> -static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
> +static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
> +0x10, 0x20, 0x40, 0x80 };
That's less attractive then what's already there.
The generic kernel form for an array declaration would be:
static uint dgnc_offset_table[8] = {
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
};
This also would be better as static const.
I stopped reading here.
next prev parent reply other threads:[~2015-04-19 1:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-19 0:04 [PATCH 2/2] Staging: dgnc: fixed code style issues, mainly line width issues Yorick Rommers
2015-04-19 1:28 ` Joe Perches [this message]
2015-04-20 8:08 ` Dan Carpenter
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=1429406900.2947.16.camel@perches.com \
--to=joe@perches.com \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=lidza.louina@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markh@compro.net \
--cc=yorick-rommers@hotmail.com \
/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