public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J.A. Magallon" <jamagallon@able.es>
To: Nicholas Petreley <nicholas@petreley.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: patch to NVIDIA_kernel & kernel 2.5.5
Date: Wed, 20 Feb 2002 23:50:56 +0100	[thread overview]
Message-ID: <20020220235056.A4607@werewolf.able.es> (raw)
In-Reply-To: <20020220200135.GA706@petreley.com>
In-Reply-To: <20020220200135.GA706@petreley.com>; from nicholas@petreley.com on mié, feb 20, 2002 at 21:01:35 +0100


On 20020220 Nicholas Petreley wrote:
>I think you may not have meant to do this part of the patch in nv.c:
>
>+/*         
>             if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
>+*/
>+           if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
>                return -EAGAIN;
>
>
>How about this instead:
>
>+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
>             if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
>                  return -EAGAIN;
>+#else
>+            if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
>+                 return -EAGAIN;
>+#endif
>

and why not:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
#define NV_IS_CTRL_DEV(inode) NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev)
#define REMAP_PR(vma, start, page, size, flags) \
		remap_page_range(start, page, size, flags)
#else
#define NV_IS_CTRL_DEV(inode) NV_DEVICE_IS_CONTROL_DEVICE(kdev_val(inode->i_rdev)
#define REMAP_PR(vma, start, page, size, flags) \
		remap_page_range(vma,start, page, size, flags)
#endif

so you just leave the code readable:

-    if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
+    if (NV_IS_CTRL_DEV(inode))

and

-            if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
+            if (REMAP_PR(vma,start, page, PAGE_SIZE, PAGE_SHARED))

instead of polluted by tons of #ifdefs....

-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.18-rc2-jam1 #1 SMP Tue Feb 19 00:35:21 CET 2002 i686

  parent reply	other threads:[~2002-02-20 22:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-20 20:01 patch to NVIDIA_kernel & kernel 2.5.5 Nicholas Petreley
2002-02-20 20:40 ` Martin Huenniger
2002-02-20 22:50 ` J.A. Magallon [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-02-20 18:17 Martin Huenniger
2002-02-28  8:49 ` Martin Huenniger
2002-02-28 16:53   ` Thomas Dodd

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=20020220235056.A4607@werewolf.able.es \
    --to=jamagallon@able.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicholas@petreley.com \
    /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