diff for duplicates of <4CF6316D.5090402@cam.ac.uk> diff --git a/a/1.txt b/N1/1.txt index f9ccb0a..ae5214f 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -409,7 +409,7 @@ Jumping a long way... Loose this test. > + struct lsm303dlh_a_data *ddata = platform_get_drvdata(pdev); > + int ret = 0; > + -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) { +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return ret; @@ -440,10 +440,10 @@ Jumping a long way... Loose this test. > + struct input_dev *input; > + > + /* know your interrupt source */ -> + if (irq = gpio_to_irq(ddata->pdata.irq_a1)) { +> + if (irq == gpio_to_irq(ddata->pdata.irq_a1)) { > + reg = INT1_SRC; > + input = ddata->input_dev; -> + } else if (irq = gpio_to_irq(ddata->pdata.irq_a2)) { +> + } else if (irq == gpio_to_irq(ddata->pdata.irq_a2)) { > + reg = INT2_SRC; > + input = ddata->input_dev2; > + } else { @@ -492,7 +492,7 @@ Jumping a long way... Loose this test. > + unsigned long val; > + int error; > + -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) { +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return count; @@ -565,7 +565,7 @@ Jumping a long way... Loose this test. > + unsigned long val; > + int error; > + -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) { +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return count; @@ -579,7 +579,7 @@ Jumping a long way... Loose this test. > + > + ddata->interrupt_configure[ddata->interrupt_channel] = val; > + -> + if (ddata->interrupt_channel = 0x0) +> + if (ddata->interrupt_channel == 0x0) > + error = lsm303dlh_a_write(ddata, INT1_CFG, val, "INT1_CFG"); > + else > + error = lsm303dlh_a_write(ddata, INT2_CFG, val, "INT2_CFG"); @@ -614,7 +614,7 @@ Jumping a long way... Loose this test. > + unsigned long val; > + int error; > + -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) { +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return count; @@ -628,7 +628,7 @@ Jumping a long way... Loose this test. > + > + ddata->interrupt_duration[ddata->interrupt_channel] = val; > + -> + if (ddata->interrupt_channel = 0x0) +> + if (ddata->interrupt_channel == 0x0) > + error = lsm303dlh_a_write(ddata, INT1_DURATION, val, > + "INT1_DURATION"); > + else @@ -665,7 +665,7 @@ Jumping a long way... Loose this test. > + unsigned long val; > + int error; > + -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) { +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return count; @@ -679,7 +679,7 @@ Jumping a long way... Loose this test. > + > + ddata->interrupt_threshold[ddata->interrupt_channel] = val; > + -> + if (ddata->interrupt_channel = 0x0) +> + if (ddata->interrupt_channel == 0x0) > + error = lsm303dlh_a_write(ddata, INT1_THS, val, "INT1_THS"); > + else > + error = lsm303dlh_a_write(ddata, INT2_THS, val, "INT2_THS"); @@ -714,7 +714,7 @@ Jumping a long way... Loose this test. > + unsigned long bdu_enabled_val; > + int error; > + -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) { +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return count; @@ -795,11 +795,11 @@ Jumping a long way... Loose this test. > + return -EINVAL; > + > + /* if same mode as existing, return */ -> + if (ddata->mode = val) +> + if (ddata->mode == val) > + return 0; > + > + /* turn on the supplies if already off */ -> + if (ddata->regulator && ddata->mode = LSM303DLH_A_MODE_OFF) { +> + if (ddata->regulator && ddata->mode == LSM303DLH_A_MODE_OFF) { > + regulator_enable(ddata->regulator); > +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE > + enable_irq(gpio_to_irq(ddata->pdata.irq_a1)); @@ -827,7 +827,7 @@ Jumping a long way... Loose this test. > + > + mutex_unlock(&ddata->lock); > + -> + if (val = LSM303DLH_A_MODE_OFF) { +> + if (val == LSM303DLH_A_MODE_OFF) { > +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE > + disable_irq(gpio_to_irq(ddata->pdata.irq_a1)); > + disable_irq(gpio_to_irq(ddata->pdata.irq_a2)); @@ -869,7 +869,7 @@ Jumping a long way... Loose this test. > + unsigned char data; > + int error; > + -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) { +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return count; @@ -976,7 +976,7 @@ you want to reopen that discussion. Why assign it to NULL? > + > + ddata = kzalloc(sizeof(struct lsm303dlh_a_data), GFP_KERNEL); -> + if (ddata = NULL) { +> + if (ddata == NULL) { > + ret = -ENOMEM; > + goto err_op_failed; > + } @@ -1153,7 +1153,7 @@ roll into line above. > + > + ddata = dev_get_drvdata(dev); > + -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) > + return 0; > + > +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE @@ -1179,7 +1179,7 @@ roll into line above. roll into the first line of function. > + > + /* in correct mode, no need to change it */ -> + if (ddata->mode = LSM303DLH_A_MODE_OFF) +> + if (ddata->mode == LSM303DLH_A_MODE_OFF) > + return 0; > + > +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE @@ -1464,7 +1464,7 @@ Looks suspiciously like a magic number. Could be wrong... > + unsigned char data; > + int error; > + -> + if (ddata->mode = LSM303DLH_M_MODE_SLEEP) { +> + if (ddata->mode == LSM303DLH_M_MODE_SLEEP) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return count; @@ -1545,7 +1545,7 @@ Do the mutex unlock then check the error condition to save yourself a couple of > + struct lsm303dlh_m_data *ddata = platform_get_drvdata(pdev); > + int ret = 0; > + -> + if (ddata->mode = LSM303DLH_M_MODE_SLEEP) { +> + if (ddata->mode == LSM303DLH_M_MODE_SLEEP) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return ret; @@ -1643,7 +1643,7 @@ gpio_to_irq on the gpio. Hence just pass the irq number in to start with. > + > + int error; > + -> + if (ddata->mode = LSM303DLH_M_MODE_SLEEP) { +> + if (ddata->mode == LSM303DLH_M_MODE_SLEEP) { > + dev_info(&ddata->client->dev, > + "device is switched off,make it ON using MODE"); > + return count; @@ -1730,11 +1730,11 @@ This is looking suspicously like another set of magic numbers.... > + return error; > + > + /* if same mode as existing, return */ -> + if (ddata->mode = mode) +> + if (ddata->mode == mode) > + return 0; > + > + /* turn on the supplies if already off */ -> + if (ddata->mode = LSM303DLH_M_MODE_SLEEP) { +> + if (ddata->mode == LSM303DLH_M_MODE_SLEEP) { > + regulator_enable(ddata->regulator); > + > +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE @@ -1755,7 +1755,7 @@ a review point of view. > + if (error < 0) > + return error; > + -> + if (mode = LSM303DLH_M_MODE_SLEEP) { +> + if (mode == LSM303DLH_M_MODE_SLEEP) { > + > +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE > + disable_irq(gpio_to_irq(ddata->pdata.irq_m)); @@ -1860,7 +1860,7 @@ if it fails... > + unsigned char version[3]; > + > + ddata = kzalloc(sizeof(struct lsm303dlh_m_data), GFP_KERNEL); -> + if (ddata = NULL) { +> + if (ddata == NULL) { > + ret = -ENOMEM; > + goto err_op_failed; > + } @@ -2007,7 +2007,7 @@ I'd roll the previous two lines together. struct lsm303dlh_m_data *ddata = dev_get_drvdata(dev)l is cleaner than doing it in two lines. > + -> + if (ddata->mode = LSM303DLH_M_MODE_SLEEP) +> + if (ddata->mode == LSM303DLH_M_MODE_SLEEP) > + return 0; > + > +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE @@ -2031,7 +2031,7 @@ is cleaner than doing it in two lines. same as previous one. > + > + /* in correct mode, no need to change it */ -> + if (ddata->mode = LSM303DLH_M_MODE_SLEEP) +> + if (ddata->mode == LSM303DLH_M_MODE_SLEEP) > + return 0; > + There are a lot of thes input related ifdefs. @@ -2163,9 +2163,3 @@ accelerometer > +#endif /* __KERNEL__ */ > + > +#endif /* __LSM303DLH_H__ */ - - -_______________________________________________ -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 cdabf33..46b9c51 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,6 +1,6 @@ "ref\01291180447-16570-1-git-send-email-chethan.krishna@stericsson.com\0" "From\0Jonathan Cameron <jic23@cam.ac.uk>\0" - "Subject\0Re: [lm-sensors] [PATCH] lsm303dlh: Adding Accelerometer\0" + "Subject\0Re: [lm-sensors] [PATCH] lsm303dlh: Adding Accelerometer and\tMagnetometer support\0" "Date\0Wed, 01 Dec 2010 11:28:45 +0000\0" "To\0Chethan Krishna N <chethan.krishna@stericsson.com>\0" "Cc\0khali@linux-fr.org" @@ -426,7 +426,7 @@ "> +\tstruct lsm303dlh_a_data *ddata = platform_get_drvdata(pdev);\n" "> +\tint ret = 0;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn ret;\n" @@ -457,10 +457,10 @@ "> +\tstruct input_dev *input;\n" "> +\n" "> +\t/* know your interrupt source */\n" - "> +\tif (irq = gpio_to_irq(ddata->pdata.irq_a1)) {\n" + "> +\tif (irq == gpio_to_irq(ddata->pdata.irq_a1)) {\n" "> +\t\treg = INT1_SRC;\n" "> +\t\tinput = ddata->input_dev;\n" - "> +\t} else if (irq = gpio_to_irq(ddata->pdata.irq_a2)) {\n" + "> +\t} else if (irq == gpio_to_irq(ddata->pdata.irq_a2)) {\n" "> +\t\treg = INT2_SRC;\n" "> +\t\tinput = ddata->input_dev2;\n" "> +\t} else {\n" @@ -509,7 +509,7 @@ "> +\tunsigned long val;\n" "> +\tint error;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn count;\n" @@ -582,7 +582,7 @@ "> +\tunsigned long val;\n" "> +\tint error;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn count;\n" @@ -596,7 +596,7 @@ "> +\n" "> +\tddata->interrupt_configure[ddata->interrupt_channel] = val;\n" "> +\n" - "> +\tif (ddata->interrupt_channel = 0x0)\n" + "> +\tif (ddata->interrupt_channel == 0x0)\n" "> +\t\terror = lsm303dlh_a_write(ddata, INT1_CFG, val, \"INT1_CFG\");\n" "> +\telse\n" "> +\t\terror = lsm303dlh_a_write(ddata, INT2_CFG, val, \"INT2_CFG\");\n" @@ -631,7 +631,7 @@ "> +\tunsigned long val;\n" "> +\tint error;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn count;\n" @@ -645,7 +645,7 @@ "> +\n" "> +\tddata->interrupt_duration[ddata->interrupt_channel] = val;\n" "> +\n" - "> +\tif (ddata->interrupt_channel = 0x0)\n" + "> +\tif (ddata->interrupt_channel == 0x0)\n" "> +\t\terror = lsm303dlh_a_write(ddata, INT1_DURATION, val,\n" "> +\t\t\t\t\"INT1_DURATION\");\n" "> +\telse\n" @@ -682,7 +682,7 @@ "> +\tunsigned long val;\n" "> +\tint error;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn count;\n" @@ -696,7 +696,7 @@ "> +\n" "> +\tddata->interrupt_threshold[ddata->interrupt_channel] = val;\n" "> +\n" - "> +\tif (ddata->interrupt_channel = 0x0)\n" + "> +\tif (ddata->interrupt_channel == 0x0)\n" "> +\t\terror = lsm303dlh_a_write(ddata, INT1_THS, val, \"INT1_THS\");\n" "> +\telse\n" "> +\t\terror = lsm303dlh_a_write(ddata, INT2_THS, val, \"INT2_THS\");\n" @@ -731,7 +731,7 @@ "> +\tunsigned long bdu_enabled_val;\n" "> +\tint error;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn count;\n" @@ -812,11 +812,11 @@ "> +\t\treturn -EINVAL;\n" "> +\n" "> +\t/* if same mode as existing, return */\n" - "> +\tif (ddata->mode = val)\n" + "> +\tif (ddata->mode == val)\n" "> +\t\treturn 0;\n" "> +\n" "> +\t/* turn on the supplies if already off */\n" - "> +\tif (ddata->regulator && ddata->mode = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (ddata->regulator && ddata->mode == LSM303DLH_A_MODE_OFF) {\n" "> +\t\tregulator_enable(ddata->regulator);\n" "> +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE\n" "> +\t\tenable_irq(gpio_to_irq(ddata->pdata.irq_a1));\n" @@ -844,7 +844,7 @@ "> +\n" "> +\tmutex_unlock(&ddata->lock);\n" "> +\n" - "> +\tif (val = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (val == LSM303DLH_A_MODE_OFF) {\n" "> +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE\n" "> +\t\tdisable_irq(gpio_to_irq(ddata->pdata.irq_a1));\n" "> +\t\tdisable_irq(gpio_to_irq(ddata->pdata.irq_a2));\n" @@ -886,7 +886,7 @@ "> +\tunsigned char data;\n" "> +\tint error;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF) {\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn count;\n" @@ -993,7 +993,7 @@ "Why assign it to NULL? \n" "> +\n" "> +\tddata = kzalloc(sizeof(struct lsm303dlh_a_data), GFP_KERNEL);\n" - "> +\tif (ddata = NULL) {\n" + "> +\tif (ddata == NULL) {\n" "> +\t\tret = -ENOMEM;\n" "> +\t\tgoto err_op_failed;\n" "> +\t}\n" @@ -1170,7 +1170,7 @@ "> +\n" "> +\tddata = dev_get_drvdata(dev);\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF)\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF)\n" "> +\t\treturn 0;\n" "> +\n" "> +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE\n" @@ -1196,7 +1196,7 @@ "roll into the first line of function.\n" "> +\n" "> +\t/* in correct mode, no need to change it */\n" - "> +\tif (ddata->mode = LSM303DLH_A_MODE_OFF)\n" + "> +\tif (ddata->mode == LSM303DLH_A_MODE_OFF)\n" "> +\t\treturn 0;\n" "> +\n" "> +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE\n" @@ -1481,7 +1481,7 @@ "> +\tunsigned char data;\n" "> +\tint error;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_M_MODE_SLEEP) {\n" + "> +\tif (ddata->mode == LSM303DLH_M_MODE_SLEEP) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn count;\n" @@ -1562,7 +1562,7 @@ "> +\tstruct lsm303dlh_m_data *ddata = platform_get_drvdata(pdev);\n" "> +\tint ret = 0;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_M_MODE_SLEEP) {\n" + "> +\tif (ddata->mode == LSM303DLH_M_MODE_SLEEP) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn ret;\n" @@ -1660,7 +1660,7 @@ "> +\n" "> +\tint error;\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_M_MODE_SLEEP) {\n" + "> +\tif (ddata->mode == LSM303DLH_M_MODE_SLEEP) {\n" "> +\t\tdev_info(&ddata->client->dev,\n" "> +\t\t\t\t\"device is switched off,make it ON using MODE\");\n" "> +\t\treturn count;\n" @@ -1747,11 +1747,11 @@ "> +\t\treturn error;\n" "> +\n" "> +\t/* if same mode as existing, return */\n" - "> +\tif (ddata->mode = mode)\n" + "> +\tif (ddata->mode == mode)\n" "> +\t\treturn 0;\n" "> +\n" "> +\t/* turn on the supplies if already off */\n" - "> +\tif (ddata->mode = LSM303DLH_M_MODE_SLEEP) {\n" + "> +\tif (ddata->mode == LSM303DLH_M_MODE_SLEEP) {\n" "> +\t\tregulator_enable(ddata->regulator);\n" "> +\n" "> +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE\n" @@ -1772,7 +1772,7 @@ "> +\tif (error < 0)\n" "> +\t\treturn error;\n" "> +\n" - "> +\tif (mode = LSM303DLH_M_MODE_SLEEP) {\n" + "> +\tif (mode == LSM303DLH_M_MODE_SLEEP) {\n" "> +\n" "> +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE\n" "> +\t\tdisable_irq(gpio_to_irq(ddata->pdata.irq_m));\n" @@ -1877,7 +1877,7 @@ "> +\tunsigned char version[3];\n" "> +\n" "> +\tddata = kzalloc(sizeof(struct lsm303dlh_m_data), GFP_KERNEL);\n" - "> +\tif (ddata = NULL) {\n" + "> +\tif (ddata == NULL) {\n" "> +\t\tret = -ENOMEM;\n" "> +\t\tgoto err_op_failed;\n" "> +\t}\n" @@ -2024,7 +2024,7 @@ "struct lsm303dlh_m_data *ddata = dev_get_drvdata(dev)l\n" "is cleaner than doing it in two lines.\n" "> +\n" - "> +\tif (ddata->mode = LSM303DLH_M_MODE_SLEEP)\n" + "> +\tif (ddata->mode == LSM303DLH_M_MODE_SLEEP)\n" "> +\t\treturn 0;\n" "> +\n" "> +#ifdef CONFIG_SENSORS_LSM303DLH_INPUT_DEVICE\n" @@ -2048,7 +2048,7 @@ "same as previous one.\n" "> +\n" "> +\t/* in correct mode, no need to change it */\n" - "> +\tif (ddata->mode = LSM303DLH_M_MODE_SLEEP)\n" + "> +\tif (ddata->mode == LSM303DLH_M_MODE_SLEEP)\n" "> +\t\treturn 0;\n" "> +\n" "There are a lot of thes input related ifdefs. \n" @@ -2179,12 +2179,6 @@ "> +};\n" "> +#endif /* __KERNEL__ */\n" "> +\n" - "> +#endif /* __LSM303DLH_H__ */\n" - "\n" - "\n" - "_______________________________________________\n" - "lm-sensors mailing list\n" - "lm-sensors@lm-sensors.org\n" - http://lists.lm-sensors.org/mailman/listinfo/lm-sensors + > +#endif /* __LSM303DLH_H__ */ -221fa184cb2b851afc51e13a6bdb7e7d3e78d943d2167ebcdedbe901fd9ccad0 +5ece850b6b89f4680b00f223b21ba5573df25c5e62fdb817998d29ee0fc50f56
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.