public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Jesper Juhl <jesper.juhl@gmail.com>, Andrew Morton <akpm@osdl.org>
Subject: [PATCH 07/12] making the kernel -Wshadow clean - fix vgacon
Date: Sun, 30 Jul 2006 18:40:46 +0200	[thread overview]
Message-ID: <200607301840.46221.jesper.juhl@gmail.com> (raw)
In-Reply-To: <200607301830.01659.jesper.juhl@gmail.com>

Fix a few -Wshadow warnings in drivers/video/console/vgacon.c


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/video/console/vgacon.c |   72 +++++++++++++++----------------
 1 files changed, 35 insertions(+), 37 deletions(-)

--- linux-2.6.18-rc2-orig/drivers/video/console/vgacon.c	2006-07-18 18:46:50.000000000 +0200
+++ linux-2.6.18-rc2/drivers/video/console/vgacon.c	2006-07-19 00:32:19.000000000 +0200
@@ -855,14 +855,14 @@ static struct {
 	unsigned char ClockingMode;	/* Seq-Controller:01h */
 } vga_state;
 
-static void vga_vesa_blank(struct vgastate *state, int mode)
+static void vga_vesa_blank(struct vgastate *condition, int mode)
 {
 	/* save original values of VGA controller registers */
 	if (!vga_vesa_blanked) {
 		spin_lock_irq(&vga_lock);
-		vga_state.SeqCtrlIndex = vga_r(state->vgabase, VGA_SEQ_I);
+		vga_state.SeqCtrlIndex = vga_r(condition->vgabase, VGA_SEQ_I);
 		vga_state.CrtCtrlIndex = inb_p(vga_video_port_reg);
-		vga_state.CrtMiscIO = vga_r(state->vgabase, VGA_MIS_R);
+		vga_state.CrtMiscIO = vga_r(condition->vgabase, VGA_MIS_R);
 		spin_unlock_irq(&vga_lock);
 
 		outb_p(0x00, vga_video_port_reg);	/* HorizontalTotal */
@@ -881,17 +881,17 @@ static void vga_vesa_blank(struct vgasta
 		vga_state.EndVertRetrace = inb_p(vga_video_port_val);
 		outb_p(0x17, vga_video_port_reg);	/* ModeControl */
 		vga_state.ModeControl = inb_p(vga_video_port_val);
-		vga_state.ClockingMode = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE);
+		vga_state.ClockingMode = vga_rseq(condition->vgabase, VGA_SEQ_CLOCK_MODE);
 	}
 
 	/* assure that video is enabled */
 	/* "0x20" is VIDEO_ENABLE_bit in register 01 of sequencer */
 	spin_lock_irq(&vga_lock);
-	vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE, vga_state.ClockingMode | 0x20);
+	vga_wseq(condition->vgabase, VGA_SEQ_CLOCK_MODE, vga_state.ClockingMode | 0x20);
 
 	/* test for vertical retrace in process.... */
 	if ((vga_state.CrtMiscIO & 0x80) == 0x80)
-		vga_w(state->vgabase, VGA_MIS_W, vga_state.CrtMiscIO & 0xEF);
+		vga_w(condition->vgabase, VGA_MIS_W, vga_state.CrtMiscIO & 0xEF);
 
 	/*
 	 * Set <End of vertical retrace> to minimum (0) and
@@ -920,16 +920,16 @@ static void vga_vesa_blank(struct vgasta
 	}
 
 	/* restore both index registers */
-	vga_w(state->vgabase, VGA_SEQ_I, vga_state.SeqCtrlIndex);
+	vga_w(condition->vgabase, VGA_SEQ_I, vga_state.SeqCtrlIndex);
 	outb_p(vga_state.CrtCtrlIndex, vga_video_port_reg);
 	spin_unlock_irq(&vga_lock);
 }
 
-static void vga_vesa_unblank(struct vgastate *state)
+static void vga_vesa_unblank(struct vgastate *condition)
 {
 	/* restore original values of VGA controller registers */
 	spin_lock_irq(&vga_lock);
-	vga_w(state->vgabase, VGA_MIS_W, vga_state.CrtMiscIO);
+	vga_w(condition->vgabase, VGA_MIS_W, vga_state.CrtMiscIO);
 
 	outb_p(0x00, vga_video_port_reg);	/* HorizontalTotal */
 	outb_p(vga_state.HorizontalTotal, vga_video_port_val);
@@ -948,24 +948,24 @@ static void vga_vesa_unblank(struct vgas
 	outb_p(0x17, vga_video_port_reg);	/* ModeControl */
 	outb_p(vga_state.ModeControl, vga_video_port_val);
 	/* ClockingMode */
-	vga_wseq(state->vgabase, VGA_SEQ_CLOCK_MODE, vga_state.ClockingMode);
+	vga_wseq(condition->vgabase, VGA_SEQ_CLOCK_MODE, vga_state.ClockingMode);
 
 	/* restore index/control registers */
-	vga_w(state->vgabase, VGA_SEQ_I, vga_state.SeqCtrlIndex);
+	vga_w(condition->vgabase, VGA_SEQ_I, vga_state.SeqCtrlIndex);
 	outb_p(vga_state.CrtCtrlIndex, vga_video_port_reg);
 	spin_unlock_irq(&vga_lock);
 }
 
-static void vga_pal_blank(struct vgastate *state)
+static void vga_pal_blank(struct vgastate *condition)
 {
 	int i;
 
-	vga_w(state->vgabase, VGA_PEL_MSK, 0xff);
+	vga_w(condition->vgabase, VGA_PEL_MSK, 0xff);
 	for (i = 0; i < 16; i++) {
-		vga_w(state->vgabase, VGA_PEL_IW, i);
-		vga_w(state->vgabase, VGA_PEL_D, 0);
-		vga_w(state->vgabase, VGA_PEL_D, 0);
-		vga_w(state->vgabase, VGA_PEL_D, 0);
+		vga_w(condition->vgabase, VGA_PEL_IW, i);
+		vga_w(condition->vgabase, VGA_PEL_D, 0);
+		vga_w(condition->vgabase, VGA_PEL_D, 0);
+		vga_w(condition->vgabase, VGA_PEL_D, 0);
 	}
 }
 
@@ -1027,7 +1027,7 @@ static int vgacon_blank(struct vc_data *
 #define blackwmap 0xa0000
 #define cmapsz 8192
 
-static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)
+static int vgacon_do_font_op(struct vgastate *condition,char *arg,int set,int ch512)
 {
 	unsigned short video_port_status = vga_video_port_reg + 6;
 	int font_select = 0x00, beg, i;
@@ -1075,20 +1075,20 @@ static int vgacon_do_font_op(struct vgas
 	unlock_kernel();
 	spin_lock_irq(&vga_lock);
 	/* First, the Sequencer */
-	vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
+	vga_wseq(condition->vgabase, VGA_SEQ_RESET, 0x1);
 	/* CPU writes only to map 2 */
-	vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x04);	
+	vga_wseq(condition->vgabase, VGA_SEQ_PLANE_WRITE, 0x04);	
 	/* Sequential addressing */
-	vga_wseq(state->vgabase, VGA_SEQ_MEMORY_MODE, 0x07);	
+	vga_wseq(condition->vgabase, VGA_SEQ_MEMORY_MODE, 0x07);	
 	/* Clear synchronous reset */
-	vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x03);
+	vga_wseq(condition->vgabase, VGA_SEQ_RESET, 0x03);
 
 	/* Now, the graphics controller, select map 2 */
-	vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x02);		
+	vga_wgfx(condition->vgabase, VGA_GFX_PLANE_READ, 0x02);		
 	/* disable odd-even addressing */
-	vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x00);
+	vga_wgfx(condition->vgabase, VGA_GFX_MODE, 0x00);
 	/* map start at A000:0000 */
-	vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x00);
+	vga_wgfx(condition->vgabase, VGA_GFX_MISC, 0x00);
 	spin_unlock_irq(&vga_lock);
 
 	if (arg) {
@@ -1118,28 +1118,26 @@ static int vgacon_do_font_op(struct vgas
 
 	spin_lock_irq(&vga_lock);
 	/* First, the sequencer, Synchronous reset */
-	vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x01);	
+	vga_wseq(condition->vgabase, VGA_SEQ_RESET, 0x01);	
 	/* CPU writes to maps 0 and 1 */
-	vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x03);
+	vga_wseq(condition->vgabase, VGA_SEQ_PLANE_WRITE, 0x03);
 	/* odd-even addressing */
-	vga_wseq(state->vgabase, VGA_SEQ_MEMORY_MODE, 0x03);
+	vga_wseq(condition->vgabase, VGA_SEQ_MEMORY_MODE, 0x03);
 	/* Character Map Select */
 	if (set)
-		vga_wseq(state->vgabase, VGA_SEQ_CHARACTER_MAP, font_select);
+		vga_wseq(condition->vgabase, VGA_SEQ_CHARACTER_MAP, font_select);
 	/* clear synchronous reset */
-	vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x03);
+	vga_wseq(condition->vgabase, VGA_SEQ_RESET, 0x03);
 
 	/* Now, the graphics controller, select map 0 for CPU */
-	vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x00);
+	vga_wgfx(condition->vgabase, VGA_GFX_PLANE_READ, 0x00);
 	/* enable even-odd addressing */
-	vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x10);
+	vga_wgfx(condition->vgabase, VGA_GFX_MODE, 0x10);
 	/* map starts at b800:0 or b000:0 */
-	vga_wgfx(state->vgabase, VGA_GFX_MISC, beg);
+	vga_wgfx(condition->vgabase, VGA_GFX_MISC, beg);
 
 	/* if 512 char mode is already enabled don't re-enable it. */
 	if ((set) && (ch512 != vga_512_chars)) {
-		int i;	
-		
 		/* attribute controller */
 		for (i = 0; i < MAX_NR_CONSOLES; i++) {
 			struct vc_data *c = vc_cons[i].d;
@@ -1151,11 +1149,11 @@ static int vgacon_do_font_op(struct vgas
 		   512-char: disable intensity bit */
 		inb_p(video_port_status);	/* clear address flip-flop */
 		/* color plane enable register */
-		vga_wattr(state->vgabase, VGA_ATC_PLANE_ENABLE, ch512 ? 0x07 : 0x0f);
+		vga_wattr(condition->vgabase, VGA_ATC_PLANE_ENABLE, ch512 ? 0x07 : 0x0f);
 		/* Wilton (1987) mentions the following; I don't know what
 		   it means, but it works, and it appears necessary */
 		inb_p(video_port_status);
-		vga_wattr(state->vgabase, VGA_AR_ENABLE_DISPLAY, 0);	
+		vga_wattr(condition->vgabase, VGA_AR_ENABLE_DISPLAY, 0);	
 	}
 	spin_unlock_irq(&vga_lock);
 	lock_kernel();



  parent reply	other threads:[~2006-07-30 16:39 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-30 16:30 [PATCH 00/12] making the kernel -Wshadow clean - The initial step Jesper Juhl
2006-07-30 16:35 ` [PATCH 01/12] making the kernel -Wshadow clean - fix mconf Jesper Juhl
2006-07-30 18:34   ` Paul Jackson
2006-07-30 18:48     ` Jesper Juhl
2006-07-30 19:06       ` Andrew Morton
2006-07-30 19:17         ` Jesper Juhl
2006-07-30 19:51           ` Andrew Morton
2006-07-30 19:57             ` Arjan van de Ven
2006-07-30 20:03             ` Jesper Juhl
2006-07-30 19:32         ` Paul Jackson
2006-07-30 23:41       ` Arnd Bergmann
2006-07-31 15:41       ` Horst H. von Brand
2006-07-31 16:04         ` H. Peter Anvin
2006-07-30 16:36 ` [PATCH 02/12] making the kernel -Wshadow clean - fix lxdialog Jesper Juhl
2006-07-30 16:37 ` [PATCH 03/12] making the kernel -Wshadow clean - fix jiffies.h Jesper Juhl
2006-07-30 16:38 ` [PATCH 04/12] making the kernel -Wshadow clean - warnings related to 'up' Jesper Juhl
2006-07-30 16:38 ` [PATCH 05/12] making the kernel -Wshadow clean - warnings related to wbc and map_bh Jesper Juhl
2006-07-30 16:39 ` [PATCH 06/12] making the kernel -Wshadow clean - fix checksum Jesper Juhl
2006-07-30 16:40 ` Jesper Juhl [this message]
2006-07-30 16:41 ` [PATCH 08/12] making the kernel -Wshadow clean - fix keyboard.c Jesper Juhl
2006-07-30 16:42 ` [PATCH 09/12] making the kernel -Wshadow clean - neighbour.h and 'proc_handler' Jesper Juhl
2006-07-30 16:42 ` [PATCH 10/12] making the kernel -Wshadow clean - mm/truncate.c Jesper Juhl
2006-07-30 16:43 ` [PATCH 11/12] making the kernel -Wshadow clean - USB & completion Jesper Juhl
2006-07-30 16:44 ` [PATCH 12/12] making the kernel -Wshadow clean - 'irq' shadows local and global Jesper Juhl
2006-07-30 16:54 ` [PATCH 00/12] making the kernel -Wshadow clean - The initial step Krzysztof Halasa
2006-07-30 17:14   ` Jesper Juhl
2006-07-30 17:27     ` Krzysztof Halasa
2006-07-30 18:29       ` Andrew Morton
2006-07-30 23:36         ` Arnd Bergmann
2006-08-01  6:17       ` Jan Engelhardt
2006-07-30 19:24 ` Jesper Juhl
2006-07-30 20:09   ` Jan-Benedict Glaw
2006-07-30 19:29 ` Sam Ravnborg
2006-07-30 19:39   ` Jesper Juhl

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=200607301840.46221.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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