if you agree

2019-07-16 Thread Allen
 My name is Mr. Allen, I have a Business Proposal of Four million five hundred 
thousand united states dollars for you to handle with me from my bank. I will 
need you to assist me in executing this Business 

Allen

aj4...@gmail.com
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



Re: [PATCH] drivers:staging/media:Use ARRAY_SIZE() for the size calculation of the array

2017-09-13 Thread Allen
>>
>> -#define array_length(array) (sizeof(array)/sizeof(array[0]))
>> +#define array_length(array) (ARRAY_SIZE(array))
>
> Just get rid of this array_length macro and use ARRAY_SIZE() directly.
>

 Sure.

   - Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] drivers:staging/media:Use ARRAY_SIZE() for the size calculation of the array

2017-09-13 Thread Allen
>
> This is going through linux-media and maybe they won't insist on some
> kind of commit message, but I know Greg does.

 Okay. I sent out a V3.

-- 
   - Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3] drivers/staging:[media]atomisp:use ARRAY_SIZE() instead of open coding.

2017-09-13 Thread Allen
> bad:  [PATCH v3] drivers/staging:[media]atomisp:use ARRAY_SIZE() instead of 
> open coding.
> good: [PATCH v4] [media] atomisp: use ARRAY_SIZE() instead of open coding.

My bad. Fixed it in V4. Thanks.

- Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] Modernize tasklet callback API

2020-08-03 Thread Allen
Kees,

>
> [heavily trimmed CC list because I think lkml is ignoring this
> thread...]
>
> On Thu, Jul 30, 2020 at 09:03:55AM +0200, Thomas Gleixner wrote:
> > Kees,
> >
> > Kees Cook  writes:
> > > This is the infrastructure changes to prepare the tasklet API for
> > > conversion to passing the tasklet struct as the callback argument instead
> > > of an arbitrary unsigned long. The first patch details why this is useful
> > > (it's the same rationale as the timer_struct changes from a bit ago:
> > > less abuse during memory corruption attacks, more in line with existing
> > > ways of doing things in the kernel, save a little space in struct,
> > > etc). Notably, the existing tasklet API use is much less messy, so there
> > > is less to clean up.
> > >
> > > It's not clear to me which tree this should go through... Greg since it
> > > starts with a USB clean-up, -tip for timer or interrupt, or if I should
> > > just carry it. I'm open to suggestions, but if I don't hear otherwise,
> > > I'll just carry it.
> > >
> > > My goal is to have this merged for v5.9-rc1 so that during the v5.10
> > > development cycle the new API will be available. The entire tree of
> > > changes is here[1] currently, but to split it up by maintainer the
> > > infrastructure changes need to be landed first.
> > >
> > > Review and Acks appreciated! :)
> >
> > I'd rather see tasklets vanish from the planet completely, but that's
> > going to be a daring feat. So, grudgingly:
>
> Understood! I will update the comments near the tasklet API.
>
> > Acked-by: Thomas Gleixner 
>

Here's the series re-based on top of 5.8
https://github.com/allenpais/tasklets/tree/V3

Let me know how you would want these to be reviewed.

Also, I was thinking if removing tasklets completely could be a task
on KSPP wiki. If yes, I did like to take ownership of that task. I have a
couple of ideas in mind, which could be discussed in a separate email.

Thanks.

-- 
   - Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] Modernize tasklet callback API

2020-08-11 Thread Allen
Kees,

> >
>
> Here's the series re-based on top of 5.8
> https://github.com/allenpais/tasklets/tree/V3
>
> Let me know how you would want these to be reviewed.
>

  I see the first set of infrastructure patches for tasklets have
landed in Linus's tree. Good time to send out the ~200 patches?

- Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] Modernize tasklet callback API

2020-08-12 Thread Allen
>
> I have a patch set to convert the remaining tasklet usage in sound
> drivers to either the threaded IRQ or the work, but it wasn't
> submitted / merged for 5.8 due to the obvious conflict with your API
> changes.
> Each conversion is rather simple, but it's always a question of the
> nature of each tasklet usage which alternative is the best fit.
>
> FWIW, the current version is found in test/kill-tasklet branch of
> sound git tree
>   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git

Great. Currently my tree has these converted to use the new
tasklet_setup() api. I will add these to my threaded IRQ/work tree
(which is still wip).

Thanks.


-- 
   - Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] Modernize tasklet callback API

2020-08-12 Thread Allen
Kees,

> Was a Coccinelle script used for any of these conversions? I wonder if
> it'd be easier to do a single treewide patch for the more mechanical
> changes.

No, I should have written one. Will do it.

> And, actually, I still think the "prepare" patches should just be
> collapsed into the actual "covert" patches -- there are only a few.

Okay. It's been done and pushed to:
https://github.com/allenpais/tasklets/tree/V4

> After those, yeah, I think getting these sent to their respective
> maintainers is the next step.

 Please look at the above branch, if it looks fine, let me know
if I can add your ACK on the patches.
>
> Sure! I will add it to the tracker. Here's for the refactoring:
> https://github.com/KSPP/linux/issues/30
>
> and here's for the removal:
> https://github.com/KSPP/linux/issues/94
>
> if you can added details/examples of how they should be removed, that'd
> help other folks too, if they wanted to jump in. :)

Sure, Thank you.

- Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] char: ipmi: convert tasklets to use new tasklet_setup() API

2020-08-18 Thread Allen
> >
> > Signed-off-by: Romain Perier 
> > Signed-off-by: Allen Pais 
>
> This looks good to me.
>
> Reviewed-by: Corey Minyard 
>
> Are you planning to push this, or do you want me to take it?  If you
> want me to take it, what is the urgency?

 Thanks. Well, not hurry, as long as it goes into 5.9 with all other
changes.


>
> -corey
>
> > ---
> >  drivers/char/ipmi/ipmi_msghandler.c | 13 ++---
> >  1 file changed, 6 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
> > b/drivers/char/ipmi/ipmi_msghandler.c
> > index 737c0b6b24ea..e1814b6a1225 100644
> > --- a/drivers/char/ipmi/ipmi_msghandler.c
> > +++ b/drivers/char/ipmi/ipmi_msghandler.c
> > @@ -39,7 +39,7 @@
> >
> >  static struct ipmi_recv_msg *ipmi_alloc_recv_msg(void);
> >  static int ipmi_init_msghandler(void);
> > -static void smi_recv_tasklet(unsigned long);
> > +static void smi_recv_tasklet(struct tasklet_struct *t);
> >  static void handle_new_recv_msgs(struct ipmi_smi *intf);
> >  static void need_waiter(struct ipmi_smi *intf);
> >  static int handle_one_recv_msg(struct ipmi_smi *intf,
> > @@ -3430,9 +3430,8 @@ int ipmi_add_smi(struct module *owner,
> >   intf->curr_seq = 0;
> >   spin_lock_init(&intf->waiting_rcv_msgs_lock);
> >   INIT_LIST_HEAD(&intf->waiting_rcv_msgs);
> > - tasklet_init(&intf->recv_tasklet,
> > -  smi_recv_tasklet,
> > -  (unsigned long) intf);
> > + tasklet_setup(&intf->recv_tasklet,
> > +  smi_recv_tasklet);
> >   atomic_set(&intf->watchdog_pretimeouts_to_deliver, 0);
> >   spin_lock_init(&intf->xmit_msgs_lock);
> >   INIT_LIST_HEAD(&intf->xmit_msgs);
> > @@ -4467,10 +4466,10 @@ static void handle_new_recv_msgs(struct ipmi_smi 
> > *intf)
> >   }
> >  }
> >
> > -static void smi_recv_tasklet(unsigned long val)
> > +static void smi_recv_tasklet(struct tasklet_struct *t)
> >  {
> >   unsigned long flags = 0; /* keep us warning-free. */
> > - struct ipmi_smi *intf = (struct ipmi_smi *) val;
> > + struct ipmi_smi *intf = from_tasklet(intf, t, recv_tasklet);
> >   int run_to_completion = intf->run_to_completion;
> >   struct ipmi_smi_msg *newmsg = NULL;
> >
> > @@ -4542,7 +4541,7 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,
> >   spin_unlock_irqrestore(&intf->xmit_msgs_lock, flags);
> >
> >   if (run_to_completion)
> > - smi_recv_tasklet((unsigned long) intf);
> > + smi_recv_tasklet(&intf->recv_tasklet);
> >   else
> >   tasklet_schedule(&intf->recv_tasklet);
> >  }
> > --
> > 2.17.1
> >



-- 
   - Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] block: convert tasklets to use new tasklet_setup() API

2020-08-19 Thread Allen
> > > > > > > >
> > > > > > > > In preparation for unconditionally passing the
> > > > > > > > struct tasklet_struct pointer to all tasklet
> > > > > > > > callbacks, switch to using the new tasklet_setup()
> > > > > > > > and from_tasklet() to pass the tasklet pointer explicitly.
> > > > > > >
> > > > > > > Who came up with the idea to add a macro 'from_tasklet' that
> > > > > > > is just container_of? container_of in the code would be
> > > > > > > _much_ more readable, and not leave anyone guessing wtf
> > > > > > > from_tasklet is doing.
> > > > > > >
> > > > > > > I'd fix that up now before everything else goes in...
> > > > > >
> > > > > > As I mentioned in the other thread, I think this makes things
> > > > > > much more readable. It's the same thing that the timer_struct
> > > > > > conversion did (added a container_of wrapper) to avoid the
> > > > > > ever-repeating use of typeof(), long lines, etc.
> > > > >
> > > > > But then it should use a generic name, instead of each sub-system
> > > > > using some random name that makes people look up exactly what it
> > > > > does. I'm not huge fan of the container_of() redundancy, but
> > > > > adding private variants of this doesn't seem like the best way
> > > > > forward. Let's have a generic helper that does this, and use it
> > > > > everywhere.
> > > >
> > > > I'm open to suggestions, but as things stand, these kinds of
> > > > treewide
> > >
> > > On naming? Implementation is just as it stands, from_tasklet() is
> > > totally generic which is why I objected to it. from_member()? Not
> > > great with naming... But I can see this going further and then we'll
> > > suddenly have tons of these. It's not good for readability.
> >
> > Since both threads seem to have petered out, let me suggest in
> > kernel.h:
> >
> > #define cast_out(ptr, container, member) \
> >   container_of(ptr, typeof(*container), member)
> >
> > It does what you want, the argument order is the same as container_of
> > with the only difference being you name the containing structure
> > instead of having to specify its type.
>
> I like this! Shall I send this to Linus to see if this can land in -rc2
> for use going forward?
>

Cool, I shall wait for it to be accepted and then spin out V2 with cast_out()

-- 
   - Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] block: convert tasklets to use new tasklet_setup() API

2020-08-19 Thread Allen
> [...]
> > > Since both threads seem to have petered out, let me suggest in
> > > kernel.h:
> > >
> > > #define cast_out(ptr, container, member) \
> > > container_of(ptr, typeof(*container), member)
> > >
> > > It does what you want, the argument order is the same as
> > > container_of with the only difference being you name the containing
> > > structure instead of having to specify its type.
> >
> > Not to incessantly bike shed on the naming, but I don't like
> > cast_out, it's not very descriptive. And it has connotations of
> > getting rid of something, which isn't really true.
>
> Um, I thought it was exactly descriptive: you're casting to the outer
> container.  I thought about following the C++ dynamic casting style, so
> out_cast(), but that seemed a bit pejorative.  What about outer_cast()?
>
> > FWIW, I like the from_ part of the original naming, as it has some
> > clues as to what is being done here. Why not just from_container()?
> > That should immediately tell people what it does without having to
> > look up the implementation, even before this becomes a part of the
> > accepted coding norm.
>
> I'm not opposed to container_from() but it seems a little less
> descriptive than outer_cast() but I don't really care.  I always have
> to look up container_of() when I'm using it so this would just be
> another macro of that type ...
>

 So far we have a few which have been suggested as replacement
for from_tasklet()

- out_cast() or outer_cast()
- from_member().
- container_from() or from_container()

from_container() sounds fine, would trimming it a bit work? like from_cont().

-- 
   - Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] block: convert tasklets to use new tasklet_setup() API

2020-08-26 Thread Allen
On Wed, Aug 26, 2020 at 8:43 PM Kees Cook  wrote:
>
> On Wed, Aug 26, 2020 at 12:55:28PM +0300, Dan Carpenter wrote:
> > On Wed, Aug 26, 2020 at 07:21:35AM +0530, Allen Pais wrote:
> > > On Thu, Aug 20, 2020 at 3:09 AM James Bottomley
> > >  wrote:
> > > >
> > > > On Wed, 2020-08-19 at 21:54 +0530, Allen wrote:
> > > > > > [...]
> > > > > > > > Since both threads seem to have petered out, let me suggest in
> > > > > > > > kernel.h:
> > > > > > > >
> > > > > > > > #define cast_out(ptr, container, member) \
> > > > > > > > container_of(ptr, typeof(*container), member)
> > > > > > > >
> > > > > > > > It does what you want, the argument order is the same as
> > > > > > > > container_of with the only difference being you name the
> > > > > > > > containing structure instead of having to specify its type.
> > > > > > >
> > > > > > > Not to incessantly bike shed on the naming, but I don't like
> > > > > > > cast_out, it's not very descriptive. And it has connotations of
> > > > > > > getting rid of something, which isn't really true.
> > > > > >
> > > > > > Um, I thought it was exactly descriptive: you're casting to the
> > > > > > outer container.  I thought about following the C++ dynamic casting
> > > > > > style, so out_cast(), but that seemed a bit pejorative.  What about
> > > > > > outer_cast()?
> > > > > >
> > > > > > > FWIW, I like the from_ part of the original naming, as it has
> > > > > > > some clues as to what is being done here. Why not just
> > > > > > > from_container()? That should immediately tell people what it
> > > > > > > does without having to look up the implementation, even before
> > > > > > > this becomes a part of the accepted coding norm.
> > > > > >
> > > > > > I'm not opposed to container_from() but it seems a little less
> > > > > > descriptive than outer_cast() but I don't really care.  I always
> > > > > > have to look up container_of() when I'm using it so this would just
> > > > > > be another macro of that type ...
> > > > > >
> > > > >
> > > > >  So far we have a few which have been suggested as replacement
> > > > > for from_tasklet()
> > > > >
> > > > > - out_cast() or outer_cast()
> > > > > - from_member().
> > > > > - container_from() or from_container()
> > > > >
> > > > > from_container() sounds fine, would trimming it a bit work? like
> > > > > from_cont().
> > > >
> > > > I'm fine with container_from().  It's the same form as container_of()
> > > > and I think we need urgent agreement to not stall everything else so
> > > > the most innocuous name is likely to get the widest acceptance.
> > >
> > > Kees,
> > >
> > >   Will you be  sending the newly proposed API to Linus? I have V2
> > > which uses container_from()
> > > ready to be sent out.
> >
> > I liked that James swapped the first two arguments so that it matches
> > container_of().  Plus it's nice that when you have:
> >
> >   struct whatever *foo = container_from(ptr, foo, member);
> >
> > Then it means that "ptr == &foo->member".
>
> I'm a bit stalled right now -- the merge window was keeping me busy, and
> this week is the Linux Plumbers Conference. This is on my list, but I
> haven't gotten back around to it. If you want, feel free to send the
> container_from() patch; you might be able to unblock this faster than me
> right now. :)
>

Sure, Thanks.



-- 
   - Allen
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wlan-ng: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/wlan-ng/hfa384x_usb.c  | 18 --
 drivers/staging/wlan-ng/p80211netdev.c |  9 -
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 2720f7319a3d..f2a0e16b0318 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -191,9 +191,9 @@ static void hfa384x_usbctlx_resptimerfn(struct timer_list 
*t);
 
 static void hfa384x_usb_throttlefn(struct timer_list *t);
 
-static void hfa384x_usbctlx_completion_task(unsigned long data);
+static void hfa384x_usbctlx_completion_task(struct tasklet_struct *t);
 
-static void hfa384x_usbctlx_reaper_task(unsigned long data);
+static void hfa384x_usbctlx_reaper_task(struct tasklet_struct *t);
 
 static int hfa384x_usbctlx_submit(struct hfa384x *hw,
  struct hfa384x_usbctlx *ctlx);
@@ -539,10 +539,8 @@ void hfa384x_create(struct hfa384x *hw, struct usb_device 
*usb)
/* Initialize the authentication queue */
skb_queue_head_init(&hw->authq);
 
-   tasklet_init(&hw->reaper_bh,
-hfa384x_usbctlx_reaper_task, (unsigned long)hw);
-   tasklet_init(&hw->completion_bh,
-hfa384x_usbctlx_completion_task, (unsigned long)hw);
+   tasklet_setup(&hw->reaper_bh, hfa384x_usbctlx_reaper_task);
+   tasklet_setup(&hw->completion_bh, hfa384x_usbctlx_completion_task);
INIT_WORK(&hw->link_bh, prism2sta_processing_defer);
INIT_WORK(&hw->usb_work, hfa384x_usb_defer);
 
@@ -2599,9 +2597,9 @@ void hfa384x_tx_timeout(struct wlandevice *wlandev)
  * Interrupt
  *
  */
-static void hfa384x_usbctlx_reaper_task(unsigned long data)
+static void hfa384x_usbctlx_reaper_task(struct tasklet_struct *t)
 {
-   struct hfa384x *hw = (struct hfa384x *)data;
+   struct hfa384x *hw = from_tasklet(hw, t, reaper_bh);
struct hfa384x_usbctlx *ctlx, *temp;
unsigned long flags;
 
@@ -2633,9 +2631,9 @@ static void hfa384x_usbctlx_reaper_task(unsigned long 
data)
  * Interrupt
  *
  */
-static void hfa384x_usbctlx_completion_task(unsigned long data)
+static void hfa384x_usbctlx_completion_task(struct tasklet_struct *t)
 {
-   struct hfa384x *hw = (struct hfa384x *)data;
+   struct hfa384x *hw = from_tasklet(hw, t, completion_bh);
struct hfa384x_usbctlx *ctlx, *temp;
unsigned long flags;
 
diff --git a/drivers/staging/wlan-ng/p80211netdev.c 
b/drivers/staging/wlan-ng/p80211netdev.c
index 7b091c5a2984..b86f14673590 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -266,11 +266,11 @@ static int p80211_convert_to_ether(struct wlandevice 
*wlandev,
 /**
  * p80211netdev_rx_bh - deferred processing of all received frames
  *
- * @arg: pointer to WLAN network device structure (cast to unsigned long)
+ * @t: pointer to the tasklet associated with this handler
  */
-static void p80211netdev_rx_bh(unsigned long arg)
+static void p80211netdev_rx_bh(struct tasklet_struct *t)
 {
-   struct wlandevice *wlandev = (struct wlandevice *)arg;
+   struct wlandevice *wlandev = from_tasklet(wlandev, t, rx_bh);
struct sk_buff *skb = NULL;
struct net_device *dev = wlandev->netdev;
 
@@ -728,8 +728,7 @@ int wlan_setup(struct wlandevice *wlandev, struct device 
*physdev)
 
/* Set up the rx queue */
skb_queue_head_init(&wlandev->nsd_rxq);
-   tasklet_init(&wlandev->rx_bh,
-p80211netdev_rx_bh, (unsigned long)wlandev);
+   tasklet_setup(&wlandev->rx_bh, p80211netdev_rx_bh);
 
/* Allocate and initialize the wiphy struct */
wiphy = wlan_create_wiphy(physdev, wlandev);
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c 
b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 29c29e2e125b..b9ccaad748ea 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -230,9 +230,10 @@ static inline bool pkt_exceeds_tail(struct recv_priv 
*precvpriv,
return false;
 }
 
-static void rtl8723bs_recv_tasklet(unsigned long priv)
+static void rtl8723bs_recv_tasklet(struct tasklet_struct *t)
 {
-   struct adapter *padapter;
+   struct adapter *padapter = from_tasklet(padapter, t,
+   recvpriv.recv_tasklet);
struct hal_com_data *p_hal_data;
struct recv_priv *precvpriv;
struct recv_buf *precvbuf;
@@ -244,7 +245,6 @@ static void rtl8723bs_recv_tasklet(unsigned long priv)
_pkt *pkt_copy = NULL;
u8 shift_sz = 0, rx_report_sz = 0;
 
-   padapter = (struct adapter *)priv;
p_hal_data = GET_HAL_DATA(padapter);
precvpriv = &padapter->recvpriv;
recv_buf_queue = &precvpriv->recv_buf_pending_queue;
@@ -444,8 +444,7 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
goto initbuferror;
 
/* 3 2. init tasklet */
-   tasklet_init(&precvpriv->recv_tasklet, rtl8723bs_recv_tasklet,
-(unsigned long)padapter);
+   tasklet_setup(&precvpriv->recv_tasklet, rtl8723bs_recv_tasklet);
 
goto exit;
 
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8712: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/rtl8712/rtl8712_recv.c  | 10 +-
 drivers/staging/rtl8712/rtl871x_xmit.c  |  3 +--
 drivers/staging/rtl8712/rtl871x_xmit.h  |  2 +-
 drivers/staging/rtl8712/usb_ops_linux.c |  5 +++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c 
b/drivers/staging/rtl8712/rtl8712_recv.c
index d83f421acfc1..978594c676eb 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -28,7 +28,7 @@
 #include "usb_ops.h"
 #include "wifi.h"
 
-static void recv_tasklet(unsigned long priv);
+static void recv_tasklet(struct tasklet_struct *t);
 
 void r8712_init_recv_priv(struct recv_priv *precvpriv,
  struct _adapter *padapter)
@@ -60,8 +60,7 @@ void r8712_init_recv_priv(struct recv_priv *precvpriv,
precvbuf++;
}
precvpriv->free_recv_buf_queue_cnt = NR_RECVBUFF;
-   tasklet_init(&precvpriv->recv_tasklet, recv_tasklet,
-(unsigned long)padapter);
+   tasklet_setup(&precvpriv->recv_tasklet, recv_tasklet);
skb_queue_head_init(&precvpriv->rx_skb_queue);
 
skb_queue_head_init(&precvpriv->free_recv_skb_queue);
@@ -1057,10 +1056,11 @@ static void recvbuf2recvframe(struct _adapter 
*padapter, struct sk_buff *pskb)
} while ((transfer_len > 0) && pkt_cnt > 0);
 }
 
-static void recv_tasklet(unsigned long priv)
+static void recv_tasklet(struct tasklet_struct *t)
 {
struct sk_buff *pskb;
-   struct _adapter *padapter = (struct _adapter *)priv;
+   struct _adapter *padapter = from_tasklet(padapter, t,
+recvpriv.recv_tasklet);
struct recv_priv *precvpriv = &padapter->recvpriv;
 
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c 
b/drivers/staging/rtl8712/rtl871x_xmit.c
index 8b88fd5dc9a1..cae552276ab8 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.c
+++ b/drivers/staging/rtl8712/rtl871x_xmit.c
@@ -144,8 +144,7 @@ int _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
INIT_WORK(&padapter->wk_filter_rx_ff0, r8712_SetFilter);
alloc_hwxmits(padapter);
init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
-   tasklet_init(&pxmitpriv->xmit_tasklet, r8712_xmit_bh,
-(unsigned long)padapter);
+   tasklet_setup(&pxmitpriv->xmit_tasklet, r8712_xmit_bh);
return 0;
 }
 
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.h 
b/drivers/staging/rtl8712/rtl871x_xmit.h
index c0c0c781fe17..cc58c7216935 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.h
+++ b/drivers/staging/rtl8712/rtl871x_xmit.h
@@ -277,7 +277,7 @@ int r8712_pre_xmit(struct _adapter *padapter, struct 
xmit_frame *pxmitframe);
 int r8712_xmit_enqueue(struct _adapter *padapter,
   struct xmit_frame *pxmitframe);
 void r8712_xmit_direct(struct _adapter *padapter, struct xmit_frame 
*pxmitframe);
-void r8712_xmit_bh(unsigned long priv);
+void r8712_xmit_bh(struct tasklet_struct *t);
 
 void xmitframe_xmitbuf_attach(struct xmit_frame *pxmitframe,
struct xmit_buf *pxmitbuf);
diff --git a/drivers/staging/rtl8712/usb_ops_linux.c 
b/drivers/staging/rtl8712/usb_ops_linux.c
index 9a04a752af13..655497cead12 100644
--- a/drivers/staging/rtl8712/usb_ops_linux.c
+++ b/drivers/staging/rtl8712/usb_ops_linux.c
@@ -308,10 +308,11 @@ void r8712_usb_read_port_cancel(struct _adapter *padapter)
}
 }
 
-void r8712_xmit_bh(unsigned long priv)
+void r8712_xmit_bh(struct tasklet_struct *t)
 {
int ret = false;
-   struct _adapter *padapter = (struct _adapter *)priv;
+   struct _adapter *padapter = from_tasklet(padapter, t,
+xmitpriv.xmit_tasklet);
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
if (padapter->driver_stopped ||
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 6 +++---
 drivers/staging/rtl8192u/r8192U_core.c | 9 -
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d8eb907ff301..690b664df8fa 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -1687,9 +1687,9 @@ static short ieee80211_sta_ps_sleep(struct 
ieee80211_device *ieee, u32 *time_h,
return 1;
 }
 
-static inline void ieee80211_sta_ps(unsigned long data)
+static inline void ieee80211_sta_ps(struct tasklet_struct *t)
 {
-   struct ieee80211_device *ieee = (struct ieee80211_device *)data;
+   struct ieee80211_device *ieee = from_tasklet(ieee, t, ps_task);
u32 th, tl;
short sleep;
 
@@ -2598,7 +2598,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
spin_lock_init(&ieee->mgmt_tx_lock);
spin_lock_init(&ieee->beacon_lock);
 
-   tasklet_init(&ieee->ps_task, ieee80211_sta_ps, (unsigned long)ieee);
+   tasklet_setup(&ieee->ps_task, ieee80211_sta_ps);
 }
 
 void ieee80211_softmac_free(struct ieee80211_device *ieee)
diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 6ec65187bef9..27dc181c4c9b 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2193,7 +2193,7 @@ static void rtl8192_init_priv_lock(struct r8192_priv 
*priv)
 
 static void rtl819x_watchdog_wqcallback(struct work_struct *work);
 
-static void rtl8192_irq_rx_tasklet(unsigned long data);
+static void rtl8192_irq_rx_tasklet(struct tasklet_struct *t);
 /* init tasklet and wait_queue here. only 2.6 above kernel is considered */
 #define DRV_NAME "wlan0"
 static void rtl8192_init_priv_task(struct net_device *dev)
@@ -2214,8 +2214,7 @@ static void rtl8192_init_priv_task(struct net_device *dev)
  InitialGainOperateWorkItemCallBack);
INIT_WORK(&priv->qos_activate, rtl8192_qos_activate);
 
-   tasklet_init(&priv->irq_rx_tasklet, rtl8192_irq_rx_tasklet,
-(unsigned long)priv);
+   tasklet_setup(&priv->irq_rx_tasklet, rtl8192_irq_rx_tasklet);
 }
 
 static void rtl8192_get_eeprom_size(struct net_device *dev)
@@ -4647,9 +4646,9 @@ static void rtl8192_rx_cmd(struct sk_buff *skb)
}
 }
 
-static void rtl8192_irq_rx_tasklet(unsigned long data)
+static void rtl8192_irq_rx_tasklet(struct tasklet_struct *t)
 {
-   struct r8192_priv *priv = (struct r8192_priv *)data;
+   struct r8192_priv *priv = from_tasklet(priv, t, irq_rx_tasklet);
struct sk_buff *skb;
struct rtl8192_rx_info *info;
 
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192e: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 27 ++--
 drivers/staging/rtl8192e/rtllib_softmac.c|  6 ++---
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index fac58eebf263..663675efcfe4 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -82,8 +82,8 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, 
struct net_device *dev);
 static void _rtl92e_tx_cmd(struct net_device *dev, struct sk_buff *skb);
 static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb);
 static short _rtl92e_pci_initdescring(struct net_device *dev);
-static void _rtl92e_irq_tx_tasklet(unsigned long data);
-static void _rtl92e_irq_rx_tasklet(unsigned long data);
+static void _rtl92e_irq_tx_tasklet(struct tasklet_struct *t);
+static void _rtl92e_irq_rx_tasklet(struct tasklet_struct *t);
 static void _rtl92e_cancel_deferred_work(struct r8192_priv *priv);
 static int _rtl92e_up(struct net_device *dev, bool is_silent_reset);
 static int _rtl92e_try_up(struct net_device *dev);
@@ -517,9 +517,10 @@ static int _rtl92e_handle_assoc_response(struct net_device 
*dev,
return 0;
 }
 
-static void _rtl92e_prepare_beacon(unsigned long data)
+static void _rtl92e_prepare_beacon(struct tasklet_struct *t)
 {
-   struct r8192_priv *priv = (struct r8192_priv *)data;
+   struct r8192_priv *priv = from_tasklet(priv, t,
+  irq_prepare_beacon_tasklet);
struct net_device *dev = priv->rtllib->dev;
struct sk_buff *pskb = NULL, *pnewskb = NULL;
struct cb_desc *tcb_desc = NULL;
@@ -1009,12 +1010,10 @@ static void _rtl92e_init_priv_task(struct net_device 
*dev)
  (void *)rtl92e_hw_wakeup_wq, dev);
INIT_DELAYED_WORK_RSL(&priv->rtllib->hw_sleep_wq,
  (void *)rtl92e_hw_sleep_wq, dev);
-   tasklet_init(&priv->irq_rx_tasklet, _rtl92e_irq_rx_tasklet,
-(unsigned long)priv);
-   tasklet_init(&priv->irq_tx_tasklet, _rtl92e_irq_tx_tasklet,
-(unsigned long)priv);
-   tasklet_init(&priv->irq_prepare_beacon_tasklet, _rtl92e_prepare_beacon,
-(unsigned long)priv);
+   tasklet_setup(&priv->irq_rx_tasklet, _rtl92e_irq_rx_tasklet);
+   tasklet_setup(&priv->irq_tx_tasklet, _rtl92e_irq_tx_tasklet);
+   tasklet_setup(&priv->irq_prepare_beacon_tasklet,
+ _rtl92e_prepare_beacon);
 }
 
 static short _rtl92e_get_channel_map(struct net_device *dev)
@@ -2109,16 +2108,16 @@ static void _rtl92e_tx_resume(struct net_device *dev)
}
 }
 
-static void _rtl92e_irq_tx_tasklet(unsigned long data)
+static void _rtl92e_irq_tx_tasklet(struct tasklet_struct *t)
 {
-   struct r8192_priv *priv = (struct r8192_priv *)data;
+   struct r8192_priv *priv = from_tasklet(priv, t, irq_tx_tasklet);
 
_rtl92e_tx_resume(priv->rtllib->dev);
 }
 
-static void _rtl92e_irq_rx_tasklet(unsigned long data)
+static void _rtl92e_irq_rx_tasklet(struct tasklet_struct *t)
 {
-   struct r8192_priv *priv = (struct r8192_priv *)data;
+   struct r8192_priv *priv = from_tasklet(priv, t, irq_rx_tasklet);
 
_rtl92e_rx_normal(priv->rtllib->dev);
 
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c 
b/drivers/staging/rtl8192e/rtllib_softmac.c
index 6e2f620afd14..2c752ba5a802 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -2044,9 +2044,9 @@ static short rtllib_sta_ps_sleep(struct rtllib_device 
*ieee, u64 *time)
 
 }
 
-static inline void rtllib_sta_ps(unsigned long data)
+static inline void rtllib_sta_ps(struct tasklet_struct *t)
 {
-   struct rtllib_device *ieee = (struct rtllib_device *)data;
+   struct rtllib_device *ieee = from_tasklet(ieee, t, ps_task);
u64 time;
short sleep;
unsigned long flags, flags2;
@@ -3028,7 +3028,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
spin_lock_init(&ieee->mgmt_tx_lock);
spin_lock_init(&ieee->beacon_lock);
 
-   tasklet_init(&ieee->ps_task, rtllib_sta_ps, (unsigned long)ieee);
+   tasklet_setup(&ieee->ps_task, rtllib_sta_ps);
 
 }
 
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c| 3 +--
 drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c| 3 +--
 drivers/staging/rtl8188eu/include/rtl8188e_recv.h | 2 +-
 drivers/staging/rtl8188eu/include/rtl8188e_xmit.h | 2 +-
 drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c  | 8 
 5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c 
b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index 7badfc2e45df..25f46b2f4920 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -22,8 +22,7 @@ int rtw_hal_init_recv_priv(struct adapter *padapter)
int i, res = _SUCCESS;
struct recv_buf *precvbuf;
 
-   tasklet_init(&precvpriv->recv_tasklet, rtl8188eu_recv_tasklet,
-(unsigned long)padapter);
+   tasklet_setup(&precvpriv->recv_tasklet, rtl8188eu_recv_tasklet);
 
/* init recv_buf */
_rtw_init_queue(&precvpriv->free_recv_buf_queue);
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c 
b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
index 7d315bd438d4..52023551ab30 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c
@@ -17,8 +17,7 @@ s32 rtw_hal_init_xmit_priv(struct adapter *adapt)
 {
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
 
-   tasklet_init(&pxmitpriv->xmit_tasklet, rtl8188eu_xmit_tasklet,
-(unsigned long)adapt);
+   tasklet_setup(&pxmitpriv->xmit_tasklet, rtl8188eu_xmit_tasklet);
return _SUCCESS;
 }
 
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_recv.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_recv.h
index 23251ffa8404..fea1119c426e 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_recv.h
@@ -43,7 +43,7 @@ enum rx_packet_type {
 };
 
 #define INTERRUPT_MSG_FORMAT_LEN 60
-void rtl8188eu_recv_tasklet(unsigned long priv);
+void rtl8188eu_recv_tasklet(struct tasklet_struct *t);
 void rtl8188e_process_phy_info(struct adapter *padapter,
   struct recv_frame *prframe);
 void update_recvframe_phyinfo_88e(struct recv_frame *fra, struct phy_stat 
*phy);
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
index 85efa41c8350..354480678270 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_xmit.h
@@ -147,7 +147,7 @@ void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 
*pDesc,
 s32 rtl8188eu_init_xmit_priv(struct adapter *padapter);
 s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter);
 #define hal_xmit_handler rtl8188eu_xmit_buf_handler
-void rtl8188eu_xmit_tasklet(unsigned long priv);
+void rtl8188eu_xmit_tasklet(struct tasklet_struct *t);
 bool rtl8188eu_xmitframe_complete(struct adapter *padapter,
  struct xmit_priv *pxmitpriv);
 
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c 
b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
index a80c7f3b86d1..6926443bba4e 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c
@@ -773,10 +773,10 @@ void usb_write_port_cancel(struct adapter *padapter)
}
 }
 
-void rtl8188eu_recv_tasklet(unsigned long priv)
+void rtl8188eu_recv_tasklet(struct tasklet_struct *t)
 {
struct sk_buff *pskb;
-   struct adapter *adapt = (struct adapter *)priv;
+   struct adapter *adapt = from_tasklet(adapt, t, recvpriv.recv_tasklet);
struct recv_priv *precvpriv = &adapt->recvpriv;
 
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
@@ -792,9 +792,9 @@ void rtl8188eu_recv_tasklet(unsigned long priv)
}
 }
 
-void rtl8188eu_xmit_tasklet(unsigned long priv)
+void rtl8188eu_xmit_tasklet(struct tasklet_struct *t)
 {
-   struct adapter *adapt = (struct adapter *)priv;
+   struct adapter *adapt = from_tasklet(adapt, t, xmitpriv.xmit_tasklet);
struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
 
if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY))
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ralink-gdma: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/ralink-gdma/ralink-gdma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ralink-gdma/ralink-gdma.c 
b/drivers/staging/ralink-gdma/ralink-gdma.c
index eabf1093328e..655df317d0ee 100644
--- a/drivers/staging/ralink-gdma/ralink-gdma.c
+++ b/drivers/staging/ralink-gdma/ralink-gdma.c
@@ -701,9 +701,9 @@ static void gdma_dma_desc_free(struct virt_dma_desc *vdesc)
kfree(container_of(vdesc, struct gdma_dma_desc, vdesc));
 }
 
-static void gdma_dma_tasklet(unsigned long arg)
+static void gdma_dma_tasklet(struct tasklet_struct *t)
 {
-   struct gdma_dma_dev *dma_dev = (struct gdma_dma_dev *)arg;
+   struct gdma_dma_dev *dma_dev = from_tasklet(dma_dev, t, task);
struct gdma_dmaengine_chan *chan;
static unsigned int last_chan;
unsigned int i, chan_mask;
@@ -821,7 +821,7 @@ static int gdma_dma_probe(struct platform_device *pdev)
if (IS_ERR(base))
return PTR_ERR(base);
dma_dev->base = base;
-   tasklet_init(&dma_dev->task, gdma_dma_tasklet, (unsigned long)dma_dev);
+   tasklet_setup(&dma_dev->task, gdma_dma_tasklet);
 
irq = platform_get_irq(pdev, 0);
if (irq < 0)
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: mt7621-dma: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/mt7621-dma/mtk-hsdma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c 
b/drivers/staging/mt7621-dma/mtk-hsdma.c
index 14592ed9ce98..354536783e1c 100644
--- a/drivers/staging/mt7621-dma/mtk-hsdma.c
+++ b/drivers/staging/mt7621-dma/mtk-hsdma.c
@@ -533,9 +533,9 @@ static void mtk_hsdma_rx(struct mtk_hsdam_engine *hsdma)
mtk_hsdma_chan_done(hsdma, chan);
 }
 
-static void mtk_hsdma_tasklet(unsigned long arg)
+static void mtk_hsdma_tasklet(struct tasklet_struct *t)
 {
-   struct mtk_hsdam_engine *hsdma = (struct mtk_hsdam_engine *)arg;
+   struct mtk_hsdam_engine *hsdma = from_tasklet(hsdma, t, task);
 
mtk_hsdma_rx(hsdma);
mtk_hsdma_tx(hsdma);
@@ -670,7 +670,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
if (IS_ERR(base))
return PTR_ERR(base);
hsdma->base = base + HSDMA_BASE_OFFSET;
-   tasklet_init(&hsdma->task, mtk_hsdma_tasklet, (unsigned long)hsdma);
+   tasklet_setup(&hsdma->task, mtk_hsdma_tasklet);
 
irq = platform_get_irq(pdev, 0);
if (irq < 0)
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: ks7010: convert tasklets to use new tasklet_setup() API

2020-09-15 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/staging/ks7010/ks7010_sdio.c | 6 +++---
 drivers/staging/ks7010/ks_hostif.c   | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 6b2660c94f4e..78dc8beeae98 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -405,9 +405,9 @@ int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, 
unsigned long size,
return result;
 }
 
-static void rx_event_task(unsigned long dev)
+static void rx_event_task(struct tasklet_struct *t)
 {
-   struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
+   struct ks_wlan_private *priv = from_tasklet(priv, t, rx_bh_task);
struct rx_device_buffer *rp;
 
if (rxq_has_space(priv) && priv->dev_state >= DEVICE_STATE_BOOT) {
@@ -618,7 +618,7 @@ static int trx_device_init(struct ks_wlan_private *priv)
spin_lock_init(&priv->tx_dev.tx_dev_lock);
spin_lock_init(&priv->rx_dev.rx_dev_lock);
 
-   tasklet_init(&priv->rx_bh_task, rx_event_task, (unsigned long)priv);
+   tasklet_setup(&priv->rx_bh_task, rx_event_task);
 
return 0;
 }
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index eaaf6a5440a9..8bc3b7d8d3d5 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2205,9 +2205,9 @@ static void hostif_sme_execute(struct ks_wlan_private 
*priv, int event)
 }
 
 static
-void hostif_sme_task(unsigned long dev)
+void hostif_sme_task(struct tasklet_struct *t)
 {
-   struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
+   struct ks_wlan_private *priv = from_tasklet(priv, t, sme_task);
 
if (priv->dev_state < DEVICE_STATE_BOOT)
return;
@@ -2258,7 +2258,7 @@ static inline void hostif_sme_init(struct ks_wlan_private 
*priv)
priv->sme_i.qtail = 0;
spin_lock_init(&priv->sme_i.sme_spin);
priv->sme_i.sme_flag = 0;
-   tasklet_init(&priv->sme_task, hostif_sme_task, (unsigned long)priv);
+   tasklet_setup(&priv->sme_task, hostif_sme_task);
 }
 
 static inline void hostif_wpa_init(struct ks_wlan_private *priv)
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drivers:staging/media:Use ARRAY_SIZE() for the size calculation of the array

2017-09-13 Thread Allen Pais
Signed-off-by: Allen Pais 
---
 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index e882b55..d822918 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -451,7 +451,7 @@ static enum ia_css_frame_format yuv422_copy_formats[] = {
IA_CSS_FRAME_FORMAT_YUYV
 };
 
-#define array_length(array) (sizeof(array)/sizeof(array[0]))
+#define array_length(array) (ARRAY_SIZE(array))
 
 /* Verify whether the selected output format is can be produced
  * by the copy binary given the stream format.
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] drivers:staging/media:Use ARRAY_SIZE() for the size calculation of the array

2017-09-13 Thread Allen Pais
Signed-off-by: Allen Pais 
---
 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index e882b55..bee3043 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -451,8 +451,6 @@ static enum ia_css_frame_format yuv422_copy_formats[] = {
IA_CSS_FRAME_FORMAT_YUYV
 };
 
-#define array_length(array) (sizeof(array)/sizeof(array[0]))
-
 /* Verify whether the selected output format is can be produced
  * by the copy binary given the stream format.
  * */
@@ -468,7 +466,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe)
switch (pipe->stream->config.input_config.format) {
case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY:
case IA_CSS_STREAM_FORMAT_YUV420_8:
-   for (i=0; ihttp://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3] drivers/staging:[media]atomisp:use ARRAY_SIZE() instead of open coding.

2017-09-13 Thread Allen Pais
Signed-off-by: Allen Pais 
---
 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index e882b55..bee3043 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -451,8 +451,6 @@ static enum ia_css_frame_format yuv422_copy_formats[] = {
IA_CSS_FRAME_FORMAT_YUYV
 };
 
-#define array_length(array) (sizeof(array)/sizeof(array[0]))
-
 /* Verify whether the selected output format is can be produced
  * by the copy binary given the stream format.
  * */
@@ -468,7 +466,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe)
switch (pipe->stream->config.input_config.format) {
case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY:
case IA_CSS_STREAM_FORMAT_YUV420_8:
-   for (i=0; ihttp://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4] [media]atomisp:use ARRAY_SIZE() instead of open coding.

2017-09-13 Thread Allen Pais
The array_length() macro just duplicates ARRAY_SIZE(), so we can
delete it.

v4: Update the commit message.

Signed-off-by: Allen Pais 
---
 drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
index e882b55..bee3043 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
@@ -451,8 +451,6 @@ static enum ia_css_frame_format yuv422_copy_formats[] = {
IA_CSS_FRAME_FORMAT_YUYV
 };
 
-#define array_length(array) (sizeof(array)/sizeof(array[0]))
-
 /* Verify whether the selected output format is can be produced
  * by the copy binary given the stream format.
  * */
@@ -468,7 +466,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe)
switch (pipe->stream->config.input_config.format) {
case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY:
case IA_CSS_STREAM_FORMAT_YUV420_8:
-   for (i=0; ihttp://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


imaging

2018-07-08 Thread Julie Allen

We would like to introduce our image editing services for you.

We would appreciate if you can reply with your requirements and can give us
a chance to serve you.

Our mainly services are:

. Cut out, masking, clipping path, deep etching, transparent background
. Colour correction, black and white, light and shadows etc.
. Dust cleaning, spot cleaning
. Beauty retouching, skin retouching, face retouching, body retouching
. Fashion/Beauty Image Retouching
. Product image Retouching
. Real estate image Retouching
. Wedding & Event Album Design.
. Vector Conversion
. Portrait image Retouching

We deliver the work within 24-48 hours.
We can give you editing test on your photos.

Please reply if you have interests.

Thanks,
Julie

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


you need photos

2018-07-08 Thread Julie Allen

We would like to introduce our image editing services for you.

We would appreciate if you can reply with your requirements and can give us
a chance to serve you.

Our mainly services are:

. Cut out, masking, clipping path, deep etching, transparent background
. Colour correction, black and white, light and shadows etc.
. Dust cleaning, spot cleaning
. Beauty retouching, skin retouching, face retouching, body retouching
. Fashion/Beauty Image Retouching
. Product image Retouching
. Real estate image Retouching
. Wedding & Event Album Design.
. Vector Conversion
. Portrait image Retouching

We deliver the work within 24-48 hours.
We can give you editing test on your photos.

Please reply if you have interests.

Thanks,
Julie

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


DISTRIBUTORS WANTED WORLDWIDE

2016-02-26 Thread Jason Allen

U.S. Manufacturer of Floor Safety Product Needs Exclusive Distributors
Worldwide.

26 YEAR OLD U.S. COMPANY NEEDS DISTRIBUTORS IN MANY COUNTRIES for our
amazing slip-resistant floor product.

One 30 minute application with our Amazing Anti-Slip Floor Treatment will
make floors slip-resistant and safe for 4 years - Guaranteed!

Use Indoors or Outdoors
No Change in Appearance

Some of our satisfied Customers: McDonalds, Burger King, KFC, Hilton,
Sheraton, Pfizer, Mercedes, BMW, Holiday Inn, Kroger, Miami Children's
Hospital, etc.

Typical Prospects: Hotels, Restaurants, Supermarkets, Office Buildings,
Retail stores, etc.

Use on Ceramic, Porcelain and quarry Tiles, marble, granite, concrete,
terrazzo, etc.

Please contact us for details and to see if there is a distributorship
available in your country.

$2,000 USD - $4,000 USD
Inventory Investment Required

Please contact us for details and to see if there is a distributorship
available in your country.

Please include your name and country of residence.

Jason Allen
Contact: aben...@sina.com

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] driver: hv: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/hv/channel_mgmt.c | 3 +--
 drivers/hv/connection.c   | 4 ++--
 drivers/hv/hv.c   | 3 +--
 drivers/hv/hyperv_vmbus.h | 4 ++--
 drivers/hv/vmbus_drv.c| 4 ++--
 5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 591106cf58fc..640fc1688d49 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -321,8 +321,7 @@ static struct vmbus_channel *alloc_channel(void)
 
INIT_LIST_HEAD(&channel->sc_list);
 
-   tasklet_init(&channel->callback_event,
-vmbus_on_event, (unsigned long)channel);
+   tasklet_setup(&channel->callback_event, vmbus_on_event);
 
hv_ringbuffer_pre_init(channel);
 
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index 11170d9a2e1a..23e10ebecf5c 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -322,9 +322,9 @@ struct vmbus_channel *relid2channel(u32 relid)
  *If this tasklet has been running for a long time
  *then reschedule ourselves.
  */
-void vmbus_on_event(unsigned long data)
+void vmbus_on_event(struct tasklet_struct *t)
 {
-   struct vmbus_channel *channel = (void *) data;
+   struct vmbus_channel *channel = from_tasklet(channel, t, 
callback_event);
unsigned long time_limit = jiffies + 2;
 
trace_vmbus_on_event(channel);
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index da69338f92f5..91a0582387d6 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -96,8 +96,7 @@ int hv_synic_alloc(void)
for_each_present_cpu(cpu) {
hv_cpu = per_cpu_ptr(hv_context.cpu_context, cpu);
 
-   tasklet_init(&hv_cpu->msg_dpc,
-vmbus_on_msg_dpc, (unsigned long) hv_cpu);
+   tasklet_setup(&hv_cpu->msg_dpc, vmbus_on_msg_dpc);
 
hv_cpu->synic_message_page =
(void *)get_zeroed_page(GFP_ATOMIC);
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 40e2b9f91163..36199d8ea8c3 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -351,8 +351,8 @@ void vmbus_disconnect(void);
 
 int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep);
 
-void vmbus_on_event(unsigned long data);
-void vmbus_on_msg_dpc(unsigned long data);
+void vmbus_on_event(struct tasklet_struct *t);
+void vmbus_on_msg_dpc(struct tasklet_struct *t);
 
 int hv_kvp_init(struct hv_util_service *srv);
 void hv_kvp_deinit(void);
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 910b6e90866c..6b7987dac97a 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1043,9 +1043,9 @@ static void vmbus_onmessage_work(struct work_struct *work)
kfree(ctx);
 }
 
-void vmbus_on_msg_dpc(unsigned long data)
+void vmbus_on_msg_dpc(struct tasklet_struct *t)
 {
-   struct hv_per_cpu_context *hv_cpu = (void *)data;
+   struct hv_per_cpu_context *hv_cpu = from_tasklet(hv_cpu, t, msg_dpc);
void *page_addr = hv_cpu->synic_message_page;
struct hv_message *msg = (struct hv_message *)page_addr +
  VMBUS_MESSAGE_SINT;
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] arch: um: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 arch/um/drivers/vector_kern.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 8735c468230a..06980870ae23 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1196,9 +1196,9 @@ static int vector_net_close(struct net_device *dev)
 
 /* TX tasklet */
 
-static void vector_tx_poll(unsigned long data)
+static void vector_tx_poll(struct tasklet_struct *t)
 {
-   struct vector_private *vp = (struct vector_private *)data;
+   struct vector_private *vp = from_tasklet(vp, t, tx_poll);
 
vp->estats.tx_kicks++;
vector_send(vp->tx_queue);
@@ -1629,7 +1629,7 @@ static void vector_eth_configure(
});
 
dev->features = dev->hw_features = (NETIF_F_SG | NETIF_F_FRAGLIST);
-   tasklet_init(&vp->tx_poll, vector_tx_poll, (unsigned long)vp);
+   tasklet_setup(&vp->tx_poll, vector_tx_poll);
INIT_WORK(&vp->reset_tx, vector_reset_tx);
 
timer_setup(&vp->tl, vector_timer_expire, 0);
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] block: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/block/umem.c| 6 +++---
 drivers/block/xsysace.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index 2b95d7b33b91..320781d5d156 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -405,7 +405,7 @@ static int add_bio(struct cardinfo *card)
return 1;
 }
 
-static void process_page(unsigned long data)
+static void process_page(struct tasklet_struct *t)
 {
/* check if any of the requests in the page are DMA_COMPLETE,
 * and deal with them appropriately.
@@ -415,7 +415,7 @@ static void process_page(unsigned long data)
 */
struct mm_page *page;
struct bio *return_bio = NULL;
-   struct cardinfo *card = (struct cardinfo *)data;
+   struct cardinfo *card = from_tasklet(card, t, tasklet);
unsigned int dma_status = card->dma_status;
 
spin_lock(&card->lock);
@@ -891,7 +891,7 @@ static int mm_pci_probe(struct pci_dev *dev, const struct 
pci_device_id *id)
if (!card->queue)
goto failed_alloc;
 
-   tasklet_init(&card->tasklet, process_page, (unsigned long)card);
+   tasklet_setup(&card->tasklet, process_page);
 
card->check_batteries = 0;
 
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 5d8e0ab3f054..bdd50a87d10f 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -762,9 +762,9 @@ static void ace_fsm_dostate(struct ace_device *ace)
}
 }
 
-static void ace_fsm_tasklet(unsigned long data)
+static void ace_fsm_tasklet(struct tasklet_struct *t)
 {
-   struct ace_device *ace = (void *)data;
+   struct ace_device *ace = from_tasklet(ace, t, fsm_tasklet);
unsigned long flags;
 
spin_lock_irqsave(&ace->lock, flags);
@@ -1001,7 +1001,7 @@ static int ace_setup(struct ace_device *ace)
/*
 * Initialize the state machine tasklet and stall timer
 */
-   tasklet_init(&ace->fsm_tasklet, ace_fsm_tasklet, (unsigned long)ace);
+   tasklet_setup(&ace->fsm_tasklet, ace_fsm_tasklet);
timer_setup(&ace->stall_timer, ace_stall_timer, 0);
 
/*
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drivers: atm: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/atm/eni.c   |  9 +
 drivers/atm/fore200e.c  | 14 +++---
 drivers/atm/he.c|  8 
 drivers/atm/solos-pci.c |  8 
 4 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 39be444534d0..540edea0ad7a 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -1521,10 +1521,11 @@ static irqreturn_t eni_int(int irq,void *dev_id)
 }
 
 
-static void eni_tasklet(unsigned long data)
+static void eni_tasklet(struct tasklet_struct *t)
 {
-   struct atm_dev *dev = (struct atm_dev *) data;
-   struct eni_dev *eni_dev = ENI_DEV(dev);
+   struct eni_dev *eni_dev = from_tasklet(eni_dev, t, task);
+   struct atm_dev *dev = container_of((void *)eni_dev, typeof(*dev),
+ dev_data);
unsigned long flags;
u32 events;
 
@@ -1838,7 +1839,7 @@ static int eni_start(struct atm_dev *dev)
 eni_dev->vci,eni_dev->rx_dma,eni_dev->tx_dma,
 eni_dev->service,buf);
spin_lock_init(&eni_dev->lock);
-   tasklet_init(&eni_dev->task,eni_tasklet,(unsigned long) dev);
+   tasklet_setup(&eni_dev->task,eni_tasklet);
eni_dev->events = 0;
/* initialize memory management */
buffer_mem = eni_dev->mem - (buf - eni_dev->ram);
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index a81bc49c14ac..8c6226b50e4d 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -1180,9 +1180,9 @@ fore200e_interrupt(int irq, void* dev)
 
 #ifdef FORE200E_USE_TASKLET
 static void
-fore200e_tx_tasklet(unsigned long data)
+fore200e_tx_tasklet(struct tasklet_struct *t)
 {
-struct fore200e* fore200e = (struct fore200e*) data;
+struct fore200e* fore200e = from_tasklet(fore200e, t, tx_tasklet);
 unsigned long flags;
 
 DPRINTK(3, "tx tasklet scheduled for device %d\n", 
fore200e->atm_dev->number);
@@ -1194,15 +1194,15 @@ fore200e_tx_tasklet(unsigned long data)
 
 
 static void
-fore200e_rx_tasklet(unsigned long data)
+fore200e_rx_tasklet(struct tasklet_struct *t)
 {
-struct fore200e* fore200e = (struct fore200e*) data;
+struct fore200e* fore200e = from_tasklet(fore200e, t, rx_tasklet);
 unsigned longflags;
 
 DPRINTK(3, "rx tasklet scheduled for device %d\n", 
fore200e->atm_dev->number);
 
 spin_lock_irqsave(&fore200e->q_lock, flags);
-fore200e_rx_irq((struct fore200e*) data);
+fore200e_rx_irq(fore200e);
 spin_unlock_irqrestore(&fore200e->q_lock, flags);
 }
 #endif
@@ -1943,8 +1943,8 @@ static int fore200e_irq_request(struct fore200e *fore200e)
   fore200e_irq_itoa(fore200e->irq), fore200e->name);
 
 #ifdef FORE200E_USE_TASKLET
-tasklet_init(&fore200e->tx_tasklet, fore200e_tx_tasklet, (unsigned 
long)fore200e);
-tasklet_init(&fore200e->rx_tasklet, fore200e_rx_tasklet, (unsigned 
long)fore200e);
+tasklet_setup(&fore200e->tx_tasklet, fore200e_tx_tasklet);
+tasklet_setup(&fore200e->rx_tasklet, fore200e_rx_tasklet);
 #endif
 
 fore200e->state = FORE200E_STATE_IRQ;
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 8af793f5e811..9c36fea4336f 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -100,7 +100,7 @@ static void he_close(struct atm_vcc *vcc);
 static int he_send(struct atm_vcc *vcc, struct sk_buff *skb);
 static int he_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg);
 static irqreturn_t he_irq_handler(int irq, void *dev_id);
-static void he_tasklet(unsigned long data);
+static void he_tasklet(struct tasklet_struct *t);
 static int he_proc_read(struct atm_dev *dev,loff_t *pos,char *page);
 static int he_start(struct atm_dev *dev);
 static void he_stop(struct he_dev *dev);
@@ -383,7 +383,7 @@ static int he_init_one(struct pci_dev *pci_dev,
he_dev->atm_dev->dev_data = he_dev;
atm_dev->dev_data = he_dev;
he_dev->number = atm_dev->number;
-   tasklet_init(&he_dev->tasklet, he_tasklet, (unsigned long) he_dev);
+   tasklet_setup(&he_dev->tasklet, he_tasklet);
spin_lock_init(&he_dev->global_lock);
 
if (he_start(atm_dev)) {
@@ -1925,10 +1925,10 @@ he_service_rbpl(struct he_dev *he_dev, int group)
 }
 
 static void
-he_tasklet(unsigned long data)
+he_tasklet(struct tasklet_struct *t)
 {
unsigned long flags;
-   struct he_dev *he_dev = (struct he_dev *) data;
+   struct he_dev *he_dev = from_tasklet(he_dev, t, tasklet);
int group, type;
int updated = 0;
 
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/so

[PATCH] char: ipmi: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/char/ipmi/ipmi_msghandler.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
b/drivers/char/ipmi/ipmi_msghandler.c
index 737c0b6b24ea..e1814b6a1225 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -39,7 +39,7 @@
 
 static struct ipmi_recv_msg *ipmi_alloc_recv_msg(void);
 static int ipmi_init_msghandler(void);
-static void smi_recv_tasklet(unsigned long);
+static void smi_recv_tasklet(struct tasklet_struct *t);
 static void handle_new_recv_msgs(struct ipmi_smi *intf);
 static void need_waiter(struct ipmi_smi *intf);
 static int handle_one_recv_msg(struct ipmi_smi *intf,
@@ -3430,9 +3430,8 @@ int ipmi_add_smi(struct module *owner,
intf->curr_seq = 0;
spin_lock_init(&intf->waiting_rcv_msgs_lock);
INIT_LIST_HEAD(&intf->waiting_rcv_msgs);
-   tasklet_init(&intf->recv_tasklet,
-smi_recv_tasklet,
-(unsigned long) intf);
+   tasklet_setup(&intf->recv_tasklet,
+smi_recv_tasklet);
atomic_set(&intf->watchdog_pretimeouts_to_deliver, 0);
spin_lock_init(&intf->xmit_msgs_lock);
INIT_LIST_HEAD(&intf->xmit_msgs);
@@ -4467,10 +4466,10 @@ static void handle_new_recv_msgs(struct ipmi_smi *intf)
}
 }
 
-static void smi_recv_tasklet(unsigned long val)
+static void smi_recv_tasklet(struct tasklet_struct *t)
 {
unsigned long flags = 0; /* keep us warning-free. */
-   struct ipmi_smi *intf = (struct ipmi_smi *) val;
+   struct ipmi_smi *intf = from_tasklet(intf, t, recv_tasklet);
int run_to_completion = intf->run_to_completion;
struct ipmi_smi_msg *newmsg = NULL;
 
@@ -4542,7 +4541,7 @@ void ipmi_smi_msg_received(struct ipmi_smi *intf,
spin_unlock_irqrestore(&intf->xmit_msgs_lock, flags);
 
if (run_to_completion)
-   smi_recv_tasklet((unsigned long) intf);
+   smi_recv_tasklet(&intf->recv_tasklet);
else
tasklet_schedule(&intf->recv_tasklet);
 }
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drivers: ntb: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/ntb/ntb_transport.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index e6d1f5b298f3..ab3bee2fc803 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -273,7 +273,7 @@ enum {
 #define NTB_QP_DEF_NUM_ENTRIES 100
 #define NTB_LINK_DOWN_TIMEOUT  10
 
-static void ntb_transport_rxc_db(unsigned long data);
+static void ntb_transport_rxc_db(struct tasklet_struct *t);
 static const struct ntb_ctx_ops ntb_transport_ops;
 static struct ntb_client ntb_transport_client;
 static int ntb_async_tx_submit(struct ntb_transport_qp *qp,
@@ -1234,8 +1234,7 @@ static int ntb_transport_init_queue(struct 
ntb_transport_ctx *nt,
INIT_LIST_HEAD(&qp->rx_free_q);
INIT_LIST_HEAD(&qp->tx_free_q);
 
-   tasklet_init(&qp->rxc_db_work, ntb_transport_rxc_db,
-(unsigned long)qp);
+   tasklet_setup(&qp->rxc_db_work, ntb_transport_rxc_db);
 
return 0;
 }
@@ -1685,9 +1684,9 @@ static int ntb_process_rxc(struct ntb_transport_qp *qp)
return 0;
 }
 
-static void ntb_transport_rxc_db(unsigned long data)
+static void ntb_transport_rxc_db(struct tasklet_struct *t)
 {
-   struct ntb_transport_qp *qp = (void *)data;
+   struct ntb_transport_qp *qp = from_tasklet(qp, t, rxc_db_work);
int rc, i;
 
dev_dbg(&qp->ndev->pdev->dev, "%s: doorbell %d received\n",
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drivers: rapidio: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/rapidio/devices/tsi721_dma.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/rapidio/devices/tsi721_dma.c 
b/drivers/rapidio/devices/tsi721_dma.c
index d375c02059f3..4a2bb6d7c692 100644
--- a/drivers/rapidio/devices/tsi721_dma.c
+++ b/drivers/rapidio/devices/tsi721_dma.c
@@ -566,9 +566,9 @@ static void tsi721_advance_work(struct tsi721_bdma_chan 
*bdma_chan,
  bdma_chan->id);
 }
 
-static void tsi721_dma_tasklet(unsigned long data)
+static void tsi721_dma_tasklet(struct tasklet_struct *t)
 {
-   struct tsi721_bdma_chan *bdma_chan = (struct tsi721_bdma_chan *)data;
+   struct tsi721_bdma_chan *bdma_chan = from_tasklet(bdma_chan, t, 
tasklet);
u32 dmac_int, dmac_sts;
 
dmac_int = ioread32(bdma_chan->regs + TSI721_DMAC_INT);
@@ -988,8 +988,7 @@ int tsi721_register_dma(struct tsi721_device *priv)
INIT_LIST_HEAD(&bdma_chan->queue);
INIT_LIST_HEAD(&bdma_chan->free_list);
 
-   tasklet_init(&bdma_chan->tasklet, tsi721_dma_tasklet,
-(unsigned long)bdma_chan);
+   tasklet_setup(&bdma_chan->tasklet, tsi721_dma_tasklet);
list_add_tail(&bdma_chan->dchan.device_node,
  &mport->dma.channels);
nr_channels++;
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drm: i915: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly
and remove the .data field.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/gpu/drm/i915/gt/intel_lrc.c   | 31 ++-
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  8 +++--
 2 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c 
b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 24322ef08aa4..c45e42b9f239 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -3130,9 +3130,10 @@ static bool preempt_timeout(const struct intel_engine_cs 
*const engine)
  * Check the unread Context Status Buffers and manage the submission of new
  * contexts to the ELSP accordingly.
  */
-static void execlists_submission_tasklet(unsigned long data)
+static void execlists_submission_tasklet(struct tasklet_struct *t)
 {
-   struct intel_engine_cs * const engine = (struct intel_engine_cs *)data;
+   struct intel_engine_cs * const engine = from_tasklet(engine, t,
+execlists.tasklet);
bool timeout = preempt_timeout(engine);
 
process_csb(engine);
@@ -4306,9 +4307,10 @@ static void execlists_reset_rewind(struct 
intel_engine_cs *engine, bool stalled)
spin_unlock_irqrestore(&engine->active.lock, flags);
 }
 
-static void nop_submission_tasklet(unsigned long data)
+static void nop_submission_tasklet(struct tasklet_struct *t)
 {
-   struct intel_engine_cs * const engine = (struct intel_engine_cs *)data;
+   struct intel_engine_cs * const engine = from_tasklet(engine, t,
+execlists.tasklet);
 
/* The driver is wedged; don't process any more events. */
WRITE_ONCE(engine->execlists.queue_priority_hint, INT_MIN);
@@ -4391,7 +4393,8 @@ static void execlists_reset_cancel(struct intel_engine_cs 
*engine)
execlists->queue = RB_ROOT_CACHED;
 
GEM_BUG_ON(__tasklet_is_enabled(&execlists->tasklet));
-   execlists->tasklet.func = nop_submission_tasklet;
+   execlists->tasklet.func = (void (*)(unsigned long))
+ nop_submission_tasklet;
 
spin_unlock_irqrestore(&engine->active.lock, flags);
 }
@@ -4986,7 +4989,8 @@ void intel_execlists_set_default_submission(struct 
intel_engine_cs *engine)
 {
engine->submit_request = execlists_submit_request;
engine->schedule = i915_schedule;
-   engine->execlists.tasklet.func = execlists_submission_tasklet;
+   engine->execlists.tasklet.func = (void (*)(unsigned long))
+   execlists_submission_tasklet;
 
engine->reset.prepare = execlists_reset_prepare;
engine->reset.rewind = execlists_reset_rewind;
@@ -5113,8 +5117,7 @@ int intel_execlists_submission_setup(struct 
intel_engine_cs *engine)
struct intel_uncore *uncore = engine->uncore;
u32 base = engine->mmio_base;
 
-   tasklet_init(&engine->execlists.tasklet,
-execlists_submission_tasklet, (unsigned long)engine);
+   tasklet_setup(&engine->execlists.tasklet, execlists_submission_tasklet);
timer_setup(&engine->execlists.timer, execlists_timeslice, 0);
timer_setup(&engine->execlists.preempt, execlists_preempt, 0);
 
@@ -5509,9 +5512,10 @@ static intel_engine_mask_t 
virtual_submission_mask(struct virtual_engine *ve)
return mask;
 }
 
-static void virtual_submission_tasklet(unsigned long data)
+static void virtual_submission_tasklet(struct tasklet_struct *t)
 {
-   struct virtual_engine * const ve = (struct virtual_engine *)data;
+   struct virtual_engine *  ve = from_tasklet(ve, t,
+  base.execlists.tasklet);
const int prio = READ_ONCE(ve->base.execlists.queue_priority_hint);
intel_engine_mask_t mask;
unsigned int n;
@@ -5724,9 +5728,8 @@ intel_execlists_create_virtual(struct intel_engine_cs 
**siblings,
 
INIT_LIST_HEAD(virtual_queue(ve));
ve->base.execlists.queue_priority_hint = INT_MIN;
-   tasklet_init(&ve->base.execlists.tasklet,
-virtual_submission_tasklet,
-(unsigned long)ve);
+   tasklet_setup(&ve->base.execlists.tasklet,
+virtual_submission_tasklet);
 
intel_context_init(&ve->context, &ve->base);
 
@@ -5748,7 +5751,7 @@ intel_execlists_create_virtual(struct intel_engine_cs 
**siblings,
 * layering if we handle cloning of the requests and
 * submitting a copy into each backend.
 */
-   if (sibling->execlists.tasklet.func !=
+ 

[PATCH] drivers: s390: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/s390/block/dasd.c | 18 --
 drivers/s390/char/con3215.c   |  6 +++---
 drivers/s390/char/con3270.c   |  7 +++
 drivers/s390/char/tty3270.c   | 15 +++
 drivers/s390/cio/qdio.h   |  6 +++---
 drivers/s390/cio/qdio_main.c  | 12 ++--
 drivers/s390/cio/qdio_setup.c |  9 +++--
 drivers/s390/net/ctcm_main.c  |  8 +++-
 drivers/s390/net/ctcm_mpc.c   | 16 
 drivers/s390/net/ctcm_mpc.h   |  6 +++---
 10 files changed, 47 insertions(+), 56 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index eb17fea8075c..ec0d8a4ed05f 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -72,8 +72,8 @@ MODULE_LICENSE("GPL");
 static int  dasd_alloc_queue(struct dasd_block *);
 static void dasd_free_queue(struct dasd_block *);
 static int dasd_flush_block_queue(struct dasd_block *);
-static void dasd_device_tasklet(unsigned long);
-static void dasd_block_tasklet(unsigned long);
+static void dasd_device_tasklet(struct tasklet_struct *);
+static void dasd_block_tasklet(struct tasklet_struct *);
 static void do_kick_device(struct work_struct *);
 static void do_restore_device(struct work_struct *);
 static void do_reload_device(struct work_struct *);
@@ -133,8 +133,7 @@ struct dasd_device *dasd_alloc_device(void)
dasd_init_chunklist(&device->ese_chunks, device->ese_mem, PAGE_SIZE * 
2);
spin_lock_init(&device->mem_lock);
atomic_set(&device->tasklet_scheduled, 0);
-   tasklet_init(&device->tasklet, dasd_device_tasklet,
-(unsigned long) device);
+   tasklet_setup(&device->tasklet, dasd_device_tasklet);
INIT_LIST_HEAD(&device->ccw_queue);
timer_setup(&device->timer, dasd_device_timeout, 0);
INIT_WORK(&device->kick_work, do_kick_device);
@@ -174,8 +173,7 @@ struct dasd_block *dasd_alloc_block(void)
atomic_set(&block->open_count, -1);
 
atomic_set(&block->tasklet_scheduled, 0);
-   tasklet_init(&block->tasklet, dasd_block_tasklet,
-(unsigned long) block);
+   tasklet_setup(&block->tasklet, dasd_block_tasklet);
INIT_LIST_HEAD(&block->ccw_queue);
spin_lock_init(&block->queue_lock);
INIT_LIST_HEAD(&block->format_list);
@@ -2187,9 +2185,9 @@ EXPORT_SYMBOL_GPL(dasd_flush_device_queue);
 /*
  * Acquire the device lock and process queues for the device.
  */
-static void dasd_device_tasklet(unsigned long data)
+static void dasd_device_tasklet(struct tasklet_struct *t)
 {
-   struct dasd_device *device = (struct dasd_device *) data;
+   struct dasd_device *device = from_tasklet(device, t, tasklet);
struct list_head final_queue;
 
atomic_set (&device->tasklet_scheduled, 0);
@@ -2929,9 +2927,9 @@ static void __dasd_block_start_head(struct dasd_block 
*block)
  * block layer request queue, creates ccw requests, enqueues them on
  * a dasd_device and processes ccw requests that have been returned.
  */
-static void dasd_block_tasklet(unsigned long data)
+static void dasd_block_tasklet(struct tasklet_struct *t)
 {
-   struct dasd_block *block = (struct dasd_block *) data;
+   struct dasd_block *block = from_tasklet(block, t, tasklet);
struct list_head final_queue;
struct list_head *l, *n;
struct dasd_ccw_req *cqr;
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 92757f9bd010..ab5964cffb91 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -334,9 +334,9 @@ static inline void raw3215_try_io(struct raw3215_info *raw)
 /*
  * Call tty_wakeup from tasklet context
  */
-static void raw3215_wakeup(unsigned long data)
+static void raw3215_wakeup(struct tasklet_struct *t)
 {
-   struct raw3215_info *raw = (struct raw3215_info *) data;
+   struct raw3215_info *raw = from_tasklet(raw, t, tlet);
struct tty_struct *tty;
 
tty = tty_port_tty_get(&raw->port);
@@ -673,7 +673,7 @@ static struct raw3215_info *raw3215_alloc_info(void)
 
timer_setup(&info->timer, raw3215_timeout, 0);
init_waitqueue_head(&info->empty_wait);
-   tasklet_init(&info->tlet, raw3215_wakeup, (unsigned long)info);
+   tasklet_setup(&info->tlet, raw3215_wakeup);
tty_port_init(&info->port);
 
return info;
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
index e17364e13d2f..02de4281d5b7 100644
--- a/drivers/s390/char/con3270.c
+++ b/drivers/s390/char/con3270.c
@@ -291,8 +291,9 @@ con

[PATCH 1/2] mailbox: bcm: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/mailbox/bcm-pdc-mailbox.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mailbox/bcm-pdc-mailbox.c 
b/drivers/mailbox/bcm-pdc-mailbox.c
index 53945ca5d785..5b375985f7b8 100644
--- a/drivers/mailbox/bcm-pdc-mailbox.c
+++ b/drivers/mailbox/bcm-pdc-mailbox.c
@@ -962,9 +962,9 @@ static irqreturn_t pdc_irq_handler(int irq, void *data)
  * a DMA receive interrupt. Reenables the receive interrupt.
  * @data: PDC state structure
  */
-static void pdc_tasklet_cb(unsigned long data)
+static void pdc_tasklet_cb(struct tasklet_struct *t)
 {
-   struct pdc_state *pdcs = (struct pdc_state *)data;
+   struct pdc_state *pdcs = from_tasklet(pdcs, t, rx_tasklet);
 
pdc_receive(pdcs);
 
@@ -1589,7 +1589,7 @@ static int pdc_probe(struct platform_device *pdev)
pdc_hw_init(pdcs);
 
/* Init tasklet for deferred DMA rx processing */
-   tasklet_init(&pdcs->rx_tasklet, pdc_tasklet_cb, (unsigned long)pdcs);
+   tasklet_setup(&pdcs->rx_tasklet, pdc_tasklet_cb);
 
err = pdc_interrupts_init(pdcs);
if (err)
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] drivers: vme: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/vme/bridges/vme_fake.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/vme/bridges/vme_fake.c b/drivers/vme/bridges/vme_fake.c
index 6a1bc284f297..38dd5f949cd0 100644
--- a/drivers/vme/bridges/vme_fake.c
+++ b/drivers/vme/bridges/vme_fake.c
@@ -90,13 +90,13 @@ static struct device *vme_root;
 /*
  * Calling VME bus interrupt callback if provided.
  */
-static void fake_VIRQ_tasklet(unsigned long data)
+static void fake_VIRQ_tasklet(struct tasklet_struct *t)
 {
struct vme_bridge *fake_bridge;
struct fake_driver *bridge;
 
-   fake_bridge = (struct vme_bridge *) data;
-   bridge = fake_bridge->driver_priv;
+   bridge = from_tasklet(bridge, t, int_tasklet);
+   fake_bridge = bridge->parent;
 
vme_irq_handler(fake_bridge, bridge->int_level, bridge->int_statid);
 }
@@ -1098,8 +1098,7 @@ static int __init fake_init(void)
/* Initialize wait queues & mutual exclusion flags */
mutex_init(&fake_device->vme_int);
mutex_init(&fake_bridge->irq_mtx);
-   tasklet_init(&fake_device->int_tasklet, fake_VIRQ_tasklet,
-   (unsigned long) fake_bridge);
+   tasklet_setup(&fake_device->int_tasklet, fake_VIRQ_tasklet);
 
strcpy(fake_bridge->name, driver_name);
 
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] input: serio: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/input/serio/hp_sdc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
index 13eacf6ab431..91f8253ac66a 100644
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -301,7 +301,7 @@ static irqreturn_t hp_sdc_nmisr(int irq, void *dev_id)
 
 unsigned long hp_sdc_put(void);
 
-static void hp_sdc_tasklet(unsigned long foo)
+static void hp_sdc_tasklet(struct tasklet_struct *unused)
 {
write_lock_irq(&hp_sdc.rtq_lock);
 
@@ -890,7 +890,7 @@ static int __init hp_sdc_init(void)
hp_sdc_status_in8();
hp_sdc_data_in8();
 
-   tasklet_init(&hp_sdc.task, hp_sdc_tasklet, 0);
+   tasklet_setup(&hp_sdc.task, hp_sdc_tasklet, 0);
 
/* Sync the output buffer registers, thus scheduling hp_sdc_tasklet. */
t_sync.actidx   = 0;
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] firewire: ohci: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/firewire/ohci.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 7dde21b18b04..6298ff03796e 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -921,9 +921,9 @@ static void ar_recycle_buffers(struct ar_context *ctx, 
unsigned int end_buffer)
}
 }
 
-static void ar_context_tasklet(unsigned long data)
+static void ar_context_tasklet(struct tasklet_struct *t)
 {
-   struct ar_context *ctx = (struct ar_context *)data;
+   struct ar_context *ctx = from_tasklet(ctx, t, tasklet);
unsigned int end_buffer_index, end_buffer_offset;
void *p, *end;
 
@@ -977,7 +977,7 @@ static int ar_context_init(struct ar_context *ctx, struct 
fw_ohci *ohci,
 
ctx->regs= regs;
ctx->ohci= ohci;
-   tasklet_init(&ctx->tasklet, ar_context_tasklet, (unsigned long)ctx);
+   tasklet_setup(&ctx->tasklet, ar_context_tasklet);
 
for (i = 0; i < AR_BUFFERS; i++) {
ctx->pages[i] = alloc_page(GFP_KERNEL | GFP_DMA32);
@@ -1049,9 +1049,9 @@ static struct descriptor *find_branch_descriptor(struct 
descriptor *d, int z)
return d + z - 1;
 }
 
-static void context_tasklet(unsigned long data)
+static void context_tasklet(struct tasklet_struct *t)
 {
-   struct context *ctx = (struct context *) data;
+   struct context *ctx = from_tasklet(ctx, t, tasklet);
struct descriptor *d, *last;
u32 address;
int z;
@@ -1145,7 +1145,7 @@ static int context_init(struct context *ctx, struct 
fw_ohci *ohci,
ctx->buffer_tail = list_entry(ctx->buffer_list.next,
struct descriptor_buffer, list);
 
-   tasklet_init(&ctx->tasklet, context_tasklet, (unsigned long)ctx);
+   tasklet_setup(&ctx->tasklet, context_tasklet);
ctx->callback = callback;
 
/*
@@ -1420,7 +1420,7 @@ static void at_context_flush(struct context *ctx)
tasklet_disable(&ctx->tasklet);
 
ctx->flushing = true;
-   context_tasklet((unsigned long)ctx);
+   context_tasklet(&ctx->tasklet);
ctx->flushing = false;
 
tasklet_enable(&ctx->tasklet);
@@ -3472,7 +3472,7 @@ static int ohci_flush_iso_completions(struct 
fw_iso_context *base)
tasklet_disable(&ctx->context.tasklet);
 
if (!test_and_set_bit_lock(0, &ctx->flushing_completions)) {
-   context_tasklet((unsigned long)&ctx->context);
+   context_tasklet(&ctx->context.tasklet);
 
switch (base->type) {
case FW_ISO_CONTEXT_TRANSMIT:
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] hsi: nokia-modem: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/hsi/clients/nokia-modem.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/hsi/clients/nokia-modem.c 
b/drivers/hsi/clients/nokia-modem.c
index cd7ebf4c2e2f..36d373f089ce 100644
--- a/drivers/hsi/clients/nokia-modem.c
+++ b/drivers/hsi/clients/nokia-modem.c
@@ -36,9 +36,10 @@ struct nokia_modem_device {
struct hsi_client   *cmt_speech;
 };
 
-static void do_nokia_modem_rst_ind_tasklet(unsigned long data)
+static void do_nokia_modem_rst_ind_tasklet(struct tasklet_struct *t)
 {
-   struct nokia_modem_device *modem = (struct nokia_modem_device *)data;
+   struct nokia_modem_device *modem = from_tasklet(modem, t,
+   nokia_modem_rst_ind_tasklet);
 
if (!modem)
return;
@@ -155,8 +156,8 @@ static int nokia_modem_probe(struct device *dev)
modem->nokia_modem_rst_ind_irq = irq;
pflags = irq_get_trigger_type(irq);
 
-   tasklet_init(&modem->nokia_modem_rst_ind_tasklet,
-   do_nokia_modem_rst_ind_tasklet, (unsigned long)modem);
+   tasklet_setup(&modem->nokia_modem_rst_ind_tasklet,
+   do_nokia_modem_rst_ind_tasklet);
err = devm_request_irq(dev, irq, nokia_modem_rst_ind_isr,
pflags, "modem_rst_ind", modem);
if (err < 0) {
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] memstick: jmb38x: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/memstick/host/jmb38x_ms.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/memstick/host/jmb38x_ms.c 
b/drivers/memstick/host/jmb38x_ms.c
index 4a6b866b0291..2bcf5ce113bd 100644
--- a/drivers/memstick/host/jmb38x_ms.c
+++ b/drivers/memstick/host/jmb38x_ms.c
@@ -603,10 +603,10 @@ static void jmb38x_ms_abort(struct timer_list *t)
spin_unlock_irqrestore(&host->lock, flags);
 }
 
-static void jmb38x_ms_req_tasklet(unsigned long data)
+static void jmb38x_ms_req_tasklet(struct tasklet_struct *t)
 {
-   struct memstick_host *msh = (struct memstick_host *)data;
-   struct jmb38x_ms_host *host = memstick_priv(msh);
+   struct jmb38x_ms_host *host = from_tasklet(host, t, notify);
+   struct memstick_host *msh = host->msh;
unsigned long flags;
int rc;
 
@@ -868,7 +868,7 @@ static struct memstick_host *jmb38x_ms_alloc_host(struct 
jmb38x_ms *jm, int cnt)
host->irq = jm->pdev->irq;
host->timeout_jiffies = msecs_to_jiffies(1000);
 
-   tasklet_init(&host->notify, jmb38x_ms_req_tasklet, (unsigned long)msh);
+   tasklet_setup(&host->notify, jmb38x_ms_req_tasklet);
msh->request = jmb38x_ms_submit_req;
msh->set_param = jmb38x_ms_set_param;
 
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] misc: ibmvmc: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/misc/ibmvmc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c
index 2d778d0f011e..347278c1a5e4 100644
--- a/drivers/misc/ibmvmc.c
+++ b/drivers/misc/ibmvmc.c
@@ -2064,10 +2064,10 @@ static void ibmvmc_handle_crq(struct ibmvmc_crq_msg 
*crq,
}
 }
 
-static void ibmvmc_task(unsigned long data)
+static void ibmvmc_task(struct tasklet_struct *t)
 {
-   struct crq_server_adapter *adapter =
-   (struct crq_server_adapter *)data;
+   struct crq_server_adapter *adapter = from_tasklet(adapter, t,
+ work_task);
struct vio_dev *vdev = to_vio_dev(adapter->dev);
struct ibmvmc_crq_msg *crq;
int done = 0;
@@ -2150,7 +2150,7 @@ static int ibmvmc_init_crq_queue(struct 
crq_server_adapter *adapter)
queue->cur = 0;
spin_lock_init(&queue->lock);
 
-   tasklet_init(&adapter->work_task, ibmvmc_task, (unsigned long)adapter);
+   tasklet_setup(&adapter->work_task, ibmvmc_task);
 
if (request_irq(vdev->irq,
ibmvmc_handle_event,
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] platform: goldfish: convert tasklets to use new tasklet_setup() API

2020-08-17 Thread Allen Pais
From: Allen Pais 

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 drivers/platform/goldfish/goldfish_pipe.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/goldfish/goldfish_pipe.c 
b/drivers/platform/goldfish/goldfish_pipe.c
index 1ab207ec9c94..b9bead07760c 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -577,10 +577,10 @@ static struct goldfish_pipe *signalled_pipes_pop_front(
return pipe;
 }
 
-static void goldfish_interrupt_task(unsigned long dev_addr)
+static void goldfish_interrupt_task(struct tasklet_struct *t)
 {
/* Iterate over the signalled pipes and wake them one by one */
-   struct goldfish_pipe_dev *dev = (struct goldfish_pipe_dev *)dev_addr;
+   struct goldfish_pipe_dev *dev = from_tasklet(dev, t, irq_tasklet);
struct goldfish_pipe *pipe;
int wakes;
 
@@ -811,8 +811,7 @@ static int goldfish_pipe_device_init(struct platform_device 
*pdev,
 {
int err;
 
-   tasklet_init(&dev->irq_tasklet, &goldfish_interrupt_task,
-(unsigned long)dev);
+   tasklet_setup(&dev->irq_tasklet, &goldfish_interrupt_task);
 
err = devm_request_irq(&pdev->dev, dev->irq,
   goldfish_pipe_interrupt,
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] net: atm: convert tasklets callbacks to use from_tasklet()

2020-08-17 Thread Allen Pais
From: Allen Pais 

Update all the callbacks of all tasklets by using
from_tasklet() and remove .data field.

Signed-off-by: Romain Perier 
Signed-off-by: Allen Pais 
---
 net/atm/pppoatm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index 579b66da1d95..3803be8470f7 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -416,7 +416,6 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void 
__user *arg)
pvcc->chan.mtu = atmvcc->qos.txtp.max_sdu - PPP_HDRLEN -
(be.encaps == e_vc ? 0 : LLC_LEN);
pvcc->wakeup_tasklet = tasklet_proto;
-   pvcc->wakeup_tasklet.data = (unsigned long) &pvcc->chan;
err = ppp_register_channel(&pvcc->chan);
if (err != 0) {
kfree(pvcc);
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] block: convert tasklets to use new tasklet_setup() API

2020-08-25 Thread Allen Pais
On Thu, Aug 20, 2020 at 3:09 AM James Bottomley
 wrote:
>
> On Wed, 2020-08-19 at 21:54 +0530, Allen wrote:
> > > [...]
> > > > > Since both threads seem to have petered out, let me suggest in
> > > > > kernel.h:
> > > > >
> > > > > #define cast_out(ptr, container, member) \
> > > > > container_of(ptr, typeof(*container), member)
> > > > >
> > > > > It does what you want, the argument order is the same as
> > > > > container_of with the only difference being you name the
> > > > > containing structure instead of having to specify its type.
> > > >
> > > > Not to incessantly bike shed on the naming, but I don't like
> > > > cast_out, it's not very descriptive. And it has connotations of
> > > > getting rid of something, which isn't really true.
> > >
> > > Um, I thought it was exactly descriptive: you're casting to the
> > > outer container.  I thought about following the C++ dynamic casting
> > > style, so out_cast(), but that seemed a bit pejorative.  What about
> > > outer_cast()?
> > >
> > > > FWIW, I like the from_ part of the original naming, as it has
> > > > some clues as to what is being done here. Why not just
> > > > from_container()? That should immediately tell people what it
> > > > does without having to look up the implementation, even before
> > > > this becomes a part of the accepted coding norm.
> > >
> > > I'm not opposed to container_from() but it seems a little less
> > > descriptive than outer_cast() but I don't really care.  I always
> > > have to look up container_of() when I'm using it so this would just
> > > be another macro of that type ...
> > >
> >
> >  So far we have a few which have been suggested as replacement
> > for from_tasklet()
> >
> > - out_cast() or outer_cast()
> > - from_member().
> > - container_from() or from_container()
> >
> > from_container() sounds fine, would trimming it a bit work? like
> > from_cont().
>
> I'm fine with container_from().  It's the same form as container_of()
> and I think we need urgent agreement to not stall everything else so
> the most innocuous name is likely to get the widest acceptance.

Kees,

  Will you be  sending the newly proposed API to Linus? I have V2
which uses container_from()
ready to be sent out.

Thanks.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


REPLY

2022-01-24 Thread Jørgen H Allen
Good Day Friend,

My name is Jørgen H. Allen, I have an important discussion for you. Please 
revert back to me ASAP for it worth. Thanks
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel