linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set
@ 2019-10-18 22:42 Ayman Bagabas
  2019-10-18 22:42 ` [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name Ayman Bagabas
  2019-10-19  8:31 ` [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Dan Carpenter
  0 siblings, 2 replies; 6+ messages in thread
From: Ayman Bagabas @ 2019-10-18 22:42 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko, Ayman Bagabas, Mattias Jacobsson,
	Takashi Iwai, Dan Carpenter, kbuild test robot,
	platform-driver-x86, linux-kernel

Check if battery thresholds are within 0 and 100.
---
 drivers/platform/x86/huawei-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c
index 5837d1b8693d..26041d44286a 100644
--- a/drivers/platform/x86/huawei-wmi.c
+++ b/drivers/platform/x86/huawei-wmi.c
@@ -345,7 +345,7 @@ static int huawei_wmi_battery_set(int start, int end)
 	union hwmi_arg arg;
 	int err;
 
-	if (start < 0 || end > 100)
+	if (start < 0 || end < 0 || start > 100 || end > 100)
 		return -EINVAL;
 
 	arg.cmd = BATTERY_THRESH_SET;

base-commit: fd13c8622a5ad4f7317b64de4f6aa2de1962220e
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name
  2019-10-18 22:42 [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Ayman Bagabas
@ 2019-10-18 22:42 ` Ayman Bagabas
  2019-10-20  0:33   ` ayman.bagabas
  2019-10-19  8:31 ` [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Dan Carpenter
  1 sibling, 1 reply; 6+ messages in thread
From: Ayman Bagabas @ 2019-10-18 22:42 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko, Ayman Bagabas, Takashi Iwai,
	Mattias Jacobsson, Dan Carpenter, kbuild test robot,
	platform-driver-x86, linux-kernel

No need to check for battery name, we already check if the WMI function is
available in huawei_wmi_battery_setup.
---
 drivers/platform/x86/huawei-wmi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c
index 26041d44286a..7373a65a61d3 100644
--- a/drivers/platform/x86/huawei-wmi.c
+++ b/drivers/platform/x86/huawei-wmi.c
@@ -471,10 +471,6 @@ static DEVICE_ATTR_RW(charge_control_thresholds);
 
 static int huawei_wmi_battery_add(struct power_supply *battery)
 {
-	/* Huawei laptops come with one battery only */
-	if (strcmp(battery->desc->name, "BAT") != 1)
-		return -ENODEV;
-
 	device_create_file(&battery->dev, &dev_attr_charge_control_start_threshold);
 	device_create_file(&battery->dev, &dev_attr_charge_control_end_threshold);
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set
  2019-10-18 22:42 [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Ayman Bagabas
  2019-10-18 22:42 ` [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name Ayman Bagabas
@ 2019-10-19  8:31 ` Dan Carpenter
  2019-10-20  0:32   ` ayman.bagabas
  1 sibling, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2019-10-19  8:31 UTC (permalink / raw)
  To: Ayman Bagabas
  Cc: Darren Hart, Andy Shevchenko, Mattias Jacobsson, Takashi Iwai,
	kbuild test robot, platform-driver-x86, linux-kernel

On Fri, Oct 18, 2019 at 06:42:13PM -0400, Ayman Bagabas wrote:
> Check if battery thresholds are within 0 and 100.
> ---

Thanks!

Don't forget to add your Signed-off-by: though.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set
  2019-10-19  8:31 ` [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Dan Carpenter
@ 2019-10-20  0:32   ` ayman.bagabas
  2019-10-20  7:55     ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: ayman.bagabas @ 2019-10-20  0:32 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Darren Hart, Andy Shevchenko, Mattias Jacobsson, Takashi Iwai,
	kbuild test robot, platform-driver-x86, linux-kernel

On Sat, 2019-10-19 at 11:31 +0300, Dan Carpenter wrote:
> On Fri, Oct 18, 2019 at 06:42:13PM -0400, Ayman Bagabas wrote:
> > Check if battery thresholds are within 0 and 100.
> > ---
> 
> Thanks!
> 
> Don't forget to add your Signed-off-by: though.

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>

Thank you,
Ayman
> 
> regards,
> dan carpenter
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name
  2019-10-18 22:42 ` [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name Ayman Bagabas
@ 2019-10-20  0:33   ` ayman.bagabas
  0 siblings, 0 replies; 6+ messages in thread
From: ayman.bagabas @ 2019-10-20  0:33 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko, Takashi Iwai, Mattias Jacobsson,
	Dan Carpenter, kbuild test robot, platform-driver-x86,
	linux-kernel

On Fri, 2019-10-18 at 18:42 -0400, Ayman Bagabas wrote:
> No need to check for battery name, we already check if the WMI
> function is
> available in huawei_wmi_battery_setup.

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>

Thank you,
Ayman
> ---
>  drivers/platform/x86/huawei-wmi.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/platform/x86/huawei-wmi.c
> b/drivers/platform/x86/huawei-wmi.c
> index 26041d44286a..7373a65a61d3 100644
> --- a/drivers/platform/x86/huawei-wmi.c
> +++ b/drivers/platform/x86/huawei-wmi.c
> @@ -471,10 +471,6 @@ static
> DEVICE_ATTR_RW(charge_control_thresholds);
>  
>  static int huawei_wmi_battery_add(struct power_supply *battery)
>  {
> -	/* Huawei laptops come with one battery only */
> -	if (strcmp(battery->desc->name, "BAT") != 1)
> -		return -ENODEV;
> -
>  	device_create_file(&battery->dev,
> &dev_attr_charge_control_start_threshold);
>  	device_create_file(&battery->dev,
> &dev_attr_charge_control_end_threshold);
>  


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set
  2019-10-20  0:32   ` ayman.bagabas
@ 2019-10-20  7:55     ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2019-10-20  7:55 UTC (permalink / raw)
  To: Ayman Bagabas
  Cc: Dan Carpenter, Darren Hart, Andy Shevchenko, Mattias Jacobsson,
	Takashi Iwai, kbuild test robot, Platform Driver,
	Linux Kernel Mailing List

On Sun, Oct 20, 2019 at 3:33 AM <ayman.bagabas@gmail.com> wrote:
> On Sat, 2019-10-19 at 11:31 +0300, Dan Carpenter wrote:
> > On Fri, Oct 18, 2019 at 06:42:13PM -0400, Ayman Bagabas wrote:
> > > Check if battery thresholds are within 0 and 100.

> > Don't forget to add your Signed-off-by: though.

Please, resend all three with properly tagged with Sob, Fixes, etc.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-20  7:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 22:42 [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Ayman Bagabas
2019-10-18 22:42 ` [PATCH 2/2] platform/x86: huawei-wmi: No need to check for battery name Ayman Bagabas
2019-10-20  0:33   ` ayman.bagabas
2019-10-19  8:31 ` [PATCH 1/2] platform/x86: huawei-wmi: Stricter battery thresholds set Dan Carpenter
2019-10-20  0:32   ` ayman.bagabas
2019-10-20  7:55     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).