From: Dan Carpenter <dan.carpenter@oracle.com>
To: Dan Luedtke <mail@danrl.de>
Cc: gregkh@suse.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: wlan-ng: prism: coding style fixes, removed space-indentations
Date: Tue, 13 Dec 2011 21:27:52 +0300 [thread overview]
Message-ID: <20111213182752.GH3503@mwanda> (raw)
In-Reply-To: <1323776137-458-1-git-send-email-mail@danrl.de>
[-- Attachment #1: Type: text/plain, Size: 3611 bytes --]
On Tue, Dec 13, 2011 at 12:35:37PM +0100, Dan Luedtke wrote:
> Fixed some coding style issues. Converted multiple spaces to tabs.
>
Multiple spaces are allowed. See below.
> (Please provide feedback on problems, it's my first kernel patch ever)
Everyone's first patch is rejected, so don't feel bad. :) Btw put
these kind of comments which you don't want in the permanent git log
under the --- dashes. git am removes that information.
>
> Signed-off-by: Dan Luedtke <mail@danrl.de>
> ---
> drivers/staging/wlan-ng/prism2fw.c | 190 +++++++++++++++++++-----------------
> 1 files changed, 99 insertions(+), 91 deletions(-)
>
> diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
> index 3c40096..e035839 100644
> --- a/drivers/staging/wlan-ng/prism2fw.c
> +++ b/drivers/staging/wlan-ng/prism2fw.c
> @@ -172,13 +172,14 @@ static int read_cardpda(struct pda *pda, wlandevice_t *wlandev);
> static int mkpdrlist(struct pda *pda);
>
> static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
> - struct s3plugrec *s3plug, unsigned int ns3plug, struct pda * pda);
> + struct s3plugrec *s3plug, unsigned int ns3plug, struct pda * pda);
>
> static int crcimage(struct imgchunk *fchunk, unsigned int nfchunks,
> - struct s3crcrec *s3crc, unsigned int ns3crc);
> + struct s3crcrec *s3crc, unsigned int ns3crc);
>
> static int writeimage(wlandevice_t *wlandev, struct imgchunk *fchunk,
> - unsigned int nfchunks);
> + unsigned int nfchunks);
It looks like you've tried to make everything aligned with the right
hand side of the screen. I think that's the first time I've seen
someone do that. I don't think it's normal.
> +
> static void free_chunks(struct imgchunk *fchunk, unsigned int *nfchunks);
>
> static void free_srecs(void);
> @@ -200,23 +201,23 @@ static int validate_identity(void);
> * Returns:
> * 0 - success
> * ~0 - failure
> -----------------------------------------------------------------*/
> +*----------------------------------------------------------------*/
There is a normal kernel comment style described in Chapter 8 of
Documentation/CodingStyle. Or for documenting function parameters,
if you want to be super awesome you could use kernel doc format.
Documentation/kernel-doc-nano-HOWTO.txt
Btw, if you do something complicated with comments, that should be
sent as a separate patch.
> int prism2_fwtry(struct usb_device *udev, wlandevice_t *wlandev)
> {
> const struct firmware *fw_entry = NULL;
>
> printk(KERN_INFO "prism2_usb: Checking for firmware %s\n",
> - PRISM2_USB_FWFILE);
> + PRISM2_USB_FWFILE);
The original is fine here. It uses tabs as far as possible and then
spaces to make it align with the start of the function. Same for
the rest below.
> @@ -951,7 +958,8 @@ int read_fwfile(const struct ihex_binrec *record)
> s3data[ns3data].data = (uint8_t *) record->data;
> ns3data++;
> if (ns3data == S3DATA_MAX) {
> - printk(KERN_ERR "S3 datarec limit reached - aborting\n");
> + printk(KERN_ERR "S3 datarec limit reached"
> + " - aborting\n");
printks are allowed to break the 80 character limit. checkpatch.pl
won't complain about this. We might want to grep for the string and
breaking up the lines makes that harder.
You could do something like:
printk(KERN_ERR
"S3 datarec limit reached - aborting\n");
This one would fit under the limit like that, but I would probably
just leave it as is.
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2011-12-13 18:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-13 11:35 [PATCH] staging: wlan-ng: prism: coding style fixes, removed space-indentations Dan Luedtke
2011-12-13 18:27 ` Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-12-13 18:50 Dan Luedtke
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=20111213182752.GH3503@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mail@danrl.de \
/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