linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang YanQing <udknight@gmail.com>
To: tomi.valkeinen@ti.com
Cc: plagnioj@jcrosoft.com, fengguang.wu@intel.com,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] video: fbdev: uvesafb: use CONFIG_X86_PAE surround _PAGE_NX check code
Date: Wed, 05 Mar 2014 16:16:11 +0000	[thread overview]
Message-ID: <20140305161611.GA32461@udknight> (raw)

Because _PAGE_NX check will always false when we don't define
CONFIG_X86_PAE for CONFIG_X86_32, so use CONFIG_X86_PAE surround
the check code.

Although I believe "smart" compile will optimize out and generate
the same code, but use CONFIG_X86_PAE surround check code will
clear it and prohibit warning from static source code analyze tool.

[ This patch fix warning report by fengguang.wu@intel.com
  "drivers/video/fbdev/uvesafb.c:816 uvesafb_vbe_init()
   warn: bitwise AND condition is false here" ]

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/fbdev/uvesafb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 509d452..102858c 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -813,6 +813,7 @@ static int uvesafb_vbe_init(struct fb_info *info)
 	par->ypan = ypan;
 
 	if (par->pmi_setpal || par->ypan) {
+#ifdef CONFIG_X86_PAE
 		if (__supported_pte_mask & _PAGE_NX) {
 			par->pmi_setpal = par->ypan = 0;
 			printk(KERN_WARNING "uvesafb: NX protection is active, "
@@ -820,6 +821,9 @@ static int uvesafb_vbe_init(struct fb_info *info)
 		} else {
 			uvesafb_vbe_getpmi(task, par);
 		}
+#else
+		uvesafb_vbe_getpmi(task, par);
+#endif
 	}
 #else
 	/* The protected mode interface is not available on non-x86. */
-- 
1.8.3.4.8.g69490f3.dirty

             reply	other threads:[~2014-03-05 16:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 16:16 Wang YanQing [this message]
2014-03-06  9:56 ` [PATCH] video: fbdev: uvesafb: use CONFIG_X86_PAE surround _PAGE_NX check code Tomi Valkeinen
2014-03-06 10:33   ` Wang YanQing

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=20140305161611.GA32461@udknight \
    --to=udknight@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).