From patchwork Fri Jan 6 00:42:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 711620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tvm3T5LP5z9sf9 for ; Fri, 6 Jan 2017 11:42:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="of+chZKW"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tvm3T4FnnzDqTx for ; Fri, 6 Jan 2017 11:42:29 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="of+chZKW"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tvm3L3s3QzDqSW for ; Fri, 6 Jan 2017 11:42:22 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="of+chZKW"; dkim-atps=neutral Received: by mail-pg0-x242.google.com with SMTP id g1so42205550pgn.0 for ; Thu, 05 Jan 2017 16:42:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hJPbD8Ebwi79ddxXL/26/7f2g2N3cLk+OR7qBSXQvjE=; b=of+chZKW/ByUqItPOZBFHRV1ZhO0y107d94alL+UNO7pbt5hYX6hA61CTiu8OiQgtl T4kyaikF7XYr73damW7/F78N1JW7PdiSsvnE+kaPuGVvciVKttEnZMr17VRTkFfxPBgc RotJiGqsTAZIszAbnYQc1JEDZO1fU0VUuPRCI4oRImZ+TFfj2EppZsuWXbBob4pHU3Nb Zbp4697H8IIj1tG1rZ7vAlIQ2I1DM0FzwtEAVTLupiIU2qX366MOAmREamJDGvtb463u x32/db+M7VKWMW9VTD/95l9u6QpvmhxSxjrMIoiJCgZLPPqwqckQBDEnIjY64elooSc7 Q++w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hJPbD8Ebwi79ddxXL/26/7f2g2N3cLk+OR7qBSXQvjE=; b=j2wOMNGCTWxdGHLTaU+n0V/MPQIkCVhsxQ8OYAuIoZgSzuF0jac2T+vj0UdO3JmDlb D/Fz4FxWDSWCczGT3DKpvXT8PBvwjGFUGVmWxewrY5qJQonMbuDzy5jF3aq1jAs/SFLR pnuh4A+n7GUZbLTQpVhOohUuqk31vdG+uM7HNQXk//otg5sT3szmpEkoG0Mo3I2eegWh IpqI1a9whkqOOP5GfWkOHS94Vc9a4rT1K5E/PX7dVV/1zBj6s0sS1sod5C10Zc0PpxAl /YRH0T7myzOg242NWZptXotpcRm83h3obRT5DKcxGrV+0jDkVp/Sx4g0M32FdrhOfHEJ wvYg== X-Gm-Message-State: AIkVDXILwTKOoRvzyYTeoff9Vt/wV97ddrAZUuYMK2W3H9s7BhzsjxWIhSNO0wQzPHZHBQ== X-Received: by 10.99.61.13 with SMTP id k13mr137647662pga.154.1483663340493; Thu, 05 Jan 2017 16:42:20 -0800 (PST) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id p25sm155864938pfk.20.2017.01.05.16.42.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2017 16:42:20 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 6 Jan 2017 11:42:06 +1100 Message-Id: <1483663326-32107-1-git-send-email-oohall@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Skiboot] [PATCH] hdat: make HDIF_child() print more useful errors X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The HDAT has very fixed relationships between a parent and child structures. When parsing the HDAT we always know what type of child that we expect and we will error out if there is a mismatch between what we get and what expect. This patch just prints out what we got in addition to what we expected to help with debugging. Signed-off-by: Oliver O'Halloran --- hdata/hdif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hdata/hdif.c b/hdata/hdif.c index 25c00008138f..62ba69f2e887 100644 --- a/hdata/hdif.c +++ b/hdata/hdif.c @@ -131,8 +131,8 @@ struct HDIF_common_hdr *HDIF_child(const struct HDIF_common_hdr *hdif, ret = base + be32_to_cpu(child->offset) + be32_to_cpu(child->size) * idx; if (!HDIF_check(ret, eyecatcher)) { - prerror("HDIF: %s child #%i bad type\n", - eyecatcher, idx); + prerror("HDIF: #%i bad type (wanted %6s, got %6s)\n", + idx, eyecatcher, ret->id); return NULL; }