From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: mjg59@srcf.ucam.org, dvhart@infradead.org, andy@infradead.org,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: dell-laptop: Handle return error form dell_get_intensity.
Date: Thu, 9 Mar 2017 11:13:15 +0530 [thread overview]
Message-ID: <4b91fac9-9c76-24c0-47a3-28a589760725@gmail.com> (raw)
In-Reply-To: <20170308125406.GB30539@pali>
Hi,
Yes, you are right. I will handle return error correctly.
Thanks
-Arvind
On Wednesday 08 March 2017 06:24 PM, Pali Rohár wrote:
> Hi!
>
> On Wednesday 08 March 2017 17:52:27 Arvind Yadav wrote:
>> Here, dell_get_intensity can return an error.
> Right. That is truth and we should check for errors.
>
>> So we can assgine props.brightness as max_brightness.
> But why to max_brightness? Seems that this is incorrect handling of
> error too...
>
>> This change is done using Coccinelle.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>> drivers/platform/x86/dell-laptop.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
>> index f57dd28..0891de3 100644
>> --- a/drivers/platform/x86/dell-laptop.c
>> +++ b/drivers/platform/x86/dell-laptop.c
>> @@ -2053,6 +2053,9 @@ static int __init dell_init(void)
>>
>> dell_backlight_device->props.brightness =
>> dell_get_intensity(dell_backlight_device);
>> + if (dell_backlight_device->props.brightness < 0) {
>> + dell_backlight_device->props.brightness = props.max_brightness;
>> + }
>> backlight_update_status(dell_backlight_device);
>> }
>>
prev parent reply other threads:[~2017-03-09 5:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 12:22 [PATCH] platform/x86: dell-laptop: Handle return error form dell_get_intensity Arvind Yadav
2017-03-08 12:54 ` Pali Rohár
2017-03-09 5:43 ` Arvind Yadav [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4b91fac9-9c76-24c0-47a3-28a589760725@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=andy@infradead.org \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=pali.rohar@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox