From patchwork Mon Feb 27 14:01:23 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: 657046 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2376109wrb; Mon, 27 Feb 2023 06:18:18 -0800 (PST) X-Google-Smtp-Source: AK7set/jPkTmRnzJLmz4B7Ej+huLetQnurfIVmEo4cWT8xPxjwhL6es+7HCWJEoLrd5xipiYNZrP X-Received: by 2002:ac8:5713:0:b0:3b9:bc8c:c1fa with SMTP id 19-20020ac85713000000b003b9bc8cc1famr17647750qtw.5.1677507497939; Mon, 27 Feb 2023 06:18:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677507497; cv=none; d=google.com; s=arc-20160816; b=dN6WZnPqjMc/vQlrDxKIG9M8Z6oSY71uTZqDMal/HWgpZITZcLw9UtnT8Oftr19W/t HsPYIHEic4p4mDC9P7xISvXG6KzHOgzJcswCGzJkBe7YX8tfjipSH5w/p5lPPPajwu/B 9Tj08tbl1rSjDmDeW9J41pBZLCYhED8LibjMOikv47sfHb0++H3CSGyp8tpLZFjJCwHq T1EJKx3BwwAx3x8GVIgLerLZT23NmdFyOFptG4HMJuQZw2qrXO/qr/33rIGULk0eRN1a 9R30NCsMuKzBatv7PaqXcY+thUlECCNTjghBzpi7vNB4alYbg4gjhsmB0/lkOrMEVPIj n8PA== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=mB/pDWgm2BIuPhx5UcfH++r62QSUw7La1WlZAVYPtq8=; b=gvSJNXA9TAZlhhb4w1v3cu14cm8DvuqveWZyes/sJRNbpddbBgcnbYmF7t6395Uoev z9v5YIqP817U3sTkMn+oVRArJns2iyu/qb3WrAkFg6DkMyjLKF7+oMOzXOcEw5JVXMcg ikOKB4jwpwgx7K4Dpo+nQ5uJymXGVOlBVXimwJq8NQHtCCl/JVLAXLWo+dBkLvFp4pEF w3z6YZaMd1i1plbaoro5YPjBJC2bE0wywh0jd3EyPRNMRxexRGYLsKGHHde7+k688zoJ iUwRaz9urXOpqdQjXB3LP+FUS3F3vyauQRM81moxtMifhWq2uNz0e0db/ZYyVlXDEAVn yurA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C3RoFFdj; 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 d7-20020ac85d87000000b003bd111d451asi6749036qtx.704.2023.02.27.06.18.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 06:18:17 -0800 (PST) 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=C3RoFFdj; 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 1pWeAy-0002iD-Qn; Mon, 27 Feb 2023 09:08:24 -0500 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 1pWeAw-0002WE-S1 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:08:22 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWeAu-0000PC-LT for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:08:22 -0500 Received: by mail-wr1-x436.google.com with SMTP id r18so6381466wrx.1 for ; Mon, 27 Feb 2023 06:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=mB/pDWgm2BIuPhx5UcfH++r62QSUw7La1WlZAVYPtq8=; b=C3RoFFdjA2uZJzosvp4jan8q/NjYJwN7PP/Cfy+5B6sGZ4sMvGoVyTketMTTPfaRpl u9JrrQVzXg20ebVykTmT0C/2HXLeEksA0HDiASJvAn5H3YpB3rWFvuJex+FKxBt2xBPs 7lwUe1SZHufzyJfK4oqDC4UFGicp+epg+j2x22TmStwqPkxEa7Xo6JpAk/2YW3WoRWcl rNNNeZxx+tdxC5leNZ3Cm5n3AZCjPKHZjOSQDJ2gHOVsrSct6IXtBEPYgrpg043kbsLZ TypH8BS3qyzP2zz3wvSeQqf94CAo5CO1ShvdYS+y2h5hYip8WWYBJVtMLkDq93WM/2Wu 0BvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mB/pDWgm2BIuPhx5UcfH++r62QSUw7La1WlZAVYPtq8=; b=k0d0keRGO0IIb4gu5VTCrAXhhN8pHbhzyqE5pXkelQsGogvMBTMw9NL3k3nQdBZaQb bYhTa+WwVA/Q+yTv3cL+yPEtIC8GOxtwUdGxtYG9ckDjZ67nMhyEzYLGxNgkCob0uFop Z+or/3lp95CxVP1oMFTKa0vtGosXgiXt5Z2MoRkDMn9qiScy/cRD7dB84FsKFEOaGx0M f1XXC6ekTBtQR6nA7/Hefps6+auNg7Fnp/fMHiywq8E3oiV3GP82HEn1vk/OtsP9v2op 9UFw+ae8s84qqFQRnrhj6i5qc0OaSs2wC6MDc0OAUsvSduI0y2kdXl2bDl1BHJcIobCR XqhQ== X-Gm-Message-State: AO0yUKUJH4ZTe48Ctiah5+Lf4XXKEj1QCH2B0SgEslvPcwp1WEfBdQ2W qnjip6kvacQCO9zOk6qvB8hW9V3ahZlusaQ+ X-Received: by 2002:adf:f0cd:0:b0:2c7:d75:373a with SMTP id x13-20020adff0cd000000b002c70d75373amr14817696wro.1.1677506898986; Mon, 27 Feb 2023 06:08:18 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id j1-20020a5d4521000000b002c573cff730sm7203340wra.68.2023.02.27.06.08.18 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Feb 2023 06:08:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 076/126] hw/usb/u2f: Declare QOM macros using OBJECT_DECLARE_TYPE() Date: Mon, 27 Feb 2023 15:01:23 +0100 Message-Id: <20230227140213.35084-67-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230227140213.35084-1-philmd@linaro.org> References: <20230227140213.35084-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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=ham 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 hw/usb/u2f.h was added by commit 80e267f1d1 ("hw/usb: Add U2F key base class"), almost the same time of the automatic conversion done by commit c821774a3b ("Use OBJECT_DECLARE_TYPE where posible"). Manually convert to OBJECT_DECLARE_TYPE(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230220150515.32549-9-philmd@linaro.org> --- hw/usb/u2f.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/hw/usb/u2f.h b/hw/usb/u2f.h index a408a82927..8bff13141a 100644 --- a/hw/usb/u2f.h +++ b/hw/usb/u2f.h @@ -31,22 +31,16 @@ #define U2FHID_PACKET_SIZE 64 #define U2FHID_PENDING_IN_NUM 32 -typedef struct U2FKeyState U2FKeyState; typedef struct U2FKeyInfo U2FKeyInfo; #define TYPE_U2F_KEY "u2f-key" -#define U2F_KEY(obj) \ - OBJECT_CHECK(U2FKeyState, (obj), TYPE_U2F_KEY) -#define U2F_KEY_CLASS(klass) \ - OBJECT_CLASS_CHECK(U2FKeyClass, (klass), TYPE_U2F_KEY) -#define U2F_KEY_GET_CLASS(obj) \ - OBJECT_GET_CLASS(U2FKeyClass, (obj), TYPE_U2F_KEY) +OBJECT_DECLARE_TYPE(U2FKeyState, U2FKeyClass, U2F_KEY) /* * Callbacks to be used by the U2F key base device (i.e. hw/u2f.c) * to interact with its variants (i.e. hw/u2f-*.c) */ -typedef struct U2FKeyClass { +struct U2FKeyClass { /*< private >*/ USBDeviceClass parent_class; @@ -55,12 +49,12 @@ typedef struct U2FKeyClass { const uint8_t packet[U2FHID_PACKET_SIZE]); void (*realize)(U2FKeyState *key, Error **errp); void (*unrealize)(U2FKeyState *key); -} U2FKeyClass; +}; /* * State of the U2F key base device (i.e. hw/u2f.c) */ -typedef struct U2FKeyState { +struct U2FKeyState { USBDevice dev; USBEndpoint *ep; uint8_t idle; @@ -70,7 +64,7 @@ typedef struct U2FKeyState { uint8_t pending_in_start; uint8_t pending_in_end; uint8_t pending_in_num; -} U2FKeyState; +}; /* * API to be used by the U2F key device variants (i.e. hw/u2f-*.c)