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: <20150722114516.023361c194227890febbce54@ao2.it>
Date:	Wed, 22 Jul 2015 11:45:16 +0200
From:	Antonio Ospite <ao2@....it>
To:	Jacek Anaszewski <j.anaszewski@...sung.com>
Cc:	linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
	cooloney@...il.com, rpurdie@...ys.net, stsp@...rs.sourceforge.net,
	Andrew Lunn <andrew@...n.ch>,
	Antonio Ospite <ospite@...denti.unina.it>
Subject: Re: [PATCH/RFC 15/51] leds: lp3944: Remove work queue

On Fri, 17 Jul 2015 10:47:01 +0200
Jacek Anaszewski <j.anaszewski@...sung.com> wrote:

> From: Andrew Lunn <andrew@...n.ch>
> 
> Now the core implements the work queue, remove it from the driver.
> 
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> Cc: Antonio Ospite <ospite@...denti.unina.it>

I can't test the changes but they look good to me.

Acked-by: Antonio Ospite <ao2@....it>

AFAICS now the status field may be dropped from struct
lp3944_led_data and the values passed directly to lp3944_led_set()

Not a big deal anyway, If you are not adding this change in the next
iteration I will eventually send the cleanup as a separate patch after
your change have been merged.

Thanks,
   Antonio

> ---
>  drivers/leds/leds-lp3944.c |   15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/leds/leds-lp3944.c b/drivers/leds/leds-lp3944.c
> index 53144fb..c5cb4b9 100644
> --- a/drivers/leds/leds-lp3944.c
> +++ b/drivers/leds/leds-lp3944.c
> @@ -31,7 +31,6 @@
>  #include <linux/slab.h>
>  #include <linux/leds.h>
>  #include <linux/mutex.h>
> -#include <linux/workqueue.h>
>  #include <linux/leds-lp3944.h>
>  
>  /* Read Only Registers */
> @@ -71,7 +70,6 @@ struct lp3944_led_data {
>  	enum lp3944_status status;
>  	struct led_classdev ldev;
>  	struct i2c_client *client;
> -	struct work_struct work;
>  };
>  
>  struct lp3944_data {
> @@ -276,7 +274,7 @@ static int lp3944_led_set_blink(struct led_classdev *led_cdev,
>  		__func__);
>  
>  	led->status = LP3944_LED_STATUS_DIM0;
> -	schedule_work(&led->work);
> +	lp3944_led_set(led, led->status);
>  
>  	return 0;
>  }
> @@ -290,14 +288,6 @@ static void lp3944_led_set_brightness(struct led_classdev *led_cdev,
>  		__func__, led_cdev->name, brightness);
>  
>  	led->status = !!brightness;
> -	schedule_work(&led->work);
> -}
> -
> -static void lp3944_led_work(struct work_struct *work)
> -{
> -	struct lp3944_led_data *led;
> -
> -	led = container_of(work, struct lp3944_led_data, work);
>  	lp3944_led_set(led, led->status);
>  }
>  
> @@ -325,7 +315,6 @@ static int lp3944_configure(struct i2c_client *client,
>  			led->ldev.blink_set = lp3944_led_set_blink;
>  			led->ldev.flags = LED_CORE_SUSPENDRESUME;
>  
> -			INIT_WORK(&led->work, lp3944_led_work);
>  			err = led_classdev_register(&client->dev, &led->ldev);
>  			if (err < 0) {
>  				dev_err(&client->dev,
> @@ -364,7 +353,6 @@ exit:
>  			case LP3944_LED_TYPE_LED:
>  			case LP3944_LED_TYPE_LED_INVERTED:
>  				led_classdev_unregister(&data->leds[i].ldev);
> -				cancel_work_sync(&data->leds[i].work);
>  				break;
>  
>  			case LP3944_LED_TYPE_NONE:
> @@ -424,7 +412,6 @@ static int lp3944_remove(struct i2c_client *client)
>  		case LP3944_LED_TYPE_LED:
>  		case LP3944_LED_TYPE_LED_INVERTED:
>  			led_classdev_unregister(&data->leds[i].ldev);
> -			cancel_work_sync(&data->leds[i].work);
>  			break;
>  
>  		case LP3944_LED_TYPE_NONE:
> -- 
> 1.7.9.5
> 


-- 
Antonio Ospite
http://ao2.it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
--
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