提交 f6a2382c 编写于 作者: K Kylene Jo Hall 提交者: Linus Torvalds

[PATCH] tpm: dev_mask handling fix

- Use ~, not !

- Remove unneeded cast
Signed-off-by: NKylene Hall <kjhall@us.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 ad5ea3cc
...@@ -428,8 +428,7 @@ ssize_t tpm_read(struct file * file, char __user *buf, ...@@ -428,8 +428,7 @@ ssize_t tpm_read(struct file * file, char __user *buf,
ret_size = size; ret_size = size;
down(&chip->buffer_mutex); down(&chip->buffer_mutex);
if (copy_to_user if (copy_to_user(buf, chip->data_buffer, ret_size))
((void __user *) buf, chip->data_buffer, ret_size))
ret_size = -EFAULT; ret_size = -EFAULT;
up(&chip->buffer_mutex); up(&chip->buffer_mutex);
} }
...@@ -460,7 +459,7 @@ void tpm_remove_hardware(struct device *dev) ...@@ -460,7 +459,7 @@ void tpm_remove_hardware(struct device *dev)
sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); sysfs_remove_group(&dev->kobj, chip->vendor->attr_group);
dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= 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); kfree(chip);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册