From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Petr Mladek <pmladek@suse.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mark Rutland <mark.rutland@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] printk: Remove no longer used second struct cont
Date: Fri, 16 Dec 2016 10:50:26 +0900 [thread overview]
Message-ID: <20161216015026.GB20445@jagdpanzerIV.localdomain> (raw)
In-Reply-To: <1481852392.29291.75.camel@perches.com>
On (12/15/16 17:39), Joe Perches wrote:
> On Fri, 2016-12-16 at 10:37 +0900, Sergey Senozhatsky wrote:
> > On (12/15/16 17:23), Petr Mladek wrote:
> > > On Thu 2016-12-15 13:53:58, Geert Uytterhoeven wrote:
> > > > If CONFIG_PRINTK=n:
> > > >
> > > > kernel/printk/printk.c:1893: warning: ‘cont’ defined but not used
> > > >
> > > > Note that there are actually two different struct cont definitions and
> > > > objects: the first one is used if CONFIG_PRINTK=y, the second one became
> > > > unused by removing console_cont_flush().
> > > >
> > > > Fixes: 5c2992ee7fd8a29d ("printk: remove console flushing special cases for partial buffered lines")
> > >
> > > Great catch. It seems that nobody tried the build without CONFIG_PRINTK
> > > at that time.
> >
> > ok... since the patch is a cosmetic tweak... can we add several more
> > cosmetic changes to it? yes, I know, N things in one patch is "a bad thing",
> > but those extra changes don't deserve to be in a separate patch.
> >
> > basically I'm talking about a bunch of 80-cols fixups.
> > if it's irrelevant then feel free to ignore it.
>
> While it might be nice to do some 80 column wrapping,
> the most common wrap style is to the open parenthesis.
indeed. good morning to me. updated version below.
> I'd also like to split up printk.c into a bunch of
> smaller, more logically self-contained files eventually.
yes, I think you mentioned that before. well, I'm not sure I
see why would it make anyting better/simpler.
---
kernel/printk/printk.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index bc2e220ed2b0..2319adaf2af2 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1194,7 +1194,8 @@ static size_t print_prefix(const struct printk_log *msg, bool syslog, char *buf)
return len;
}
-static size_t msg_print_text(const struct printk_log *msg, bool syslog, char *buf, size_t size)
+static size_t msg_print_text(const struct printk_log *msg, bool syslog,
+ char *buf, size_t size)
{
const char *text = log_text(msg);
size_t text_size = msg->text_len;
@@ -1600,7 +1601,8 @@ static void cont_flush(void)
cont.len = 0;
}
-static bool cont_add(int facility, int level, enum log_flags flags, const char *text, size_t len)
+static bool cont_add(int facility, int level, enum log_flags flags,
+ const char *text, size_t len)
{
/*
* If ext consoles are present, flush and skip in-kernel
@@ -1636,7 +1638,9 @@ static bool cont_add(int facility, int level, enum log_flags flags, const char *
return true;
}
-static size_t log_output(int facility, int level, enum log_flags lflags, const char *dict, size_t dictlen, char *text, size_t text_len)
+static size_t log_output(int facility, int level, enum log_flags lflags,
+ const char *dict, size_t dictlen,
+ char *text, size_t text_len)
{
/*
* If an earlier line was buffered, and we're a continuation
@@ -1651,7 +1655,10 @@ static size_t log_output(int facility, int level, enum log_flags lflags, const c
cont_flush();
}
- /* Skip empty continuation lines that couldn't be added - they just flush */
+ /*
+ * Skip empty continuation lines that couldn't be
+ * added - they just flush
+ */
if (!text_len && (lflags & LOG_CONT))
return 0;
@@ -1662,7 +1669,8 @@ static size_t log_output(int facility, int level, enum log_flags lflags, const c
}
/* Store it in the record log */
- return log_store(facility, level, lflags, 0, dict, dictlen, text, text_len);
+ return log_store(facility, level, lflags, 0, dict, dictlen,
+ text, text_len);
}
asmlinkage int vprintk_emit(int facility, int level,
@@ -1777,7 +1785,8 @@ asmlinkage int vprintk_emit(int facility, int level,
if (dict)
lflags |= LOG_PREFIX|LOG_NEWLINE;
- printed_len += log_output(facility, level, lflags, dict, dictlen, text, text_len);
+ printed_len += log_output(facility, level, lflags, dict, dictlen,
+ text, text_len);
logbuf_cpu = UINT_MAX;
raw_spin_unlock(&logbuf_lock);
next prev parent reply other threads:[~2016-12-16 1:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 12:53 Geert Uytterhoeven
2016-12-15 16:23 ` Petr Mladek
2016-12-16 1:37 ` Sergey Senozhatsky
2016-12-16 1:39 ` Joe Perches
2016-12-16 1:50 ` Sergey Senozhatsky [this message]
2016-12-16 1:50 ` Linus Torvalds
2016-12-16 1:57 ` Joe Perches
2016-12-16 2:10 ` Linus Torvalds
2016-12-16 2:30 ` Joe Perches
2016-12-16 5:00 ` Junio C Hamano
2016-12-16 6:04 ` Joe Perches
2016-12-16 2:00 ` Sergey Senozhatsky
2016-12-18 19:29 ` Scott Matheina
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=20161216015026.GB20445@jagdpanzerIV.localdomain \
--to=sergey.senozhatsky.work@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=geert@linux-m68k.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®