lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150226012353.GC25965@dtor-ws>
Date:	Wed, 25 Feb 2015 17:23:53 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Jaewon Kim <jaewon02.kim@...sung.com>
Cc:	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	linux-pm@...r.kernel.org, linux-input@...r.kernel.org,
	Inki Dae <inki.dae@...sung.com>,
	SangBae Lee <sangbae90.lee@...sung.com>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Lee Jones <lee.jones@...aro.org>,
	Chanwoo Choi <cw00.choi@...sung.com>,
	Sebastian Reichel <sre@...nel.org>,
	Beomho Seo <beomho.seo@...sung.com>
Subject: Re: [PATCH v6 4/5] Input: add haptic drvier on max77843

Hi Jaewon,

On Tue, Feb 24, 2015 at 10:29:07AM +0900, Jaewon Kim wrote:
> +static void max77843_haptic_play_work(struct work_struct *work)
> +{
> +	struct max77843_haptic *haptic =
> +			container_of(work, struct max77843_haptic, work);
> +	int error;
> +
> +	mutex_lock(&haptic->mutex);
> +
> +	if (haptic->suspended) {
> +		goto err_play;
> +	}
> +

You do not need braces around single statement. Also, this is not error
that you are handling, I'd prefer if we called this label out_unlock.

> +	error = max77843_haptic_set_duty_cycle(haptic);
> +	if (error) {
> +		dev_err(haptic->dev, "failed to set duty cycle: %d\n", error);
> +		goto err_play;
> +	}

Do you need to configure duty cycle if you stopping the playback? Or
maybe disabling pwm is enough?

> +
> +	if (haptic->magnitude) {
> +		error = max77843_haptic_enable(haptic);
> +		if (error)
> +			dev_err(haptic->dev,
> +					"cannot enable haptic: %d\n", error);
> +	} else {
> +		max77843_haptic_disable(haptic);
> +		if (error)
> +			dev_err(haptic->dev,
> +					"cannot disable haptic: %d\n", error);

What error? You did not assign it...

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ