Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc28a610d4fcce1831d26f2099e23fbb3eb7260c
Commit:     cc28a610d4fcce1831d26f2099e23fbb3eb7260c
Parent:     894c00cf3805670faddd41d3d5dcb3c0ab75a39d
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 18 18:48:16 2007 +0200
Committer:  Mark M. Hoffman <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 22:56:31 2007 -0400

    hwmon: (thmc50) Fix a debug message
    
    type_name was used before being set. See why I don't like play-it-safe
    variable initializations: they prevent the compiler from warning you
    about such mistakes. So fix that as well.
    
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
    Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]>
---
 drivers/hwmon/thmc50.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/thmc50.c b/drivers/hwmon/thmc50.c
index fb02834..04dd769 100644
--- a/drivers/hwmon/thmc50.c
+++ b/drivers/hwmon/thmc50.c
@@ -259,7 +259,7 @@ static int thmc50_detect(struct i2c_adapter *adapter, int 
address, int kind)
        struct thmc50_data *data;
        struct device *dev;
        int err = 0;
-       const char *type_name = "";
+       const char *type_name;
 
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
                pr_debug("thmc50: detect failed, "
@@ -309,13 +309,9 @@ static int thmc50_detect(struct i2c_adapter *adapter, int 
address, int kind)
                pr_debug("thmc50: Detection of THMC50/ADM1022 failed\n");
                goto exit_free;
        }
-       pr_debug("thmc50: Detected %s (version %x, revision %x)\n",
-                type_name, (revision >> 4) - 0xc, revision & 0xf);
        data->type = kind;
 
-       if (kind == thmc50)
-               type_name = "thmc50";
-       else if (kind == adm1022) {
+       if (kind == adm1022) {
                int id = i2c_adapter_id(client->adapter);
                int i;
 
@@ -328,7 +324,11 @@ static int thmc50_detect(struct i2c_adapter *adapter, int 
address, int kind)
                                data->has_temp3 = 1;
                                break;
                        }
+       } else {
+               type_name = "thmc50";
        }
+       pr_debug("thmc50: Detected %s (version %x, revision %x)\n",
+                type_name, (revision >> 4) - 0xc, revision & 0xf);
 
        /* Fill in the remaining client fields & put it into the global list */
        strlcpy(client->name, type_name, I2C_NAME_SIZE);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to