From patchwork Thu Nov 30 05:31:24 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: 842884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ynQyX50Djz9t2V for ; Thu, 30 Nov 2017 16:32:20 +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="uOtgFvaL"; 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 3ynQyX2hqPzDsGR for ; Thu, 30 Nov 2017 16:32:20 +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="uOtgFvaL"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c00::244; helo=mail-pf0-x244.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uOtgFvaL"; dkim-atps=neutral Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (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 3ynQxx0m0nzDrq9 for ; Thu, 30 Nov 2017 16:31:48 +1100 (AEDT) Received: by mail-pf0-x244.google.com with SMTP id c204so2650781pfc.13 for ; Wed, 29 Nov 2017 21:31:48 -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:in-reply-to:references; bh=BUo8fyGvKfIIXNUby91Vvrr7AwaCfremVGPaAvsKH5I=; b=uOtgFvaLipPe6cWBgF1n2mzp3IWsE74vsxvlUqJz5L389bWHRQjWUjWo+gv/6rotaN EPLcwyfeDm4/kXm+ZaivYY+v6+pW5HjMyjifZS43GiawHhiDpzsZcX4zR8/YU0G5jUjT qne4fmJl3AqoXcmXABOdtf2FdtUOC3pL7OEyAwmTUXbSG1ZHJ0IyUv5srSWBGsdogAYh DIGVmAWsy8wPBLCk0dLaQitWEQGdxo8TF169zOMFQMR88T7CgzCI72VjM/9ERUHN9bo6 ePh5gl11Wl+90bmYFr6bOD7p38cEJH94CJl7rFfzjXxakDYcaSVPGY52kG90ZKo+npGr zivQ== 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:in-reply-to :references; bh=BUo8fyGvKfIIXNUby91Vvrr7AwaCfremVGPaAvsKH5I=; b=MWwzf14yYZvIkaDK9gXn0WLispFrfrc5lzD2/viFQAIwh8GXzJ7MUnyfKvrF0a4xzD ckaCEbUZqs+wXWBlZ3VukrJpKQ6xFCokSZKjHhbvEgVeL8zbOnjdbkSptkeN5XUITW0b xiUOHP5mkVG5SGzOOIRLDy3oS83OikCxi3BUbpf+4idrfSXZn7f6An8CGEVROZ4Oke3h ulIP5hRT3PRNVBGbceCUjOnYlkTktGxLIVrJ7FXHlaA5njJadcrjDSVM2Ffio+S25Fok CVosVPn+t3YpR/W0z/T5eOtYGEgoUDtcpopivgGVHD/LaYOuz4lVcYE2GehZSqm9uXUu pzAA== X-Gm-Message-State: AJaThX4OqJFhVzojUvSdk1bxnjMlRauYvy+vnmzvqov9r5PBt+9gEGRk YR0QVG3VYsqiXcOe476cwzn6LA== X-Google-Smtp-Source: AGs4zMZJoDBJtrmECutqJwX0pOJj3nF6Oowd0tKsgf02NKA1YNKyP+ZzkKvwW3kdiMOv9RNheUiixQ== X-Received: by 10.101.75.204 with SMTP id p12mr1310158pgr.61.1512019905774; Wed, 29 Nov 2017 21:31:45 -0800 (PST) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id j79sm6209348pfe.129.2017.11.29.21.31.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 21:31:45 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Thu, 30 Nov 2017 16:31:24 +1100 Message-Id: <20171130053129.22642-3-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171130053129.22642-1-oohall@gmail.com> References: <20171130053129.22642-1-oohall@gmail.com> Subject: [Skiboot] [PATCH 3/8] gard: Fix up path parsing X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 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" Currently we assume that the Unit ID can be used as an array index into the chip_units[] structure. There are holes in the ID space though, so this doesn't actually work. Fix it up by walking the array looking for the ID. Signed-off-by: Oliver O'Halloran --- external/gard/gard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/gard/gard.c b/external/gard/gard.c index c70fa2a3ccfd..5a57415ab5a7 100644 --- a/external/gard/gard.c +++ b/external/gard/gard.c @@ -325,7 +325,7 @@ int parse_path(const char *str, struct entity_path *parsed) parsed->path_elements[unit_count].target_type = unit_id; /* now parse the instance # */ - len = strlen(chip_units[unit_id].desc); + len = strlen(target_type_to_str(unit_id)); instance = strtol(str + len, &end, 10); if (!isdigit(*(str + len))) {