On Thu, Oct 20, 2016 at 07:01:51PM +0530, Nayna wrote:
> 
> 
> On 10/20/2016 01:04 PM, Winkler, Tomas wrote:
> > > On Tue, Oct 18, 2016 at 08:49:45PM -0400, Nayna Jain wrote:
> > > > This patch removes the unnecessary error messages on failing to
> > > > allocate memory and replaces pr_err/printk with dev_dbg/dev_info as
> > > > applicable.
> > > > 
> > > > Suggested-by: Jason Gunthorpe <jguntho...@obsidianresearch.com>
> > > > Signed-off-by: Nayna Jain <na...@linux.vnet.ibm.com>
> > > 
> > > Reviewed-by: Jarkko Sakkinen <jarkko.sakki...@linux.intel.com>
> > > 
> > > /Jarkko
> > > 
> > > > ---
> > > >   drivers/char/tpm/tpm_acpi.c | 17 +++++------------
> > > >   drivers/char/tpm/tpm_of.c   | 30 ++++++++++--------------------
> > > >   2 files changed, 15 insertions(+), 32 deletions(-)
> > > > 
> > > > diff --git a/drivers/char/tpm/tpm_acpi.c b/drivers/char/tpm/tpm_acpi.c
> > > > index 859bdba..22e42da 100644
> > > > --- a/drivers/char/tpm/tpm_acpi.c
> > > > +++ b/drivers/char/tpm/tpm_acpi.c
> > > > @@ -60,11 +60,8 @@ int read_log_acpi(struct tpm_chip *chip)
> > > >         status = acpi_get_table(ACPI_SIG_TCPA, 1,
> > > >                                 (struct acpi_table_header **)&buff);
> > > > 
> > > > -       if (ACPI_FAILURE(status)) {
> > > > -               printk(KERN_ERR "%s: ERROR - Could not get TCPA 
> > > > table\n",
> > > > -                      __func__);
> > > > +       if (ACPI_FAILURE(status))
> > > >                 return -EIO;
> > > > -       }
> > > > 
> > > >         switch(buff->platform_class) {
> > > >         case BIOS_SERVER:
> > > > @@ -78,25 +75,21 @@ int read_log_acpi(struct tpm_chip *chip)
> > > >                 break;
> > > >         }
> > > >         if (!len) {
> > > > -               printk(KERN_ERR "%s: ERROR - TCPA log area empty\n",
> > > __func__);
> > > > +               dev_dbg(&chip->dev, "%s: ERROR - TCPA log area empty\n",
> > > > +                       __func__);
> > 
> > 
> > Why to keep __func__ here, dev_dbg already does it for you.
> 
> I tried to trace through dev_dbg
> - http://lxr.free-electrons.com/source/include/linux/device.h#L1195
> which further calls dev_printk from
> http://lxr.free-electrons.com/source/drivers/base/core.c#L2199
> 
> I couldn't find it printing __func__ anywhere.. I just see it printing
> "driver" and "dev" as tpm : tpm0.
> 
> Please let me know if I am missing something
> 
> Thanks & Regards,
> - Nayna

Sorry I mixed up in my last response. You can filter in dynamic
debug with a function name but doesn't print function name.

Anyway I would recommend to change this to dev_err in a way that
I explained in my response.

/Jarkko

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to