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

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

 



The patch titled

     tpm-use-clear_bit-fix

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

     tpm-use-clear_bit-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: Andrew Morton <akpm@xxxxxxxx>

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

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

diff -puN drivers/char/tpm/tpm.c~tpm-use-clear_bit-fix drivers/char/tpm/tpm.c
--- devel/drivers/char/tpm/tpm.c~tpm-use-clear_bit-fix	2006-04-14 23:42:05.000000000 -0700
+++ devel-akpm/drivers/char/tpm/tpm.c	2006-04-14 23:42:05.000000000 -0700
@@ -32,7 +32,6 @@ enum tpm_const {
 	TPM_MINOR = 224,	/* officially assigned */
 	TPM_BUFSIZE = 2048,
 	TPM_NUM_DEVICES = 256,
-	TPM_NUM_MASK_ENTRIES = TPM_NUM_DEVICES / (8 * sizeof(unsigned long))
 };
 
 enum tpm_duration {
@@ -48,7 +47,8 @@ enum tpm_duration {
 
 static LIST_HEAD(tpm_chip_list);
 static DEFINE_SPINLOCK(driver_lock);
-static unsigned long dev_mask[TPM_NUM_MASK_ENTRIES];
+static unsigned long dev_mask[(TPM_NUM_DEVICES + BITS_PER_LONG - 1) /
+				BITS_PER_LONG];
 
 /*
  * Array with one entry per ordinal defining the maximum amount
@@ -1038,7 +1038,7 @@ void tpm_remove_hardware(struct device *
 	sysfs_remove_group(&dev->kobj, chip->vendor.attr_group);
 	tpm_bios_log_teardown(chip->bios_dir);
 
-	clear_bit(chip->dev_num , dev_mask);
+	clear_bit(chip->dev_num, dev_mask);
 
 	kfree(chip);
 
@@ -1096,7 +1096,7 @@ struct tpm_chip *tpm_register_hardware(s
 
 	char *devname;
 	struct tpm_chip *chip;
-	int i, j;
+	int dev_num;
 
 	/* Driver specific per-device data */
 	chip = kzalloc(sizeof(*chip), GFP_KERNEL);
@@ -1117,16 +1117,15 @@ struct tpm_chip *tpm_register_hardware(s
 
 	chip->dev_num = -1;
 
-	for (i = 0; i < TPM_NUM_MASK_ENTRIES; i++)
-		for (j = 0; j < 8 * sizeof(int); j++)
-			if ((dev_mask[i] & (1 << j)) == 0) {
-				chip->dev_num =
-				    i * TPM_NUM_MASK_ENTRIES + j;
-				set_bit(chip->dev_num, dev_mask);
-				goto dev_num_search_complete;
-			}
+	/* 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;
+		}
+	}
 
-dev_num_search_complete:
 	if (chip->dev_num < 0) {
 		dev_err(dev, "No available tpm device numbers\n");
 		kfree(chip);
@@ -1150,7 +1149,7 @@ dev_num_search_complete:
 			chip->vendor.miscdev.minor);
 		put_device(dev);
 		kfree(chip);
-		dev_mask[i] &= !(1 << j);
+		clear_bit(dev_num, dev_mask);
 		return NULL;
 	}
 
_

Patches currently in -mm which might be from akpm@xxxxxxxx are

origin.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