From: David Miller <davem@davemloft.net>
To: James.Bottomley@HansenPartnership.com
Cc: matthew@wil.cx, julia@diku.dk, linux-scsi@vger.kernel.org,
12o3l@tiscali.nl, kernel-janitors@vger.kernel.org,
kernelnewbies-bounce@nl.linux.org
Subject: Re: esp_scsi incorrect unsigned test
Date: Sat, 19 Apr 2008 17:59:13 -0700 (PDT) [thread overview]
Message-ID: <20080419.175913.166084026.davem@davemloft.net> (raw)
In-Reply-To: <1208614598.3280.11.camel@localhost.localdomain>
From: James Bottomley <James.Bottomley@HansenPartnership.com>
Date: Sat, 19 Apr 2008 09:16:38 -0500
> It look fine to me ... although an alternative (and possibly simpler)
> fix would just be to remove the unsigned from the two residue
> definitions in the struct.
I think that's the better approach too. James, please
apply.
esp_scsi: Make cur_residue and tot_residue signed.
Many of the overflow checks test whether the value has
gone negative, and we want to retain such checks.
Reported by Julia Lawall.
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/scsi/esp_scsi.h b/drivers/scsi/esp_scsi.h
index d5576d5..9367a88 100644
--- a/drivers/scsi/esp_scsi.h
+++ b/drivers/scsi/esp_scsi.h
@@ -240,9 +240,9 @@ struct esp_cmd_priv {
int num_sg;
} u;
- unsigned int cur_residue;
+ int cur_residue;
struct scatterlist *cur_sg;
- unsigned int tot_residue;
+ int tot_residue;
};
#define ESP_CMD_PRIV(CMD) ((struct esp_cmd_priv *)(&(CMD)->SCp))
next prev parent reply other threads:[~2008-04-20 0:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4808C90A.5040600@tiscali.nl>
[not found] ` <Pine.LNX.4.64.0804182101200.14832@ask.diku.dk>
2008-04-19 14:05 ` esp_scsi incorrect unsigned test Matthew Wilcox
2008-04-19 14:16 ` James Bottomley
2008-04-20 0:59 ` David Miller [this message]
2008-04-19 14:17 ` u14-3f " Matthew Wilcox
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=20080419.175913.166084026.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=12o3l@tiscali.nl \
--cc=James.Bottomley@HansenPartnership.com \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernelnewbies-bounce@nl.linux.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
/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