]> err.no Git - linux-2.6/commitdiff
[PATCH] tpm: dev_mask handling fix
authorKylene Jo Hall <kjhall@us.ibm.com>
Mon, 14 Nov 2005 00:07:42 +0000 (16:07 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 14 Nov 2005 02:14:17 +0000 (18:14 -0800)
- 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>
drivers/char/tpm/tpm.c

index 303f15880466293f967a94ea5267262039006e2e..1a53da99b58fc8af06640dc9fe2a9333dae9c689 100644 (file)
@@ -428,8 +428,7 @@ ssize_t tpm_read(struct file * file, char __user *buf,
                        ret_size = size;
 
                down(&chip->buffer_mutex);
-               if (copy_to_user
-                   ((void __user *) buf, chip->data_buffer, ret_size))
+               if (copy_to_user(buf, chip->data_buffer, ret_size))
                        ret_size = -EFAULT;
                up(&chip->buffer_mutex);
        }
@@ -460,7 +459,7 @@ void tpm_remove_hardware(struct device *dev)
        sysfs_remove_group(&dev->kobj, chip->vendor->attr_group);
 
        dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &=
-               !(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
+               ~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
 
        kfree(chip);