From nobody Wed Apr 16 07:44:31 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1682358956; cv=none; d=zohomail.com; s=zohoarc; b=C84CXSQHTJyZZLnbLQ1tB9zGdVL2q5xcfZ57hUgV+10L15AK3jvD0T9EFEv9FBmDCavQM8Tv88xHbuydImtcdd4Dn9bgBUt3h7sx+hHLSBhG1lLVimD7TvMfeuxNC3NRYz2H2AQtrFRxst4XKuPRu6/Bv0GcaMj+IoV0BmmkScc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682358956; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DyRg2nO17XfSte2Qiq60HFpJmMSh6St95+0xBJuJYUw=; b=dCOm1Axm2YNilKpl+1JWFoKUq0DvdWxgTK7TolmCo4cFm/z1MdWJ6j5Sgnk9jPzSKELlRYw3uLxClzsHs1oj+6a8MqXgQIavIw7ZjKyGRDvmvz6evjjrpDqcs8suiF+MbdPa+J9KOlUj7s6Lb7awz1V9gxVNTk6/s9jxqrbweSM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1682358956449796.6383604521461; Mon, 24 Apr 2023 10:55:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pr0PY-00080y-D0; Mon, 24 Apr 2023 13:55:36 -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 1pr0PW-000809-EV for qemu-devel@nongnu.org; Mon, 24 Apr 2023 13:55:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pr0PT-0007ty-VV for qemu-devel@nongnu.org; Mon, 24 Apr 2023 13:55:34 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-452-oAnBs-z6NrSCL3WqXhLh2g-1; Mon, 24 Apr 2023 13:55:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4F4C23C02B70; Mon, 24 Apr 2023 17:55:23 +0000 (UTC) Received: from localhost (unknown [10.39.195.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id A65C22027043; Mon, 24 Apr 2023 17:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682358931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DyRg2nO17XfSte2Qiq60HFpJmMSh6St95+0xBJuJYUw=; b=Xrnfssi5U2Q1KsH97gYW9oMOp4CMxR67rROYvgnU9qRFc3GY0lfMwe90DDWgxJ9jC9M7yh Xh6zD4w5ebqJ211d78UfnGK9744ZaL6H95JLs3CUkq+yXRKAH6HHLOE8fg+lSWXIdC30kz mkzpoApyDfXG4a5I3gk7lF4AHGwgqvc= X-MC-Unique: oAnBs-z6NrSCL3WqXhLh2g-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Hanna Reitz , Stefan Hajnoczi , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 1/2] block/dmg: Declare a type definition for DMG uncompress function Date: Mon, 24 Apr 2023 13:55:17 -0400 Message-Id: <20230424175518.325931-2-stefanha@redhat.com> In-Reply-To: <20230424175518.325931-1-stefanha@redhat.com> References: <20230424175518.325931-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682358957311100001 From: Philippe Mathieu-Daud=C3=A9 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=C3=A9 Message-id: 20230320152610.32052-1-philmd@linaro.org Signed-off-by: Stefan Hajnoczi --- 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; =20 -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); =20 -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; =20 #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" =20 -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; =20 enum { /* Limit chunk sizes to prevent unreasonable amounts of memory being u= sed --=20 2.39.2