aacraid: fix the comparison with sizeof()
Subsystems (2)
PATCH 25/28 aacraid: fix the comparison with sizeof()
From: Takashi Iwai <[email protected]>
Fix the comparison with sizeof() in min() macro.
Signed-off-by Takashi Iwai <[email protected]>
Cc James Bottomley <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/scsi/aacraid/aachba.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/aachba.c renamed from drivers/scsi/aacraid/aachba.c~aacraid-fix-the-comparison-with-sizeof +2 -2
@@ -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 ]); }
_
Quoted 4 lines · On Wed, Mar 08, 2006 at 12:14:41AM -0800, [email protected] wrote:
From: Takashi Iwai <[email protected]>
Fix the comparison with
sizeof()inmin()macro.
This should use min_t. I'll send a patch shortly.