From: Takashi Iwai <tiwai@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH trivial] Fix the comparison with sizeof()
Date: Tue, 14 Feb 2006 21:02:37 +0100 [thread overview]
Message-ID: <s5h3bilbteq.wl%tiwai@suse.de> (raw)
Fix the comparison with sizeof() in min() macro.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 7139659..6be4fb3 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -1597,13 +1597,13 @@ int aac_scsi_cmd(struct scsi_cmnd * scsi
cp[11] = 0;
cp[12] = 0;
aac_internal_transfer(scsicmd, cp, 0,
- min((unsigned int)scsicmd->cmnd[13], sizeof(cp)));
+ min((size_t)scsicmd->cmnd[13], sizeof(cp)));
if (sizeof(cp) < scsicmd->cmnd[13]) {
unsigned int len, offset = sizeof(cp);
memset(cp, 0, offset);
do {
- len = min(scsicmd->cmnd[13]-offset, sizeof(cp));
+ len = min((size_t)(scsicmd->cmnd[13]-offset), sizeof(cp));
aac_internal_transfer(scsicmd, cp, offset, len);
} while ((offset += len) < scsicmd->cmnd[13]);
}
next reply other threads:[~2006-02-14 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 20:02 Takashi Iwai [this message]
2006-02-15 5:54 ` Andrew Morton
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=s5h3bilbteq.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®