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]
Message-ID: <5443C357.6050309@broadcom.com>
Date:	Sun, 19 Oct 2014 15:57:43 +0200
From:	Arend van Spriel <arend@...adcom.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] debugfs: add helper function to create device related
 seq_file

On 12-10-14 10:13, Arend van Spriel wrote:
> On 11-10-14 22:17, Greg Kroah-Hartman wrote:
>> On Sat, Oct 11, 2014 at 06:01:55PM +0200, Arend van Spriel wrote:
>>> This patch adds a helper function that simplifies adding a
>>> sequence file for device drivers. The calling device driver
>>> needs to provide a read function and a device pointer. The
>>> field struct seq_file::private will reference the device
>>> pointer upon call to the read function so the driver can
>>> obtain his data from it and do its seq_printf() calls.
>>>
>>> Signed-off-by: Arend van Spriel <arend@...adcom.com>
>>> ---
>>>  fs/debugfs/file.c       | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
>>>  include/linux/debugfs.h | 16 ++++++++++++++-
>>>  2 files changed, 69 insertions(+), 1 deletion(-)
>>
>> Do you have some kernel code pending that needs this change?  Or can
>> existing users be moved to it, saving them code?
> 
> Yes and maybe. I made a similar change in our brcm80211 drivers, but
> figured it may be useful for other device drivers. So when this gets in
> the kernel I want to align the brcm80211 drivers. I will also have a
> quick look at the wireless drivers and get some metrics about code savings.

Hi, Greg

Killed a bit of time between lpc sessions in dusseldorf. I picked the
ath9k wireless driver as a test case. I made the changes in two steps.
First step was changing to use seq_file api and second step made use of
the helper function:

		original	seq_file	helper
logstat		-		173+/255-	32+/96-
ath9k.o		115968		113224		111024	(.text size)

I am considering to make an attempt at capturing the transition in a
SmPL script so it can be applied to other drivers as well. Have to do a
bit of self-study for that ;-)

Regards,
Arend

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ