diff for duplicates of <20101021064145.GA25095@ericsson.com> diff --git a/a/1.txt b/N1/1.txt index 2d3a3fe..a4ac867 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -122,7 +122,8 @@ I would prefer a bool here. After all, that is what it is. > + > +static void fan_alarm_notify(struct work_struct *ws) > +{ -> + struct gpio_fan_data *fan_data > + container_of(ws, struct gpio_fan_data, alarm_work); +> + struct gpio_fan_data *fan_data = +> + container_of(ws, struct gpio_fan_data, alarm_work); > + > + sysfs_notify(&fan_data->pdev->dev.kobj, NULL, "fan1_alarm"); > + kobject_uevent(&fan_data->pdev->dev.kobj, KOBJ_CHANGE); @@ -243,7 +244,7 @@ Such as "Must be called with data->update_lock held, except during initializatio > +static void set_fan_speed(struct gpio_fan_data *fan_data, int speed_index) > +{ -> + if (fan_data->speed_index = speed_index) +> + if (fan_data->speed_index == speed_index) > + return; > + > + __set_fan_ctrl(fan_data, fan_data->speed[speed_index].ctrl_val); @@ -260,7 +261,7 @@ really return the speed, but an index to the speed table. > + int i; > + > + for (i = 0; i < fan_data->num_speed; i++) -> + if (fan_data->speed[i].ctrl_val = ctrl_val) +> + if (fan_data->speed[i].ctrl_val == ctrl_val) > + return i; > + > + dev_warn(&fan_data->pdev->dev, @@ -344,11 +345,11 @@ The combination of DIV_ROUND_UP() and DIV_ROUND_CLOSEST() causes inconsistency. Assume num_speed = 8, pwm is set to 128. -set: 128 * (8 - 1) / 255 = 3.513 => 4 -get: 4 * 255 / (8 - 1) = 145.7 => 146 -set: 146 * (8 - 1) / 255 = 4.007 => 5 -get: 5 * 255 / (8 - 1) = 182.142 => 182 -set: 182 * (8 - 1) / 255 = 4.996 => 5 +set: 128 * (8 - 1) / 255 = 3.513 ==> 4 +get: 4 * 255 / (8 - 1) = 145.7 ==> 146 +set: 146 * (8 - 1) / 255 = 4.007 ==> 5 +get: 5 * 255 / (8 - 1) = 182.142 ==> 182 +set: 182 * (8 - 1) / 255 = 4.996 ==> 5 Unless there is a really good reason to use DIV_ROUND_UP(), you might want to use DIV_ROUND_CLOSEST() instead. @@ -378,7 +379,7 @@ want to use DIV_ROUND_CLOSEST() instead. > + if (strict_strtoul(buf, 10, &val) || val > 1) > + return -EINVAL; > + -> + if (fan_data->pwm_enable = val) +> + if (fan_data->pwm_enable == val) > + return count; > + > + mutex_lock(&fan_data->lock); @@ -386,7 +387,7 @@ want to use DIV_ROUND_CLOSEST() instead. > + fan_data->pwm_enable = val; > + > + /* Disable manual control mode: set fan at full speed. */ -> + if (val = 0) +> + if (val == 0) > + set_fan_speed(fan_data, fan_data->num_speed - 1); > + > + mutex_unlock(&fan_data->lock); @@ -585,7 +586,7 @@ It could be negative, which would be bad. > + if (!pdata->num_speed || !pdata->speed) { -num_speed must be > 1. Otherwise there is a risk of division by zero if it is = 1. +num_speed must be > 1. Otherwise there is a risk of division by zero if it is == 1. > + err = -EINVAL; > + goto err_free_alarm; @@ -738,9 +739,4 @@ num_speed must be > 1. Otherwise there is a risk of division by zero if it is = > +#endif /* __LINUX_GPIO_FAN_H */ > -- > 1.6.3.1 -> - -_______________________________________________ -lm-sensors mailing list -lm-sensors@lm-sensors.org -http://lists.lm-sensors.org/mailman/listinfo/lm-sensors +> diff --git a/a/content_digest b/N1/content_digest index 252717d..2b70110 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,8 +1,8 @@ "ref\01287592646-18109-1-git-send-email-sguinot@lacie.com\0" "ref\01287592646-18109-2-git-send-email-sguinot@lacie.com\0" - "From\0Guenter Roeck <guenter.roeck@ericsson.com>\0" - "Subject\0Re: [lm-sensors] [PATCH v2] hwmon: add generic GPIO fan driver\0" - "Date\0Thu, 21 Oct 2010 06:41:45 +0000\0" + "From\0guenter.roeck@ericsson.com (Guenter Roeck)\0" + "Subject\0[PATCH v2] hwmon: add generic GPIO fan driver\0" + "Date\0Wed, 20 Oct 2010 23:41:45 -0700\0" "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" "b\0" @@ -130,7 +130,8 @@ "> +\n" "> +static void fan_alarm_notify(struct work_struct *ws)\n" "> +{\n" - "> + struct gpio_fan_data *fan_data > + container_of(ws, struct gpio_fan_data, alarm_work);\n" + "> + struct gpio_fan_data *fan_data =\n" + "> + container_of(ws, struct gpio_fan_data, alarm_work);\n" "> +\n" "> + sysfs_notify(&fan_data->pdev->dev.kobj, NULL, \"fan1_alarm\");\n" "> + kobject_uevent(&fan_data->pdev->dev.kobj, KOBJ_CHANGE);\n" @@ -251,7 +252,7 @@ "\n" "> +static void set_fan_speed(struct gpio_fan_data *fan_data, int speed_index)\n" "> +{\n" - "> + if (fan_data->speed_index = speed_index)\n" + "> + if (fan_data->speed_index == speed_index)\n" "> + return;\n" "> +\n" "> + __set_fan_ctrl(fan_data, fan_data->speed[speed_index].ctrl_val);\n" @@ -268,7 +269,7 @@ "> + int i;\n" "> +\n" "> + for (i = 0; i < fan_data->num_speed; i++)\n" - "> + if (fan_data->speed[i].ctrl_val = ctrl_val)\n" + "> + if (fan_data->speed[i].ctrl_val == ctrl_val)\n" "> + return i;\n" "> +\n" "> + dev_warn(&fan_data->pdev->dev,\n" @@ -352,11 +353,11 @@ "\n" "Assume num_speed = 8, pwm is set to 128.\n" "\n" - "set: 128 * (8 - 1) / 255 = 3.513 => 4\n" - "get: 4 * 255 / (8 - 1) = 145.7 => 146\n" - "set: 146 * (8 - 1) / 255 = 4.007 => 5\n" - "get: 5 * 255 / (8 - 1) = 182.142 => 182\n" - "set: 182 * (8 - 1) / 255 = 4.996 => 5\n" + "set: 128 * (8 - 1) / 255 = 3.513 ==> 4\n" + "get: 4 * 255 / (8 - 1) = 145.7 ==> 146\n" + "set: 146 * (8 - 1) / 255 = 4.007 ==> 5\n" + "get: 5 * 255 / (8 - 1) = 182.142 ==> 182\n" + "set: 182 * (8 - 1) / 255 = 4.996 ==> 5\n" "\n" "Unless there is a really good reason to use DIV_ROUND_UP(), you might\n" "want to use DIV_ROUND_CLOSEST() instead.\n" @@ -386,7 +387,7 @@ "> + if (strict_strtoul(buf, 10, &val) || val > 1)\n" "> + return -EINVAL;\n" "> +\n" - "> + if (fan_data->pwm_enable = val)\n" + "> + if (fan_data->pwm_enable == val)\n" "> + return count;\n" "> +\n" "> + mutex_lock(&fan_data->lock);\n" @@ -394,7 +395,7 @@ "> + fan_data->pwm_enable = val;\n" "> +\n" "> + /* Disable manual control mode: set fan at full speed. */\n" - "> + if (val = 0)\n" + "> + if (val == 0)\n" "> + set_fan_speed(fan_data, fan_data->num_speed - 1);\n" "> +\n" "> + mutex_unlock(&fan_data->lock);\n" @@ -593,7 +594,7 @@ "\n" "> + if (!pdata->num_speed || !pdata->speed) {\n" "\n" - "num_speed must be > 1. Otherwise there is a risk of division by zero if it is = 1.\n" + "num_speed must be > 1. Otherwise there is a risk of division by zero if it is == 1.\n" "\n" "> + err = -EINVAL;\n" "> + goto err_free_alarm;\n" @@ -746,11 +747,6 @@ "> +#endif /* __LINUX_GPIO_FAN_H */\n" "> --\n" "> 1.6.3.1\n" - "> \n" - "\n" - "_______________________________________________\n" - "lm-sensors mailing list\n" - "lm-sensors@lm-sensors.org\n" - http://lists.lm-sensors.org/mailman/listinfo/lm-sensors + > -eb482a27655ba23e7cbf9d488e005e4de6e2cc3deb9f5d6bd4ede5d004503169 +87f2b287a7a8813617c98d7ae7a3176d89e14066777cc0adf69429f722c6267d
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.