lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vd8XhcW5xr9ttyOT=5gBy3QBdeGnP8knx5fK=Nea9N0kA@mail.gmail.com>
Date:	Tue, 24 May 2016 22:07:32 +0300
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	Rajneesh Bhardwaj <rajneesh.bhardwaj@...el.com>
Cc:	platform-driver-x86@...r.kernel.org,
	"dvhart@...radead.org" <dvhart@...radead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Olof Johansson <olof@...om.net>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>, dbasehore@...gle.com,
	vishwanath.somayaji@...el.com
Subject: Re: [PATCH v5] platform:x86: Add PMC Driver for Intel Core SoC

On Tue, May 24, 2016 at 9:54 PM, Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Tue, May 24, 2016 at 5:25 PM, Rajneesh Bhardwaj
> <rajneesh.bhardwaj@...el.com> wrote:

>> +static int pmc_core_dev_state_show(struct seq_file *s, void *unused)
>> +{
>> +       struct pmc_dev *pmcdev = s->private;
>> +       u32 counter_val;
>> +
>> +       counter_val = pmc_core_reg_read(pmcdev,
>> +                                       SPT_PMC_SLP_S0_RES_COUNTER_OFFSET);
>> +       seq_printf(s, "%u\n", pmc_core_adjust_slp_s0_step(counter_val));
>> +
>> +       return 0;
>> +}
>> +
>> +static int pmc_core_dev_state_open(struct inode *inode, struct file *file)
>> +{
>> +       return single_open(file, pmc_core_dev_state_show, inode->i_private);
>> +}
>> +
>> +static const struct file_operations pmc_core_dev_state_ops = {
>> +       .open           = pmc_core_dev_state_open,
>> +       .read           = seq_read,
>> +       .llseek         = seq_lseek,
>> +       .release        = single_release,
>> +};
>
> I suppose DEFINE_SIMPLE_ATTRIBUTE might reduce amount of LOC.

Correction:
DEFINE_DEBUGFS_ATTRIBUTE()

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ