Skip to content

Commit

Permalink
[PATCH] tpm: dev_mask handling fix
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
Kylene Jo Hall authored and Linus Torvalds committed Nov 14, 2005
1 parent ad5ea3c commit f6a2382
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit f6a2382

Please sign in to comment.