From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756537AbdACDiM (ORCPT ); Mon, 2 Jan 2017 22:38:12 -0500 Received: from ozlabs.org ([103.22.144.67]:57309 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751884AbdACDiE (ORCPT ); Mon, 2 Jan 2017 22:38:04 -0500 From: Rusty Russell To: Larry Finger , Linus Torvalds Cc: linux-kernel@vger.kernel.org, driver-devel@vger.kernel.org, Larry Finger , Petr Mladek , Jessica Yu Subject: Re: [RFC] taint/module: Fix problems when out-of-kernel driver defines true or false In-Reply-To: <20161224195532.15128-1-Larry.Finger@lwfinger.net> References: <20161224195532.15128-1-Larry.Finger@lwfinger.net> User-Agent: Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 03 Jan 2017 13:30:11 +1030 Message-ID: <87h95gdf0k.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Larry Finger writes: > Commit 7fd8329ba502 ("taint/module: Clean up global and module taint > flags handling") used the key words true and false as character members > of a new struct. These names cause problems when out-of-kernel modules > such as VirtualBox include their own definitions of true and false. > > Fixes: 7fd8329ba502 ("taint/module: Clean up global and module taint flags handling") > Signed-off-by: Larry Finger > Cc: Petr Mladek > Cc: Jessica Yu > Cc: Rusty Russell Acked-by: Rusty Russell Thanks, Rusty. > --- > include/linux/kernel.h | 4 ++-- > kernel/module.c | 2 +- > kernel/panic.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/linux/kernel.h b/include/linux/kernel.h > index 56aec84..cb09238 100644 > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -514,8 +514,8 @@ extern enum system_states { > #define TAINT_FLAGS_COUNT 16 > > struct taint_flag { > - char true; /* character printed when tainted */ > - char false; /* character printed when not tainted */ > + char c_true; /* character printed when tainted */ > + char c_false; /* character printed when not tainted */ > bool module; /* also show as a per-module taint flag */ > }; > > diff --git a/kernel/module.c b/kernel/module.c > index f7482db..5f7d482 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -1145,7 +1145,7 @@ static size_t module_flags_taint(struct module *mod, char *buf) > > for (i = 0; i < TAINT_FLAGS_COUNT; i++) { > if (taint_flags[i].module && test_bit(i, &mod->taints)) > - buf[l++] = taint_flags[i].true; > + buf[l++] = taint_flags[i].c_true; > } > > return l; > diff --git a/kernel/panic.c b/kernel/panic.c > index c51edaa..901c4fb 100644 > --- a/kernel/panic.c > +++ b/kernel/panic.c > @@ -355,7 +355,7 @@ const char *print_tainted(void) > for (i = 0; i < TAINT_FLAGS_COUNT; i++) { > const struct taint_flag *t = &taint_flags[i]; > *s++ = test_bit(i, &tainted_mask) ? > - t->true : t->false; > + t->c_true : t->c_false; > } > *s = 0; > } else > -- > 2.10.2