aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMeelis Roos <mroos@linux.ee>2007-07-31 03:39:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-31 18:39:44 -0400
commitdb7526f925b79293dc3b361a70db7f340870a298 (patch)
treea97f7794e713b654c2a9941429a1e1173e3e0f13 /drivers
parentad4a5bb885f1985732426f108d2fe36517dd1939 (diff)
fix integer overflow warning in i2o_block
drivers/message/i2o/i2o_block.c: In function 'i2o_block_transfer': drivers/message/i2o/i2o_block.c:837: warning: integer overflow in expression msg->u.head[1] = cpu_to_le32(I2O_CMD_PRIVATE << 24 | HOST_TID << 12 | tid); and I2O_CMD_PRIVATE is defined as 0xFF. This gets "0xFF0100 | tid" and fits into 32-bit unsigned but not into 32-bit signed integer properly. Target value is defined as u32 so the claculation does not fit during computation. Change local variable tid to u32 so the whole expression is of u32 type and fits well into u32 result. Signed-off-by: Meelis Roos <mroos@linux.ee> Cc: "Salyzyn, Mark" <mark_salyzyn@adaptec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/message/i2o/i2o_block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 5e1c99f83ab5..50b2c7334410 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -744,7 +744,7 @@ static int i2o_block_transfer(struct request *req)
744{ 744{
745 struct i2o_block_device *dev = req->rq_disk->private_data; 745 struct i2o_block_device *dev = req->rq_disk->private_data;
746 struct i2o_controller *c; 746 struct i2o_controller *c;
747 int tid = dev->i2o_dev->lct_data.tid; 747 u32 tid = dev->i2o_dev->lct_data.tid;
748 struct i2o_message *msg; 748 struct i2o_message *msg;
749 u32 *mptr; 749 u32 *mptr;
750 struct i2o_block_request *ireq = req->special; 750 struct i2o_block_request *ireq = req->special;