linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: <linux-mtd@lists.infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Subject: [PATCH 3/6] mtd: maps: sc520cdp: fix warnings
Date: Tue, 20 May 2014 23:17:00 -0700	[thread overview]
Message-ID: <1400653023-25757-4-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <1400653023-25757-1-git-send-email-computersforpeace@gmail.com>

On m86k, and maybe a few other architectures, we get this kind of
warning, due to misuse of volatile:

   drivers/mtd/maps/sc520cdp.c: In function 'sc520cdp_setup_par':
>> drivers/mtd/maps/sc520cdp.c:223:2: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [enabled by default]
   arch/m68k/include/asm/raw_io.h:22:13: note: expected 'void *' but argument is of type 'volatile long unsigned int *'

Rather than annotating the variable declaration, let's just use the
proper accessors, which add the 'volatile' qualifier to the operation.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/maps/sc520cdp.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/maps/sc520cdp.c b/drivers/mtd/maps/sc520cdp.c
index 8fead8e46bce..093edd51bdc7 100644
--- a/drivers/mtd/maps/sc520cdp.c
+++ b/drivers/mtd/maps/sc520cdp.c
@@ -183,7 +183,7 @@ static const struct sc520_par_table par_table[NUM_FLASH_BANKS] =
 
 static void sc520cdp_setup_par(void)
 {
-	volatile unsigned long __iomem *mmcr;
+	unsigned long __iomem *mmcr;
 	unsigned long mmcr_val;
 	int i, j;
 
@@ -203,11 +203,11 @@ static void sc520cdp_setup_par(void)
 	*/
 	for(i = 0; i < NUM_FLASH_BANKS; i++) {		/* for each par_table entry  */
 		for(j = 0; j < NUM_SC520_PAR; j++) {	/* for each PAR register     */
-			mmcr_val = mmcr[SC520_PAR(j)];
+			mmcr_val = readl(&mmcr[SC520_PAR(j)]);
 			/* if target device field matches, reprogram the PAR */
 			if((mmcr_val & SC520_PAR_TRGDEV) == par_table[i].trgdev)
 			{
-				mmcr[SC520_PAR(j)] = par_table[i].new_par;
+				writel(par_table[i].new_par, &mmcr[SC520_PAR(j)]);
 				break;
 			}
 		}
-- 
1.7.9.5

  parent reply	other threads:[~2014-05-21  6:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21  6:16 [PATCH 0/6] mtd: small cleanups Brian Norris
2014-05-21  6:16 ` [PATCH 1/6] mtd: pfow: remove unused variable Brian Norris
2014-05-21  6:16 ` [PATCH 2/6] mtd: slram: fix unused variable warning Brian Norris
2014-05-21  6:17 ` Brian Norris [this message]
2014-05-21  6:17 ` [PATCH 4/6] mtd: nand_bbt: remove unused variable Brian Norris
2014-05-21  6:17 ` [PATCH 5/6] mtd: nand_bbt: handle error case for nand_create_badblock_pattern() Brian Norris
2014-05-21  6:17 ` [PATCH 6/6] mtd: nand: r852: correct write_buf loop bounds Brian Norris
2014-05-28  7:07 ` [PATCH 0/6] mtd: small cleanups Brian Norris

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=1400653023-25757-4-git-send-email-computersforpeace@gmail.com \
    --to=computersforpeace@gmail.com \
    --cc=linux-mtd@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).