diff mbox

[1/2] hdata: Make out-of-range idata print at PR_DEBUG

Message ID 20170526062839.11009-1-oohall@gmail.com
State Accepted
Headers show

Commit Message

Oliver O'Halloran May 26, 2017, 6:28 a.m. UTC
Some fields just aren't populated on some systems.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hdata/hdif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Gavin Shan May 26, 2017, 6:44 a.m. UTC | #1
On Fri, May 26, 2017 at 04:28:38PM +1000, Oliver O'Halloran wrote:
>Some fields just aren't populated on some systems.
>
>Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

>---
> hdata/hdif.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/hdata/hdif.c b/hdata/hdif.c
>index dd5e12285f32..b616a331a0bc 100644
>--- a/hdata/hdif.c
>+++ b/hdata/hdif.c
>@@ -30,8 +30,8 @@ const void *HDIF_get_idata(const struct HDIF_common_hdr *hdif, unsigned int di,
> 	}
> 
> 	if (di >= be16_to_cpu(hdr->idptr_count)) {
>-		prerror("HDIF: idata index out of range !\n");
>-		backtrace();
>+		prlog(PR_DEBUG, "HDIF: idata %d out of range for %.6s!\n",
>+			di, hdr->id);

Maybe it deserves a PR_WARNING?


> 		return NULL;
> 	}
> 

Cheers,
Gavin
Stewart Smith June 6, 2017, 11:16 a.m. UTC | #2
Oliver O'Halloran <oohall@gmail.com> writes:
> Some fields just aren't populated on some systems.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Thanks, series merged to master as of cc7b746192f04df04cce5737771d2e7703006142
diff mbox

Patch

diff --git a/hdata/hdif.c b/hdata/hdif.c
index dd5e12285f32..b616a331a0bc 100644
--- a/hdata/hdif.c
+++ b/hdata/hdif.c
@@ -30,8 +30,8 @@  const void *HDIF_get_idata(const struct HDIF_common_hdr *hdif, unsigned int di,
 	}
 
 	if (di >= be16_to_cpu(hdr->idptr_count)) {
-		prerror("HDIF: idata index out of range !\n");
-		backtrace();
+		prlog(PR_DEBUG, "HDIF: idata %d out of range for %.6s!\n",
+			di, hdr->id);
 		return NULL;
 	}