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: <uwpyurbkr2s3r337bxe5zzisuciyaw7ergdmd66qyjhoaoxtuq@3e2ug5cc2fvh>
Date: Thu, 26 Dec 2024 23:32:55 -0500
From: Kurt Borja <kuurtb@...il.com>
To: Armin Wolf <W_Armin@....de>
Cc: platform-driver-x86@...r.kernel.org, ilpo.jarvinen@...ux.intel.com, 
	mario.limonciello@....com, hdegoede@...hat.com, linux-kernel@...r.kernel.org, 
	Dell.Client.Kernel@...l.com
Subject: Re: [PATCH 02/20] alienware-wmi: Move Lighting Control State

On Fri, Dec 27, 2024 at 01:35:03AM +0100, Armin Wolf wrote:
> Am 21.12.24 um 06:58 schrieb Kurt Borja:
> 
> > Place Lighting Control State logic next to other attributes of the same
> > sysfs group.
> > 
> > While at it, rename:
> > 
> > store_control_state()	-> lighting_control_state_store()
> > show_control_state()	-> lighting_control_state_show()
> > 
> > Replace DEVICE_ATTR_RW() with DEVICE_ATTR() and do a general style
> > cleanup.
> 
> I think you mixed-up DEVICE_ATTR_RW() and DEVICE_ATTR() here.
> Other than that:

Fixed in v2!

> 
> Reviewed-by: Armin Wolf <W_Armin@....de>
> 
> > 
> > Signed-off-by: Kurt Borja <kuurtb@...il.com>
> > ---
> >   drivers/platform/x86/dell/alienware-wmi.c | 74 ++++++++++++-----------
> >   1 file changed, 39 insertions(+), 35 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/dell/alienware-wmi.c b/drivers/platform/x86/dell/alienware-wmi.c
> > index ed66720260ab..c5ad0f95c442 100644
> > --- a/drivers/platform/x86/dell/alienware-wmi.c
> > +++ b/drivers/platform/x86/dell/alienware-wmi.c
> > @@ -545,6 +545,45 @@ static ssize_t zone_set(struct device *dev, struct device_attribute *attr,
> >   	return ret ? ret : count;
> >   }
> > 
> > +/*
> > + * Lighting control state device attribute (Global)
> > + */
> > +static ssize_t lighting_control_state_show(struct device *dev,
> > +					   struct device_attribute *attr,
> > +					   char *buf)
> > +{
> > +	if (lighting_control_state == LEGACY_BOOTING)
> > +		return sysfs_emit(buf, "[booting] running suspend\n");
> > +	else if (lighting_control_state == LEGACY_SUSPEND)
> > +		return sysfs_emit(buf, "booting running [suspend]\n");
> > +
> > +	return sysfs_emit(buf, "booting [running] suspend\n");
> > +}
> > +
> > +static ssize_t lighting_control_state_store(struct device *dev,
> > +					    struct device_attribute *attr,
> > +					    const char *buf, size_t count)
> > +{
> > +	u8 val;
> > +
> > +	if (strcmp(buf, "booting\n") == 0)
> > +		val = LEGACY_BOOTING;
> > +	else if (strcmp(buf, "suspend\n") == 0)
> > +		val = LEGACY_SUSPEND;
> > +	else if (interface == LEGACY)
> > +		val = LEGACY_RUNNING;
> > +	else
> > +		val = WMAX_RUNNING;
> > +
> > +	lighting_control_state = val;
> > +	pr_debug("alienware-wmi: updated control state to %d\n",
> > +		 lighting_control_state);
> > +
> > +	return count;
> > +}
> > +
> > +static DEVICE_ATTR_RW(lighting_control_state);
> > +
> >   /*
> >    * LED Brightness (Global)
> >    */
> > @@ -589,41 +628,6 @@ static struct led_classdev global_led = {
> >   	.name = "alienware::global_brightness",
> >   };
> > 
> > -/*
> > - * Lighting control state device attribute (Global)
> > - */
> > -static ssize_t show_control_state(struct device *dev,
> > -				  struct device_attribute *attr, char *buf)
> > -{
> > -	if (lighting_control_state == LEGACY_BOOTING)
> > -		return sysfs_emit(buf, "[booting] running suspend\n");
> > -	else if (lighting_control_state == LEGACY_SUSPEND)
> > -		return sysfs_emit(buf, "booting running [suspend]\n");
> > -	return sysfs_emit(buf, "booting [running] suspend\n");
> > -}
> > -
> > -static ssize_t store_control_state(struct device *dev,
> > -				   struct device_attribute *attr,
> > -				   const char *buf, size_t count)
> > -{
> > -	long unsigned int val;
> > -	if (strcmp(buf, "booting\n") == 0)
> > -		val = LEGACY_BOOTING;
> > -	else if (strcmp(buf, "suspend\n") == 0)
> > -		val = LEGACY_SUSPEND;
> > -	else if (interface == LEGACY)
> > -		val = LEGACY_RUNNING;
> > -	else
> > -		val = WMAX_RUNNING;
> > -	lighting_control_state = val;
> > -	pr_debug("alienware-wmi: updated control state to %d\n",
> > -		 lighting_control_state);
> > -	return count;
> > -}
> > -
> > -static DEVICE_ATTR(lighting_control_state, 0644, show_control_state,
> > -		   store_control_state);
> > -
> >   static int alienware_zone_init(struct platform_device *dev)
> >   {
> >   	u8 zone;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ