All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: akpm@zip.com.au, linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: i386 pgd_index() doesn't parenthesize its arg
Date: Thu, 16 Jan 2003 22:03:27 -0800	[thread overview]
Message-ID: <20030117060327.GQ919@holomorphy.com> (raw)
In-Reply-To: <20030117055128.GP919@holomorphy.com>

PAE's pte_none() and pte_pfn() evaluate their arguments twice;
analogous fixes have been made to other things; c.f. pgtable.h's long
list of one-line inlines with parentheses still around their args.


===== include/asm-i386/pgtable-3level.h 1.8 vs edited =====
--- 1.8/include/asm-i386/pgtable-3level.h	Fri Jul 26 06:23:51 2002
+++ edited/include/asm-i386/pgtable-3level.h	Thu Jan 16 21:59:08 2003
@@ -89,8 +89,8 @@
 }
 
 #define pte_page(x)	pfn_to_page(pte_pfn(x))
-#define pte_none(x)	(!(x).pte_low && !(x).pte_high)
-#define pte_pfn(x)	(((x).pte_low >> PAGE_SHIFT) | ((x).pte_high << (32 - PAGE_SHIFT)))
+static inline int pte_none(pte_t pte) { return !pte.pte_low && !pte.pte_high; }
+static inline unsigned long pte_pfn(pte_t pte) { return (pte.pte_low >> PAGE_SHIFT) | (pte.pte_high << (32 - PAGE_SHIFT)); }
 
 static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
 {

WARNING: multiple messages have this Message-ID (diff)
From: William Lee Irwin III <wli@holomorphy.com>
To: akpm@zip.com.au, linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: i386 pgd_index() doesn't parenthesize its arg
Date: Thu, 16 Jan 2003 22:03:27 -0800	[thread overview]
Message-ID: <20030117060327.GQ919@holomorphy.com> (raw)
In-Reply-To: <20030117055128.GP919@holomorphy.com>

PAE's pte_none() and pte_pfn() evaluate their arguments twice;
analogous fixes have been made to other things; c.f. pgtable.h's long
list of one-line inlines with parentheses still around their args.


===== include/asm-i386/pgtable-3level.h 1.8 vs edited =====
--- 1.8/include/asm-i386/pgtable-3level.h	Fri Jul 26 06:23:51 2002
+++ edited/include/asm-i386/pgtable-3level.h	Thu Jan 16 21:59:08 2003
@@ -89,8 +89,8 @@
 }
 
 #define pte_page(x)	pfn_to_page(pte_pfn(x))
-#define pte_none(x)	(!(x).pte_low && !(x).pte_high)
-#define pte_pfn(x)	(((x).pte_low >> PAGE_SHIFT) | ((x).pte_high << (32 - PAGE_SHIFT)))
+static inline int pte_none(pte_t pte) { return !pte.pte_low && !pte.pte_high; }
+static inline unsigned long pte_pfn(pte_t pte) { return (pte.pte_low >> PAGE_SHIFT) | (pte.pte_high << (32 - PAGE_SHIFT)); }
 
 static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
 {
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

  reply	other threads:[~2003-01-17  5:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-17  5:51 i386 pgd_index() doesn't parenthesize its arg William Lee Irwin III
2003-01-17  5:51 ` William Lee Irwin III
2003-01-17  6:03 ` William Lee Irwin III [this message]
2003-01-17  6:03   ` William Lee Irwin III

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=20030117060327.GQ919@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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 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.