- tpm-use-clear_bit-fix-fix-fix.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     tpm: use find_first_zero_bit

has been removed from the -mm tree.  Its filename is

     tpm-use-clear_bit-fix-fix-fix.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.


From: Kylene Jo Hall <kjhall@xxxxxxxxxx>

Given the suggestion in the code of your use-clear_bit-fix.  This patch
uses find_first_zero_bit to find a bit instead of the roll my own for loop
solution.

Signed-off-by: Kylie Hall <kjhall@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/char/tpm/tpm.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff -puN drivers/char/tpm/tpm.c~tpm-use-clear_bit-fix-fix-fix drivers/char/tpm/tpm.c
--- devel/drivers/char/tpm/tpm.c~tpm-use-clear_bit-fix-fix-fix	2006-04-14 23:42:06.000000000 -0700
+++ devel-akpm/drivers/char/tpm/tpm.c	2006-04-14 23:42:06.000000000 -0700
@@ -1095,7 +1095,6 @@ struct tpm_chip *tpm_register_hardware(s
 
 	char *devname;
 	struct tpm_chip *chip;
-	int dev_num;
 
 	/* Driver specific per-device data */
 	chip = kzalloc(sizeof(*chip), GFP_KERNEL);
@@ -1114,18 +1113,9 @@ struct tpm_chip *tpm_register_hardware(s
 
 	memcpy(&chip->vendor, entry, sizeof(struct tpm_vendor_specific));
 
-	chip->dev_num = -1;
+	chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES);
 
-	/* This should use find_first_zero_bit() */
-	for (dev_num = 0; dev_num < TPM_NUM_DEVICES; dev_num++) {
-		if (!test_bit(dev_num, dev_mask)) {
-			chip->dev_num = dev_num;
-			set_bit(dev_num, dev_mask);
-			break;
-		}
-	}
-
-	if (chip->dev_num < 0) {
+	if (chip->dev_num < 0 || chip->dev_num > TPM_NUM_DEVICES) {
 		dev_err(dev, "No available tpm device numbers\n");
 		kfree(chip);
 		return NULL;
@@ -1134,6 +1124,8 @@ struct tpm_chip *tpm_register_hardware(s
 	else
 		chip->vendor.miscdev.minor = MISC_DYNAMIC_MINOR;
 
+	set_bit(chip->dev_num, dev_mask);
+
 	devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);
 	scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num);
 	chip->vendor.miscdev.name = devname;
@@ -1148,7 +1140,7 @@ struct tpm_chip *tpm_register_hardware(s
 			chip->vendor.miscdev.minor);
 		put_device(dev);
 		kfree(chip);
-		clear_bit(dev_num, dev_mask);
+		clear_bit(chip->dev_num, dev_mask);
 		return NULL;
 	}
 
_

Patches currently in -mm which might be from kjhall@xxxxxxxxxx are

tpm-fix-memory-leak.patch
tpm-fix-missing-string.patch
tpm-spacing-cleanups.patch
tpm-reorganize-sysfs-files.patch
tpm-chip-struct-update.patch
tpm-return-chip-from-tpm_register_hardware.patch
tpm-command-duration-update.patch
tpm-new-12-sysfs-files.patch
tpm-driver-for-next-generation-tpm-chips.patch
tpm-msecs_to_jiffies-cleanups.patch
tpm-use-clear_bit.patch
tpm-tpm_infineon-updated-to-latest-interface-changes.patch
tpm-check-mem-start-and-len.patch
tpm-update-bios-log-code-for-12.patch
tpm_infineon-section-fixup.patch
tpm-spacing-cleanups-2.patch
tpm-add-interrupt-module-parameter.patch
tpm-add-hid-module-paramater.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux