LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] ps3disk: Remove a superfluous cast
@ 2008-02-15 13:42 Geert Uytterhoeven
  2008-03-03  4:19 ` [Cbe-oss-dev] " Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2008-02-15 13:42 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Linux Kernel Development, Cell Broadband Engine OSS Development

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1558 bytes --]

ps3disk: Remove a superfluous cast

As ps3disk is a ppc64-only driver, sector_t equals to unsigned long, and the
cast is not needed.

Reuse in another (possibly 32-bit) driver is protected by the safety net called
`compiler warning' (with the cast, it may silently truncate to 32-bit).
If sector_t ever changes, we will get a compiler warning as well (with the
cast, we won't).

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
 drivers/block/ps3disk.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -102,8 +102,7 @@ static void ps3disk_scatter_gather(struc
 		dev_dbg(&dev->sbd.core,
 			"%s:%u: bio %u: %u segs %u sectors from %lu\n",
 			__func__, __LINE__, i, bio_segments(iter.bio),
-			bio_sectors(iter.bio),
-			(unsigned long)iter.bio->bi_sector);
+			bio_sectors(iter.bio), iter.bio->bi_sector);
 
 		size = bvec->bv_len;
 		buf = bvec_kmap_irq(bvec, &flags);

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Cbe-oss-dev] [PATCH] ps3disk: Remove a superfluous cast
  2008-02-15 13:42 [PATCH] ps3disk: Remove a superfluous cast Geert Uytterhoeven
@ 2008-03-03  4:19 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2008-03-03  4:19 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Jens Axboe, Linux Kernel Development,
	Cell Broadband Engine OSS Development

On Fri, Feb 15, 2008 at 02:42:03PM +0100, Geert Uytterhoeven wrote:
> ps3disk: Remove a superfluous cast
> 
> As ps3disk is a ppc64-only driver, sector_t equals to unsigned long, and the
> cast is not needed.
> 
> Reuse in another (possibly 32-bit) driver is protected by the safety net called
> `compiler warning' (with the cast, it may silently truncate to 32-bit).
> If sector_t ever changes, we will get a compiler warning as well (with the
> cast, we won't).

Yes, this sounds fine to me.

ACK.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-03  4:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-15 13:42 [PATCH] ps3disk: Remove a superfluous cast Geert Uytterhoeven
2008-03-03  4:19 ` [Cbe-oss-dev] " Christoph Hellwig

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).