All of lore.kernel.org
 help / color / mirror / Atom feed
* [driver-core:driver-core-linus 6/6] 'syslog_partial' defined but not used on !CONFIG_PRINTK
@ 2012-07-10  0:15 wfg
  2012-07-10 21:24 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: wfg @ 2012-07-10  0:15 UTC (permalink / raw)
  To: kernel-janitors

Hi Kay,

There are new compile warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-linus
head:   eb02dac93708f581c99858a19162af8ca2b6bfcb
commit: eb02dac93708f581c99858a19162af8ca2b6bfcb [6/6] kmsg: /proc/kmsg - support reading of partial log records

All warnings:

kernel/printk.c:220:15: warning: 'syslog_partial' defined but not used [-Wunused-variable]

vim +220 kernel/printk.c
   217	/* the next printk record to read by syslog(READ) or /proc/kmsg */
   218	static u64 syslog_seq;
   219	static u32 syslog_idx;
 > 220	static size_t syslog_partial;
   221	
   222	/* index and sequence number of the first record stored in the buffer */
   223	static u64 log_first_seq;

The problem is, syslog_partial is defined outside of CONFIG_PRINTK and
used inside it:

static size_t syslog_partial;
#ifdef CONFIG_PRINTK
                        syslog_partial = 0;
                skip = syslog_partial;
                if (n - syslog_partial <= size) {
                        n -= syslog_partial;
                        syslog_partial = 0;
                        syslog_partial += n;
int do_syslog(int type, char __user *buf, int len, bool from_file)
                        syslog_partial = 0;
                        error -= syslog_partial;
        return do_syslog(type, buf, len, SYSLOG_FROM_CALL);
#endif /* CONFIG_PRINTK */

---
0-DAY kernel build testing backend         Open Source Technology Centre
Fengguang Wu <wfg@linux.intel.com>                     Intel Corporation

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [driver-core:driver-core-linus 6/6] 'syslog_partial' defined but not used on !CONFIG_PRINTK
  2012-07-10  0:15 [driver-core:driver-core-linus 6/6] 'syslog_partial' defined but not used on !CONFIG_PRINTK wfg
@ 2012-07-10 21:24 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2012-07-10 21:24 UTC (permalink / raw)
  To: kernel-janitors

On Tue, 2012-07-10 at 08:15 +0800, wfg@linux.intel.com wrote:
> There are new compile warnings show up in
> 
> vim +220 kernel/printk.c
>    217	/* the next printk record to read by syslog(READ) or /proc/kmsg */
>    218	static u64 syslog_seq;
>    219	static u32 syslog_idx;
>  > 220	static size_t syslog_partial;

Oh, that again, sorry. :)

I moved all variables out of the weird ifdef mess now, that should make it
a bit easier to avoid forgetting that.

Thanks,
Kay


From: Kay Sievers <kay@vrfy.org>
Subject: kmsg - avoid warning for CONFIG_PRINTK=n compilations

Signed-off-by: Kay Sievers <kay@vrfy.org>
---

 kernel/printk.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -216,6 +216,7 @@ struct log {
  */
 static DEFINE_RAW_SPINLOCK(logbuf_lock);
 
+#ifdef CONFIG_PRINTK
 /* the next printk record to read by syslog(READ) or /proc/kmsg */
 static u64 syslog_seq;
 static u32 syslog_idx;
@@ -228,7 +229,6 @@ static u32 log_first_idx;
 
 /* index and sequence number of the next record to store in the buffer */
 static u64 log_next_seq;
-#ifdef CONFIG_PRINTK
 static u32 log_next_idx;
 
 /* the next printk record to read after the last 'clear' command */
@@ -1631,9 +1631,15 @@ asmlinkage int printk(const char *fmt, .
 }
 EXPORT_SYMBOL(printk);
 
-#else
+#else /* CONFIG_PRINTK */
 
 #define LOG_LINE_MAX 0
+static u64 syslog_seq;
+static u32 syslog_idx;
+static enum log_flags syslog_prev;
+static u64 log_first_seq;
+static u32 log_first_idx;
+static u64 log_next_seq;
 static struct cont {
 	size_t len;
 	size_t cons;



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-10 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10  0:15 [driver-core:driver-core-linus 6/6] 'syslog_partial' defined but not used on !CONFIG_PRINTK wfg
2012-07-10 21:24 ` Kay Sievers

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.