aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorKylene Jo Hall <kjhall@us.ibm.com>2005-11-13 19:07:42 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-13 21:14:17 -0500
commitf6a2382cec3ed9b67b01febfa85d7d72b254844a (patch)
treea15ab118ad15a6392c7b41cb56094e9f938d25fc /drivers/char
parentad5ea3cc5f745aef243ade0dafc8cf6f7f0bfea7 (diff)
[PATCH] tpm: dev_mask handling fix
- Use ~, not ! - Remove unneeded cast Signed-off-by: Kylene Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tpm/tpm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 303f15880466..1a53da99b58f 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -428,8 +428,7 @@ ssize_t tpm_read(struct file * file, char __user *buf,
428 ret_size = size; 428 ret_size = size;
429 429
430 down(&chip->buffer_mutex); 430 down(&chip->buffer_mutex);
431 if (copy_to_user 431 if (copy_to_user(buf, chip->data_buffer, ret_size))
432 ((void __user *) buf, chip->data_buffer, ret_size))
433 ret_size = -EFAULT; 432 ret_size = -EFAULT;
434 up(&chip->buffer_mutex); 433 up(&chip->buffer_mutex);
435 } 434 }
@@ -460,7 +459,7 @@ void tpm_remove_hardware(struct device *dev)
460 sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); 459 sysfs_remove_group(&dev->kobj, chip->vendor->attr_group);
461 460
462 dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= 461 dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &=
463 !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); 462 ~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
464 463
465 kfree(chip); 464 kfree(chip);
466 465