From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Subject: Re: [PATCH v5 7/7] tpm: replace or remove printk error messages Date: Thu, 20 Oct 2016 14:24:00 +0300 Message-ID: <20161020112400.75pwp5ttk3yxuinq@intel.com> References: <1476838185-24007-1-git-send-email-nayna@linux.vnet.ibm.com> <1476838185-24007-8-git-send-email-nayna@linux.vnet.ibm.com> <20161019161854.iuzgacimusfcivvf@intel.com> <5B8DA87D05A7694D9FA63FD143655C1B5430045A@hasmsx108.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B5430045A-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Winkler, Tomas" Cc: "tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" List-Id: tpmdd-devel@lists.sourceforge.net On Thu, Oct 20, 2016 at 07:34:37AM +0000, 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 > > > Signed-off-by: Nayna Jain > > > > Reviewed-by: Jarkko Sakkinen > > > > /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. Good catch. I would actually consider also changing this to dev_err(dev, FW_BUG "TCPA log area empty\n"); If TCPA exists but it's empty, that's most likely a FW bug. /Jarkko ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot