From: Greg KH <gregkh@linuxfoundation.org>
To: Elizabeth Ferdman <gnudevliz@gmail.com>
Cc: outreachy-kernel@googlegroups.com, amsfield22@gmail.com
Subject: Re: [Outreachy kernel] Split String Checkpatch Warning
Date: Fri, 30 Sep 2016 06:52:38 +0200 [thread overview]
Message-ID: <20160930045238.GA4515@kroah.com> (raw)
In-Reply-To: <20160929221404.GA7406@localhost>
On Thu, Sep 29, 2016 at 03:14:05PM -0700, Elizabeth Ferdman wrote:
> I'm seeing this checkpatch error:
>
> WARNING: quoted string split across lines
>
> example:
> MODULE_AUTHOR("Ralph Metzler, Trent Piepho, Ben Pfaff, "
> "Christoph Bartelmus, Andrei Tanas");
>
> Just wondering if this is a good thing to fix, and how do I fix it? I
> don't see anything about it in the style guide. If I put the whole
> string on one line, it's more than 80 characters. I found one option on
> stack overflow that says you can do:
>
> char *my_string = "Line 1 \
> Line 2";
As most stackoverflow answers, this one is technically correct, but
totally wrong :)
You would end up with a string that contained "Line 1 Line 2"
in it. The leading whitespace is not what you want to have before "Line
2".
Just merge the strings, putting them all on one line, so your example
above should look like:
MODULE_AUTHOR("Ralph Metzler, Trent Piepho, Ben Pfaff, Christoph Bartelmus, Andrei Tanas");
Hope this helps,
greg k-h
next prev parent reply other threads:[~2016-09-30 4:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 22:14 Split String Checkpatch Warning Elizabeth Ferdman
2016-09-29 23:50 ` Alison Schofield
2016-09-30 0:04 ` Elizabeth Ferdman
2016-09-30 4:52 ` Greg KH [this message]
2016-09-30 4:56 ` [Outreachy kernel] " Julia Lawall
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=20160930045238.GA4515@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=amsfield22@gmail.com \
--cc=gnudevliz@gmail.com \
--cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.