Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1382010 > unrolled thread
| Started by | "H. Nikolaus Schaller" <hns@goldelico.com> |
|---|---|
| First post | 2016-04-18 22:00 +0200 |
| Last post | 2016-04-18 23:50 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 4/5] input: twl6040-vibra: ignore return value of schedule_work "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-04-18 22:00 +0200
Re: [PATCH 4/5] input: twl6040-vibra: ignore return value of schedule_work Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-04-18 23:50 +0200
| From | "H. Nikolaus Schaller" <hns@goldelico.com> |
|---|---|
| Date | 2016-04-18 22:00 +0200 |
| Subject | [PATCH 4/5] input: twl6040-vibra: ignore return value of schedule_work |
| Message-ID | <rpnuV-2F6-5@gated-at.bofh.it> |
returning ret is wrong. And checking for an error as well. User space
may call multiple times until the work is really scheduled.
twl4030-vibra.c also ignores the return value.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
drivers/input/misc/twl6040-vibra.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
index 3805129..69c5940 100644
--- a/drivers/input/misc/twl6040-vibra.c
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -212,11 +212,7 @@ static int vibra_play(struct input_dev *input, void *data,
info->strong_speed = effect->u.rumble.strong_magnitude;
info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1;
- ret = schedule_work(&info->play_work);
- if (!ret) {
- dev_info(&input->dev, "work is already on queue\n");
- return ret;
- }
+ schedule_work(&info->play_work);
return 0;
}
--
2.7.3
[toc] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2016-04-18 23:50 +0200 |
| Subject | Re: [PATCH 4/5] input: twl6040-vibra: ignore return value of schedule_work |
| Message-ID | <rppdo-49W-5@gated-at.bofh.it> |
| In reply to | #1382010 |
On Mon, Apr 18, 2016 at 09:55:40PM +0200, H. Nikolaus Schaller wrote:
> returning ret is wrong. And checking for an error as well. User space
> may call multiple times until the work is really scheduled.
>
> twl4030-vibra.c also ignores the return value.
>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Applied, thank you.
> ---
> drivers/input/misc/twl6040-vibra.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
> index 3805129..69c5940 100644
> --- a/drivers/input/misc/twl6040-vibra.c
> +++ b/drivers/input/misc/twl6040-vibra.c
> @@ -212,11 +212,7 @@ static int vibra_play(struct input_dev *input, void *data,
> info->strong_speed = effect->u.rumble.strong_magnitude;
> info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1;
>
> - ret = schedule_work(&info->play_work);
> - if (!ret) {
> - dev_info(&input->dev, "work is already on queue\n");
> - return ret;
> - }
> + schedule_work(&info->play_work);
>
> return 0;
> }
> --
> 2.7.3
>
--
Dmitry
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web