X86 platform drivers
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
Cc: platform-driver-x86@vger.kernel.org,
	Darren Hart <dvhart@infradead.org>,
	Vishwanath Somayaji <vishwanath.somayaji@intel.com>
Subject: Re: [PATCH v1 1/1] platform/x86/intel_pmc_core: Convert to DEFINE_DEBUGFS_ATTRIBUTE
Date: Wed, 29 Jun 2016 14:49:45 +0300	[thread overview]
Message-ID: <1467200985.30123.320.camel@linux.intel.com> (raw)
In-Reply-To: <20160629080325.GA11318@rajaneesh-OptiPlex-9010>

On Wed, 2016-06-29 at 13:33 +0530, Rajneesh Bhardwaj wrote:
> On Tue, Jun 28, 2016 at 01:05:07PM +0300, Andy Shevchenko wrote:
> > On Tue, 2016-06-28 at 14:35 +0530, Rajneesh Bhardwaj wrote:
> > > On Mon, Jun 13, 2016 at 08:56:49PM +0300, Andy Shevchenko wrote:
> > > > This patch does the following:
> > > > - refactors code to use recently introduced
> > > > DEFINE_DEBUGFS_ATTRIBUTE() macro
> > > > - makes absence of DEBUG_FS non-fatal error
> > 
> > 
> > > > -	counter_val = pmc_core_reg_read(pmcdev,
> > > > -					SPT_PMC_SLP_S0_RES_COUN
> > > > TER_
> > > > OFFSET);
> > > > -	seq_printf(s, "%u\n",
> > > > pmc_core_adjust_slp_s0_step(counter_val));
> > > > +	value = pmc_core_reg_read(pmcdev,
> > > > SPT_PMC_SLP_S0_RES_COUNTER_OFFSET);
> > > > +	*val = pmc_core_adjust_slp_s0_step(value);
> > > >  
> > > 
> > > We were ensuring a new line for printing the output value with
> > > seq_printf 
> > > whereas in this case the output is printed along with the shell
> > > prompt.
> > > Sometimes this could be harder to read.
> > 
> > This would be a difference in the behaviour to a generic assumption
> > (since this new macro is going to be used by plenty of simple
> > attributes
> > under debugfs). If you still consider it's inappropriate I would
> > recommend to propose a fix globally then.
> > 
> > Regarding to change behaviour of the current implementation I think
> > Darren can tell his opinion. (For me at least pros and cons of new
> > format quite obvious).
> > 
> 
> While this is good for simple attributes i see a potential issue with
> this
> approch when we want to display multiple attributes for a single
> debugfs
> entry.
>  We typically use seq_printf in a loop and display multiline output
> for a single debugfs entry. How do we go about the scenarios where we
> want
> to display formatted  multiline debug information?

We are talking about abstract case or is it change coming to this very
driver?

>  
> > >  
> > > > +struct dentry;
> > > > +
> > > 
> > > Why do we need this ?
> > 
> > Since we are using pointer to undefined type.
> > 
> 
> I think we can omit this line if we chose to take this approach.

Yeah, it does not produce a warning on new compilers, though I think
Darren can share his opinion.


-- 

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2016-06-29 11:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 17:56 [PATCH v1 1/1] platform/x86/intel_pmc_core: Convert to DEFINE_DEBUGFS_ATTRIBUTE Andy Shevchenko
2016-06-23 15:26 ` Rajneesh Bhardwaj
2016-06-23 16:22   ` Andy Shevchenko
2016-06-28  9:05 ` Rajneesh Bhardwaj
2016-06-28 10:05   ` Andy Shevchenko
2016-06-29  8:03     ` Rajneesh Bhardwaj
2016-06-29 11:49       ` Andy Shevchenko [this message]
2016-06-29 12:16         ` Rajneesh Bhardwaj
2016-06-29 12:48           ` Andy Shevchenko
2016-06-29 13:20             ` Rajneesh Bhardwaj
2016-06-29 13:33               ` Andy Shevchenko
2016-07-01 21:30                 ` Darren Hart
2016-07-04 11:35                 ` Rajneesh Bhardwaj
2016-07-04 12:01                   ` Andy Shevchenko
2016-07-04 12:28                     ` Rajneesh Bhardwaj
2016-07-01 21:28           ` Darren Hart
2016-07-01 21:24     ` Darren Hart
2016-07-02 12:10       ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467200985.30123.320.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=dvhart@infradead.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rajneesh.bhardwaj@intel.com \
    --cc=vishwanath.somayaji@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox