From patchwork Mon Mar 20 15:26:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 665198 Delivered-To: patch@linaro.org Received: by 2002:a5d:5602:0:0:0:0:0 with SMTP id l2csp1182973wrv; Mon, 20 Mar 2023 08:26:50 -0700 (PDT) X-Google-Smtp-Source: AK7set+ITLEyTg/9AFd0SwnQKKBzGrMQMxrfEk3nC1O7U3LVC+InxdwWsVJVW4hvl7h0p8pvhu66 X-Received: by 2002:a05:6214:1cc2:b0:5ac:239a:91ed with SMTP id g2-20020a0562141cc200b005ac239a91edmr38221907qvd.9.1679326010592; Mon, 20 Mar 2023 08:26:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679326010; cv=none; d=google.com; s=arc-20160816; b=ZXk81paGelFUBBmyQuTlGPzYJFz6FDKuGjjdWsvnjgNUfK/qcMmtvRItsbixe3k21h mt168I72SPucwKC6aO/SGi3Dcel1qejy8S1x0kaNX0iYmJAsTf5qFJjRFuJsQI5s9//o 25xs8GD69kR5o0c0NhaX4blikCVQzin7NGKlsedLFZgiI3foOqRrOdT1bsDZq1GgqsG0 /K8x0luPExNJDzujS4PfhSz/jpPgqmoxUeDlVDIHQJ/uQ4OhAetym5kGcehkuYVYuhQv S0s2Mm+LxNqsneN0XZqHQHogiVMqXG189BzfhPLnDPBZJpAA04nUmtCa+h7k9rVmi2ga /v0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=4wW5ghWUUtpJVS2kWc+y9ru6tmtr3pjltMs5c1719Nw=; b=eu72YSF1JA/Y8Qp+Whm9J3hSmetXtoHV97pLH61dLMw+RW9wwyLj+NxmJzlTKTo9/T IIdVFXb0ZXi/EQk7GDp0JiDAc5yYfusRYek+9NAVtuVPWjf8vppyTCKsHrMVvOd72YXJ YDUXzomXCsdZm6T/TcjvIu7kRDNKHYUgukyxqP98r0uMTCXC1ofhhnJerTa/pvbyB3mw tj93GerIC1kts4/SpHHH+3jbAtl5Mzv0tYFwESeUq59yOKp3MqlQbo1fxqzbNPq6j9oj OEc+THZVtH6SFfD6HnayGWBzSJ58A8QdwEm+8SJ4DAHz0ZMFLcyKCtEHOWYvMn4BlL+q Fkrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yl8cAqBV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d197-20020ae9efce000000b00742e593f6e9si2816769qkg.218.2023.03.20.08.26.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Mar 2023 08:26:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yl8cAqBV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peHOt-0005tm-2v; Mon, 20 Mar 2023 11:26:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peHOr-0005t7-Oi for qemu-devel@nongnu.org; Mon, 20 Mar 2023 11:26:17 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peHOp-0006aT-7h for qemu-devel@nongnu.org; Mon, 20 Mar 2023 11:26:17 -0400 Received: by mail-wr1-x42a.google.com with SMTP id r29so10718750wra.13 for ; Mon, 20 Mar 2023 08:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679325973; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4wW5ghWUUtpJVS2kWc+y9ru6tmtr3pjltMs5c1719Nw=; b=Yl8cAqBVAt1dWckk7gBZq+N1eXOfY5q9aWgarQyTNPzopKS5mYKlNWSF6+VnpgVRsJ fXjP8+gC/itud7lnnUAl2JeV+3C74L+ayxLw0a8qZH2QFMpMWmVmL+Tgnw+D7jb8w+4l 2eybSFv/d4cyNtQx8adgYmh31e4CpfjUBQyQddJQER9NvcWYAj/0wC6GJHRMyMgRtPWG FNc17QvRrjeJOIXUYqsNMf8zu41uFI6l7ciWpaclx/S62C/Ht6ey3ASHdR1cWrlC75hy m8m80DrvZ8/KHilRLndw3rrn1GKEfkhR42XRdQp1xcr7l0vKSIwjhlrUpCsl1zh+jukU InFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679325973; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4wW5ghWUUtpJVS2kWc+y9ru6tmtr3pjltMs5c1719Nw=; b=2A/JySOv1na5zZ2bce1S2CFFjPG8pvpqF5ICtvSo1VOTsf0nMGB9ohw/uiIp86cP71 rjyxhCFWyjPcxIdbRsq1hztTIIc6e+Cn8ZjfSPcIqPKNff/6LnJvoYqGnfXtNFNQNiry PAHe4qmdsUVHMDxKF7bSjgcbJcQvkaPe6CFUNGCOHf+Q5kN5TzoEOqhS5NKO+VRt9lcE sjzXNvtsGHSv2MrmP4slkmC7YuBM2HJnZyAW1mZbdeOsyYm5YJiTfecloeJZ5rVAZ+cO 0OEqVemje6k/ClwIvGdKPgkiP6zNiLKHxzL8acLx4Irmd0pgHPKQ+6XVzoAsD32J7QT3 8EaQ== X-Gm-Message-State: AO0yUKXKomWiGP5Ar/nMJ2JrdYnV/uI0O/3qsAC2Mwb/J/c9Q/kih+Ht Y6DHM8lzpzZXRw+s2B2yG2fqp3p3LVbKAWA7uD7vsQ== X-Received: by 2002:adf:db0c:0:b0:2d2:29a4:4457 with SMTP id s12-20020adfdb0c000000b002d229a44457mr10572407wri.13.1679325973072; Mon, 20 Mar 2023 08:26:13 -0700 (PDT) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id x2-20020a5d60c2000000b002cfe71153b4sm9158824wrt.60.2023.03.20.08.26.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Mar 2023 08:26:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Kevin Wolf , qemu-trivial@nongnu.org, =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , qemu-block@nongnu.org, Hanna Reitz , =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= Subject: [PATCH-for-8.1] block/dmg: Declare a type definition for DMG uncompress function Date: Mon, 20 Mar 2023 16:26:10 +0100 Message-Id: <20230320152610.32052-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Introduce the BdrvDmgUncompressFunc type defintion. To emphasis dmg_uncompress_bz2 and dmg_uncompress_lzfse are pointer to functions, declare them using this new typedef. Signed-off-by: Philippe Mathieu-Daudé --- block/dmg.h | 8 ++++---- block/dmg.c | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/block/dmg.h b/block/dmg.h index e488601b62..dcd6165e63 100644 --- a/block/dmg.h +++ b/block/dmg.h @@ -51,10 +51,10 @@ typedef struct BDRVDMGState { z_stream zstream; } BDRVDMGState; -extern int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in, - char *next_out, unsigned int avail_out); +typedef int BdrvDmgUncompressFunc(char *next_in, unsigned int avail_in, + char *next_out, unsigned int avail_out); -extern int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in, - char *next_out, unsigned int avail_out); +extern BdrvDmgUncompressFunc *dmg_uncompress_bz2; +extern BdrvDmgUncompressFunc *dmg_uncompress_lzfse; #endif diff --git a/block/dmg.c b/block/dmg.c index e10b9a2ba5..2769900359 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -31,11 +31,8 @@ #include "qemu/memalign.h" #include "dmg.h" -int (*dmg_uncompress_bz2)(char *next_in, unsigned int avail_in, - char *next_out, unsigned int avail_out); - -int (*dmg_uncompress_lzfse)(char *next_in, unsigned int avail_in, - char *next_out, unsigned int avail_out); +BdrvDmgUncompressFunc *dmg_uncompress_bz2; +BdrvDmgUncompressFunc *dmg_uncompress_lzfse; enum { /* Limit chunk sizes to prevent unreasonable amounts of memory being used