public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: David Woodhouse <dwmw2@infradead•org>
Cc: linux-next@vger•kernel.org,
	Artem Bityutskiy <Artem.Bityutskiy@nokia•com>,
	Kay Sievers <kay.sievers@vrfy•org>, Greg KH <greg@kroah•com>
Subject: linux-next: manual merge of the mtd tree
Date: Mon, 22 Dec 2008 17:12:01 +1100	[thread overview]
Message-ID: <20081222171201.4a3680ae.sfr@canb.auug.org.au> (raw)

Hi David,

Today's linux-next merge of the mtd tree got a conflict in
drivers/mtd/devices/m25p80.c drivers/mtd/devices/mtd_dataflash.c between
commit 0e02ed3e44ef541e4d684348d9e684ab3bdd9399 ("mtd: struct device -
replace bus_id with dev_name(), dev_set_name()") from the driver-core
tree and commits 5b7f3a500cd097d673a6283fbb748c1e4f87bac6 ("[MTD] fix
dataflash 64-bit divisions") and d85316ac459f1cdd14ea1828eebeac1f1028e167
("[MTD] fix m25p80 64-bit divisions") from the mtd tree.

I fixed it up (see below) and can carry the fix as necessary.  However, I
suggest that you apply the patch from the driver-core tree as its
prerequisites are upstream and you were cc'd on it.
-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au
http://www.canb.auug.org.au/~sfr/

diff --cc drivers/mtd/devices/m25p80.c
index 5733f06,9be0229..0000000
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@@ -169,9 -170,9 +170,9 @@@ static int wait_till_ready(struct m25p 
   */
  static int erase_chip(struct m25p *flash)
  {
- 	DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %dKiB\n",
+ 	DEBUG(MTD_DEBUG_LEVEL3, "%s: %s %lldKiB\n",
 -			flash->spi->dev.bus_id, __func__,
 +			dev_name(&flash->spi->dev), __func__,
- 			flash->mtd.size / 1024);
+ 			(long long)(flash->mtd.size >> 10));
  
  	/* Wait until finished previous write command. */
  	if (wait_till_ready(flash))
@@@ -232,10 -233,11 +233,11 @@@ static int m25p80_erase(struct mtd_inf
  {
  	struct m25p *flash = mtd_to_m25p(mtd);
  	u32 addr,len;
+ 	uint32_t rem;
  
- 	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%08x, len %d\n",
+ 	DEBUG(MTD_DEBUG_LEVEL2, "%s: %s %s 0x%llx, len %lld\n",
 -			flash->spi->dev.bus_id, __func__, "at",
 +			dev_name(&flash->spi->dev), __func__, "at",
- 			(u32)instr->addr, instr->len);
+ 			(long long)instr->addr, (long long)instr->len);
  
  	/* sanity checks */
  	if (instr->addr + instr->len > flash->mtd.size)
diff --cc drivers/mtd/devices/mtd_dataflash.c
index 65126cd,6806897..0000000
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@@ -152,15 -153,20 +153,20 @@@ static int dataflash_erase(struct mtd_i
  	struct spi_message	msg;
  	unsigned		blocksize = priv->page_size << 3;
  	uint8_t			*command;
+ 	uint32_t		rem;
  
- 	DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%x len 0x%x\n",
- 			dev_name(&spi->dev),
- 			instr->addr, instr->len);
+ 	DEBUG(MTD_DEBUG_LEVEL2, "%s: erase addr=0x%llx len 0x%llx\n",
 -			spi->dev.bus_id, (long long)instr->addr,
++			dev_name(&spi->dev), (long long)instr->addr,
+ 			(long long)instr->len);
  
  	/* Sanity checks */
- 	if ((instr->addr + instr->len) > mtd->size
- 			|| (instr->len % priv->page_size) != 0
- 			|| (instr->addr % priv->page_size) != 0)
+ 	if (instr->addr + instr->len > mtd->size)
+ 		return -EINVAL;
+ 	div_u64_rem(instr->len, priv->page_size, &rem);
+ 	if (rem)
+ 		return -EINVAL;
+ 	div_u64_rem(instr->addr, priv->page_size, &rem);
+ 	if (rem)
  		return -EINVAL;
  
  	spi_message_init(&msg);

             reply	other threads:[~2008-12-22  6:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22  6:12 Stephen Rothwell [this message]
2008-12-23  4:28 ` linux-next: manual merge of the mtd tree Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2008-12-11  2:43 Stephen Rothwell
2008-12-11 10:11 ` Dmitry Eremin-Solenikov
2008-12-11 10:23   ` Stephen Rothwell
2008-12-11 10:32     ` Eric Miao
2008-12-12 10:29     ` Dmitry Eremin-Solenikov
2008-12-12 11:11       ` David Woodhouse
2008-12-12 23:05       ` Stephen Rothwell
2008-12-15  4:15         ` Stephen Rothwell
2009-01-02  2:07           ` Stephen Rothwell
2008-11-27  4:15 Stephen Rothwell
2008-11-27  5:25 ` Greg KH
2008-12-10  2:08 ` Stephen Rothwell
2008-12-10  2:27   ` Greg KH
2008-12-10  2:34     ` Stephen Rothwell
2008-12-10  4:04       ` Greg KH

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=20081222171201.4a3680ae.sfr@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=Artem.Bityutskiy@nokia$(echo .)com \
    --cc=dwmw2@infradead$(echo .)org \
    --cc=greg@kroah$(echo .)com \
    --cc=kay.sievers@vrfy$(echo .)org \
    --cc=linux-next@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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