public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-fbdev@vger.kernel.org
Subject: [patch -next] fb: fix recent breakage in correct_chipset()
Date: Tue, 02 Jul 2013 06:28:21 +0000	[thread overview]
Message-ID: <20130702062821.GC24410@elgon.mountain> (raw)

The 6e36308a6f "fb: fix atyfb build warning" isn't right.  It makes all
the indexes off by one.  This patch reverts it and casts the
ARRAY_SIZE() to int to silence the build warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index a89c15d..9b0f12c 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -435,8 +435,8 @@ static int correct_chipset(struct atyfb_par *par)
 	const char *name;
 	int i;
 
-	for (i = ARRAY_SIZE(aty_chips); i > 0; i--)
-		if (par->pci_id = aty_chips[i - 1].pci_id)
+	for (i = (int)ARRAY_SIZE(aty_chips) - 1; i >= 0; i--)
+		if (par->pci_id = aty_chips[i].pci_id)
 			break;
 
 	if (i < 0)

             reply	other threads:[~2013-07-02  6:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02  6:28 Dan Carpenter [this message]
2013-07-02 15:50 ` [patch -next] fb: fix recent breakage in correct_chipset() Randy Dunlap
2013-07-12 20:11 ` Randy Dunlap
2013-07-26  8:34 ` Tomi Valkeinen
2013-08-01  9:31 ` Geert Uytterhoeven
2013-08-01 11:50 ` Dan Carpenter

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=20130702062821.GC24410@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=linux-fbdev@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