public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Larry Finger <Larry.Finger@lwfinger.net>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, driver-devel@vger.kernel.org,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Petr Mladek <pmladek@suse.com>, Jessica Yu <jeyu@redhat.com>
Subject: Re: [RFC] taint/module: Fix problems when out-of-kernel driver defines true or false
Date: Tue, 03 Jan 2017 13:30:11 +1030	[thread overview]
Message-ID: <87h95gdf0k.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20161224195532.15128-1-Larry.Finger@lwfinger.net>

Larry Finger <Larry.Finger@lwfinger.net> 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 <Larry.Finger@lwfinger.net>
> Cc: Petr Mladek <pmladek@suse.com>
> Cc: Jessica Yu <jeyu@redhat.com>
> Cc: Rusty Russell <rusty@rustcorp.com.au>

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

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

      reply	other threads:[~2017-01-03  3:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-24 19:55 [RFC] taint/module: Fix problems when out-of-kernel driver defines true or false Larry Finger
2017-01-03  3:00 ` Rusty Russell [this message]

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=87h95gdf0k.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=Larry.Finger@lwfinger.net \
    --cc=driver-devel@vger.kernel.org \
    --cc=jeyu@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.com \
    --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