lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 27 Feb 2024 11:06:28 -0800
From: Allen Pais <apais@...ux.microsoft.com>
To: Tejun Heo <tj@...nel.org>
Cc: jiangshanlai@...il.com,
 Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] workqueue: Introduce from_wq() helper for cleaner
 callback declarations

> 
> 
> On Tue, Feb 27, 2024 at 06:56:28PM +0000, Allen Pais wrote:
>> To streamline the transition from tasklets to worqueues, a new helper
>> function, from_wq(), is introduced. This helper, inspired by existing
>> from_() patterns, utilizes container_of() and eliminates the redundancy
>> of declaring variable types, leading to more concise and readable code.
>> 
>> The modified code snippet demonstrates the enhanced clarity achieved
>> with from_wq():
>> 
>>  void callback(struct work_struct *w)
>>   {
>>     - struct some_data_structure *local = container_of(w,
>> 						       struct some_data_structure,
>> 						       work);
>>     + struct some_data_structure *local = from_wq(local, w, work);
> 
> I'm not necessarily against it but it's a bit meh in terms of how much it
> saves. Also, can you please name it from_work()?

  I agree :). It does help a little in conversion. Sure, will send out a v2 right away.

Thanks.

> 
> Thanks.
> 
> -- 
> tejun


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ