From patchwork Sat Jul 20 18:24:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1134437 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CcuOW0lZ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45rc5j4bnjz9s3l for ; Sun, 21 Jul 2019 04:36:25 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4ED5FC21D65; Sat, 20 Jul 2019 18:30:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C3E9DC21D56; Sat, 20 Jul 2019 18:25:57 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 75F3BC21E75; Sat, 20 Jul 2019 18:25:30 +0000 (UTC) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by lists.denx.de (Postfix) with ESMTPS id B297CC21E0B for ; Sat, 20 Jul 2019 18:25:24 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id k8so65315269iot.1 for ; Sat, 20 Jul 2019 11:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/XHItyNTDvd5yiPEfLvkjTz/DaMvg/GUHmMebJSWGTI=; b=CcuOW0lZhpF9pKiIh8yUa4+XYvQ8i/tU3+pUfbz+pPnHOdfbwb82iZ1dm3PrQADa1B O/wRdXrhjA9Kirc7NVfhDfjctSSqaNmAeB3qABP+zbrRmkqhaTWjFlySFu4tEMM9grV3 mDEK6VRwLjL1tlcaONRVRLXbVuYvWW7fC2Scs= 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:mime-version:content-transfer-encoding; bh=/XHItyNTDvd5yiPEfLvkjTz/DaMvg/GUHmMebJSWGTI=; b=QBKazW/OwKPMMVnLWeidIKPvgntsfXoylxxnjhMWfTjGcGYtmmTPnpEAF+SxEdGIzo P7QQHNPoX5Vv8u0MzVnHI4wP7TvOpgUKLlW6ZsBNGwDWgbEVHqQtv+QIRCxRII/f8hS/ ObgVqsQJoATRO4MPdLi7K40DmxLAn7jVIvMU5P9ooTozK4/JP7WqggLo/c0da4jWI8Db 0FIctmH6mFrWG14MHe+/0oR2vqUzpuAJYamQaZqmoaJiVP7+STbw0SkLOtQ9IBzzM8CL KyLryYT7T5+d8fT7IoZ+NtS5YNlmaF5/K97mzdOHubDxoQB5lGzJAZe9ntbOaTDC39q5 f2RA== X-Gm-Message-State: APjAAAVPomUdD9dbSWS0x/ox0w3bVBqurgP5cajT6dskLI4Zw23QcOMS ELIzJFvnwwcjGOz4+cyZSolZEZCBpg0= X-Google-Smtp-Source: APXvYqw40VmEzIGwSbuuWOV+oZEXjdOclHeEizSmsB0vWAZVRAX01yeBTYDFolTHTKYg0dicUTkohw== X-Received: by 2002:a5d:9a04:: with SMTP id s4mr57556672iol.19.1563647123592; Sat, 20 Jul 2019 11:25:23 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id z17sm49778933iol.73.2019.07.20.11.25.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 11:25:23 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 20 Jul 2019 12:24:03 -0600 Message-Id: <20190720182416.183626-42-sjg@chromium.org> X-Mailer: git-send-email 2.22.0.657.g960e92d24f-goog In-Reply-To: <20190720182416.183626-1-sjg@chromium.org> References: <20190720182416.183626-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 41/53] binman: Add a prefix before CBFS hex offsets X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add a 0x prefix to these errors to avoid confusion. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/cbfs_util.py | 4 ++-- tools/binman/cbfs_util_test.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/binman/cbfs_util.py b/tools/binman/cbfs_util.py index 45e16da0aaa..6d9a876ee85 100644 --- a/tools/binman/cbfs_util.py +++ b/tools/binman/cbfs_util.py @@ -715,7 +715,7 @@ class CbfsReader(object): file_pos = fd.tell() data = fd.read(FILE_HEADER_LEN) if len(data) < FILE_HEADER_LEN: - print('File header at %x ran out of data' % file_pos) + print('File header at %#x ran out of data' % file_pos) return False magic, size, ftype, attr, offset = struct.unpack(FILE_HEADER_FORMAT, data) @@ -724,7 +724,7 @@ class CbfsReader(object): pos = fd.tell() name = self._read_string(fd) if name is None: - print('String at %x ran out of data' % pos) + print('String at %#x ran out of data' % pos) return False if DEBUG: diff --git a/tools/binman/cbfs_util_test.py b/tools/binman/cbfs_util_test.py index 0fe4aa494ec..772c794eceb 100755 --- a/tools/binman/cbfs_util_test.py +++ b/tools/binman/cbfs_util_test.py @@ -372,7 +372,7 @@ class TestCbfs(unittest.TestCase): with io.BytesIO(newdata) as fd: fd.seek(pos) self.assertEqual(False, cbr._read_next_file(fd)) - self.assertIn('File header at 0 ran out of data', stdout.getvalue()) + self.assertIn('File header at 0x0 ran out of data', stdout.getvalue()) def test_cbfs_bad_file_string(self): """Check handling of an incomplete filename string""" @@ -394,7 +394,7 @@ class TestCbfs(unittest.TestCase): with io.BytesIO(newdata) as fd: fd.seek(pos) self.assertEqual(False, cbr._read_next_file(fd)) - self.assertIn('String at %x ran out of data' % + self.assertIn('String at %#x ran out of data' % cbfs_util.FILE_HEADER_LEN, stdout.getvalue()) def test_cbfs_debug(self):