* [PATCH] ide-cd: signedness warning fix again
@ 2011-06-02 5:52 Connor Hansen
2011-06-11 22:07 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Connor Hansen @ 2011-06-02 5:52 UTC (permalink / raw)
To: davem; +Cc: bp, linux-ide, linux-kernel, Connor Hansen
One of the legit warnings 'make W=3 drivers/ide/ide-cd.c'
generates is:
drivers/ide/ide-cd.c: In function ide_cd_do_request
drivers/ide/ide-cd.c:828:2: warning: conversion to int from \
unsigned int may change the sign of the result
drivers/ide/ide-cd.c:833:2: warning: conversion to int from \
unsigned int may change the sign of the result
nsectors is declared int, should be unsigned int.
blk_rq-sectors() returns unsigned int, and ide_complete_rq
expects unsigned int as well. Fixes both warnings.
Signed-off-by: Connor Hansen <cmdkhh@gmail.com>
---
drivers/ide/ide-cd.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 5d17ab4..0a61f63 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -778,7 +778,8 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
sector_t block)
{
struct ide_cmd cmd;
- int uptodate = 0, nsectors;
+ int uptodate = 0;
+ unsigned int nsectors;
ide_debug_log(IDE_DBG_RQ, "cmd: 0x%x, block: %llu",
rq->cmd[0], (unsigned long long)block);
--
1.7.4.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ide-cd: signedness warning fix again
2011-06-02 5:52 [PATCH] ide-cd: signedness warning fix again Connor Hansen
@ 2011-06-11 22:07 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-06-11 22:07 UTC (permalink / raw)
To: cmdkhh; +Cc: bp, linux-ide, linux-kernel
From: Connor Hansen <cmdkhh@gmail.com>
Date: Wed, 1 Jun 2011 22:52:05 -0700
> One of the legit warnings 'make W=3 drivers/ide/ide-cd.c'
> generates is:
> drivers/ide/ide-cd.c: In function ide_cd_do_request
> drivers/ide/ide-cd.c:828:2: warning: conversion to int from \
> unsigned int may change the sign of the result
> drivers/ide/ide-cd.c:833:2: warning: conversion to int from \
> unsigned int may change the sign of the result
>
> nsectors is declared int, should be unsigned int.
>
> blk_rq-sectors() returns unsigned int, and ide_complete_rq
> expects unsigned int as well. Fixes both warnings.
>
> Signed-off-by: Connor Hansen <cmdkhh@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-11 22:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-02 5:52 [PATCH] ide-cd: signedness warning fix again Connor Hansen
2011-06-11 22:07 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome