LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@it.uu.se>
To: giuliano.procida@googlemail.com, rgooch@atnf.csiro.au
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: MTRR: fix 32-bit ioctls on x64_32
Date: Tue, 16 Jan 2007 13:48:16 +0100 (MET)	[thread overview]
Message-ID: <200701161248.l0GCmG7O025771@harpo.it.uu.se> (raw)

On Tue, 16 Jan 2007 08:14:30 +0000, Giuliano Procida wrote:
> [MTRR] fix 32-bit ioctls on x64_32
> 
> Signed-off-by: Giuliano Procida <giuliano.procida@googlemail.com>
> 
> ---
> 
> Fixed incomplete support for 32-bit compatibility ioctls in
> 2.6.19.1. They were unhandled in one of three case-statements.
> Testing using X server before and after change.
> 
> --- linux-source-2.6.19.1.orig/arch/i386/kernel/cpu/mtrr/if.c	2006-12-11 19:32:53.000000000 +0000
> +++ linux-source-2.6.19.1/arch/i386/kernel/cpu/mtrr/if.c	2007-01-16 07:31:06.000000000 +0000
> @@ -211,6 +211,9 @@ mtrr_ioctl(struct file *file, unsigned i
>  	default:
>  		return -ENOTTY;
>  	case MTRRIOC_ADD_ENTRY:
> +#ifdef CONFIG_COMPAT
> +	case MTRRIOC32_ADD_ENTRY:
> +#endif
>  		if (!capable(CAP_SYS_ADMIN))
>  			return -EPERM;
>  		err =
> @@ -218,21 +221,33 @@ mtrr_ioctl(struct file *file, unsigned i
>  				  file, 0);
>  		break;
>  	case MTRRIOC_SET_ENTRY:
> +#ifdef CONFIG_COMPAT
> +	case MTRRIOC32_SET_ENTRY:
> +#endif

etc

These #ifdefs are too ugly.

Since you apparently just add aliases for the case labels,
and do no actual code changes, why not
1. make the new cases unconditional, or 
2. invoke a translation function before the switch which
   maps the MTRRCIOC32_ constants to what the kernel uses

/Mikael

             reply	other threads:[~2007-01-16 12:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16 12:48 Mikael Pettersson [this message]
2007-01-16 17:59 ` Giuliano Procida
2007-01-17  3:51 ` H. Peter Anvin
2007-01-23 13:23   ` Giuliano Procida
  -- strict thread matches above, loose matches on Subject: below --
2007-01-16  8:14 Giuliano Procida

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=200701161248.l0GCmG7O025771@harpo.it.uu.se \
    --to=mikpe@it.uu.se \
    --cc=giuliano.procida@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgooch@atnf.csiro.au \
    --subject='Re: [PATCH]: MTRR: fix 32-bit ioctls on x64_32' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).