From patchwork Fri Nov 30 15:17:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 152557 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3779462ljp; Fri, 30 Nov 2018 07:17:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/U1LC1eDOuAqrjL5n6NmPu9J4SYYrQJrFc4NSKJbV3def5cViRi9U6DtkMTWgHVmSj4wNev X-Received: by 2002:aa7:810c:: with SMTP id b12mr5956954pfi.44.1543591040304; Fri, 30 Nov 2018 07:17:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543591040; cv=none; d=google.com; s=arc-20160816; b=dN0H6S/WfcVq+TUEt0vsQzLaFAuwJCUAqQodJIeM4nSwO3Om8WUoTECBXIIqekdjTn 2m0jDsGKon/YT7lj6f01o9VHUCyl8lQGm7iuGAu5XiCNmUnBCHUbJN0h3wxO9dB9lMvM QgbleNFxQNZK5nRvGdECNcPoHXIjRbgLCj7gHvN5ikaFizb1azX42iendSivqDjFHJLp l3/fxSDI+M9TJS5hG0vJrBkydASv/yqi4vqta4XTpAusIvj9fTPrbveHjnA0G7b7U8U5 KqyWfCX7IHg/Wq1FPcTpnoHUHte7Pglwte4G1AteHVMwPgU0Dxm4ow4W/HkXJIkbT4me oDyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=TrB4X43hfniQHqa5c+DNxXcc7RtdPEdLiH/zQIPW4zs=; b=nOJWw+YO5CR2bAIQ2gKFjxTsHpXqFJhaMT1A0vcNCqyTW+I5QbOrBMU7lsXKxbKL2F OlnZW9fTjBzGxJp5LnPt8djlktBYeWZa19vjeeSL3D3F6+M682op1RBwlx3ZJ0rleUuG ZxIjjl78v/0dfzxg3d3u+QcNOUplf4IRyoPEuKVrC0WBdL+a5o9wPlQz0PlDVsFyneIs 6tvH1aVFQQZ96gph9ig5TEHZT9Y4rzD86FnUN+7CTtbIG2YMep5hG6MmXwQroY4fwsbZ PdNOSgPn8njI9ZRyT8jPObZVG9nQrZVD/6EPp5bwpM//Mrs9b+JmKFUQK8XtZHs5TzAs MbKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id t19si5593865pgk.163.2018.11.30.07.17.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Nov 2018 07:17:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gSkXc-0005QG-W5; Fri, 30 Nov 2018 15:17:17 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Stefan Hajnoczi , Eric Blake , "Daniel P . Berrange" , Li Zhijian , Philip Li , Peter Crosthwaite , Alexander Graf , Kevin Wolf , Max Reitz , "Michael S. Tsirkin" , Marcel Apfelbaum , David Gibson , Igor Mammedov , qemu-block@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH 07/10] hw/block/tc58128.c: Don't use load_image() Date: Fri, 30 Nov 2018 15:17:09 +0000 Message-Id: <20181130151712.2312-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181130151712.2312-1-peter.maydell@linaro.org> References: <20181130151712.2312-1-peter.maydell@linaro.org> MIME-Version: 1.0 The load_image() function is deprecated, as it does not let the caller specify how large the buffer to read the file into is. Instead use load_image_size(). Signed-off-by: Peter Maydell --- hw/block/tc58128.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.19.1 Reviewed-by: Eric Blake diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c index 808ad76ba60..d0fae248dcc 100644 --- a/hw/block/tc58128.c +++ b/hw/block/tc58128.c @@ -38,7 +38,8 @@ static void init_dev(tc58128_dev * dev, const char *filename) memset(dev->flash_contents, 0xff, FLASH_SIZE); if (filename) { /* Load flash image skipping the first block */ - ret = load_image(filename, dev->flash_contents + 528 * 32); + ret = load_image_size(filename, dev->flash_contents + 528 * 32, + FLASH_SIZE - 528 * 32); if (ret < 0) { if (!qtest_enabled()) { error_report("Could not load flash image %s", filename);