From patchwork Tue Oct 23 22:51:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 988390 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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42fpXx0FJfz9sLt for ; Wed, 24 Oct 2018 09:51:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LdkKWLfl"; 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 42fpXw4vwmzF37m for ; Wed, 24 Oct 2018 09:51:44 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au 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="LdkKWLfl"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LdkKWLfl"; dkim-atps=neutral Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (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 42fpXq18hRzF36T for ; Wed, 24 Oct 2018 09:51:38 +1100 (AEDT) Received: by mail-pf1-x442.google.com with SMTP id v11-v6so1409246pfn.5 for ; Tue, 23 Oct 2018 15:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=wKRFrQREx8Ik6rAMb3D4EMiZDXmFWd3NbfCxciOx4SM=; b=LdkKWLflqe9IW3fbNTmLOTmR1iQyx8rgklDzdblbP2sPNUTywk/T1Fo9wkm+/7dK/A o/Zhimppd4heBYTXwJVGICDWlL/WL0gc3Qt+3os0LgCJG98epSxhlRKMaz6B6yTRcDj1 al/YnFnNbGEZkfVi20uQ3E3KysxPX7I/7POxaZitnBZrUpKa3Sfpqf3Mg1deO1AcWj/N 1LFFLP/bseZXybCl8QHXCAGfRsaXNNCTl+Se9tfPIWnKad7gRGQnGNlg2EUQ4U56B426 JmU5Ju0RLN9XcyL91pqcIFDm4SPiOY3ehkOdpwJMJBSgQfD+AP6+Z5/ZkWZNzotKnGL6 hfWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version:content-transfer-encoding; bh=wKRFrQREx8Ik6rAMb3D4EMiZDXmFWd3NbfCxciOx4SM=; b=Bs3CTeQILCAng8HKiQpZurF3Z8u3reVhZPw1tLiLuBk76YII2gpHJJlyNOwiwpDahc k8jTNbesvrdzS1kuPAxtg7K3evVEK4jCBKN0TLv2qi/YwTLqL42Qx7wboRejZCduJUP7 jEQLQjCUKq2vvz+ij18c4xcvXpfUTWvOOzJcLIjlFUUiolC+Xx4zAAsm6UZqlqrmiHUZ K/d6qbbSxEJNw24v9NFkSJjwJRSsrxl2V71Bg2JGa2nDF16ogGDr3gv8QrCMLxMAecW2 566nMsU+ATbazbVToDXNjw7t2dyh+ibQUJFOa9o5bgUkDBoZsliZ+kWU7JXe9GWsesx1 HzEg== X-Gm-Message-State: AGRZ1gLHOPEnbZrCkS+gYQ6SnCV9pHbQJxQ9+b5TS6zgAeIhTbXzpKlg DHhiVgtGk08Zl2BA6B7ktwOLKDza X-Google-Smtp-Source: AJdET5cNOeLZqcXRJJU+nDXWGOEvbZeIgtjDTt7Gwk6UojnbgpugdCm1hOiSmCxqquAvrx4+KZH3lQ== X-Received: by 2002:a63:2b01:: with SMTP id r1mr174735pgr.432.1540335096263; Tue, 23 Oct 2018 15:51:36 -0700 (PDT) Received: from aurora.jms.id.au ([45.124.203.19]) by smtp.gmail.com with ESMTPSA id 64-v6sm5282222pfq.10.2018.10.23.15.51.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Oct 2018 15:51:35 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Wed, 24 Oct 2018 09:21:29 +1030 From: Joel Stanley To: pdbg@lists.ozlabs.org Date: Wed, 24 Oct 2018 09:21:28 +1030 Message-Id: <20181023225128.14964-1-joel@jms.id.au> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Pdbg] [PATCH] Fix build failure in target detection X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" CI is failing to build: src/options_arm.c:65:3: error: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Werror=unused-result] fscanf(cfam_id_file, "0x%" PRIx32, &cfam_id); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we don't get the expected value in fscanf, display an error. The code already will do the correct thing and fall through to the unknown device case. Signed-off-by: Joel Stanley --- Error is at: https://openpower.xyz/job/openpower/job/pdbg-master/7/console src/options_arm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/options_arm.c b/src/options_arm.c index 88cf9c92f491..0dbc7315f52d 100644 --- a/src/options_arm.c +++ b/src/options_arm.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "main.h" @@ -61,8 +62,11 @@ static const char *default_kernel_target(void) cfam_id_file = fopen(FSI_CFAM_ID, "r"); if (cfam_id_file) { uint32_t cfam_id = 0; + int rc; - fscanf(cfam_id_file, "0x%" PRIx32, &cfam_id); + rc = fscanf(cfam_id_file, "0x%" PRIx32, &cfam_id); + if (rc != 1) + pdbg_log(PDBG_ERROR, "%s", strerror(errno)); fclose(cfam_id_file); switch((cfam_id >> 4) & 0xff) {