From patchwork Thu Jun 5 19:35:39 2025 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: 894197 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:ecd:b0:3a4:ee3f:8f15 with SMTP id ea13csp141755wrb; Thu, 5 Jun 2025 12:36:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVTmqXBArrFQ6XbRA/afkAebsEJ/cnTH/CQF9mJkSBNPe82CJxkZ+NHJfd4sMSJ5rFsPoskdw==@linaro.org X-Google-Smtp-Source: AGHT+IEYO5b3ViKO0lLY7Td9FTy+FQiEhH86mh1nWREqgoQbUxjSSM2jNMpncxxfRrgqCkSBJeM/ X-Received: by 2002:a05:6214:29cc:b0:6fa:c168:b20a with SMTP id 6a1803df08f44-6fb08fdb790mr12376086d6.10.1749152211008; Thu, 05 Jun 2025 12:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1749152210; cv=none; d=google.com; s=arc-20240605; b=Oz/CnQnYer26DfWsuIXU1cEwVD0DgxkehcWv1P3fJosUYt2uHmq9bIAtIicNaV/qNO 1iYuV2/spcJEy2TVurE2XJSwMaznkW7bEEpfi/TuMCSFdalkXFZ9AuNF0y9OE/G4L68I nDV6PHlD3TY7Rpiwk1qkV36kuKZnWIuZ2k4KB6cm8o8iSb2Bs4mfbL+zOHz1UiiCjRIr FoABYNiPDCP1lgGL4rwsmT1MmANjFnQhZSThG7cMq/jNQBaC1heycE1oYXaT8fol0fDb v0H5KvhQhEu7CBddyOgyggCS4nvIllRgqN8jYOude1CocksKGM0WdyWm85DxKcXNIE+k mZ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:cc:to :from:dkim-signature; bh=0H5JejayswNFHuNqdTgm/gmscONTNKgClj6tOp77taE=; fh=4h8nYkqSZR/NsvEVgsamRLVoGtMitGyEZZrWhPRdZB0=; b=bCyqZoHW/MM6eUqnJkDiTnrkWI5Aa+9YNjym3F2D4VEY20Ryo0CxOZGanzPL0G0BC8 iHBMkzrNyJ17DeK8dAiSLeJvpRDIebuT/wXPG4IbUObUjz1bcfKzXJktkj92LI75azIF ilGhq7cx7DyfEHtdQ6omnNBmTVy35Caznis2xsd06a+7zMb/NuronS9o8pBhu5ta9Nj9 MYQLIxyzksW/vikHAyaHFRY65LidJEcm0zoArz3uCnYaQaKg+IfE4WihLd55BXTYQp+T gAYav6UPAzJK9XWtvrEy3oQGYtMpFPyDCb0gBCYIBc157+EC/ZlVLrioUD7RhOiYllor jHWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MPJVzBor; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6fac6ee4e42si178424226d6.496.2025.06.05.12.36.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Jun 2025 12:36: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=MPJVzBor; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uNGNj-0006mD-8H; Thu, 05 Jun 2025 15:36:07 -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 1uNGNf-0006kn-Ca for qemu-devel@nongnu.org; Thu, 05 Jun 2025 15:36:03 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNGNc-00017o-S8 for qemu-devel@nongnu.org; Thu, 05 Jun 2025 15:36:03 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3a531fcaa05so35612f8f.3 for ; Thu, 05 Jun 2025 12:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1749152158; x=1749756958; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0H5JejayswNFHuNqdTgm/gmscONTNKgClj6tOp77taE=; b=MPJVzBorwr+KwcPCwwXI0/edacaAKd1su9dFvRHqAbc1Ly49UrxFBNE5Q20wK/0v+Z 5XhSWlZ3LM94cBhYyqUaO9cSQULa0plEmXbkbbH/Ii6PDyrOsuBFk071us8KZBoxOyEN WjaWB4h+dwdez5Gw5cI+jSHGSSk5GyaOwNq2macnlFB4sc2HqvcaZNojRicPl4jL4Rrn vpGcTd/PtGr4ZV/Ta4JCiKyDuXAgQdNGgZuS3UjE5PgvIKwGEzxkRPt3wfnxqUiM8p33 8KGRENZDXavIyPJ8Vi+um4Vd5O7XlxvH8rOsPCU4sKJW2lk00RPkjZf6N3JuEuO8ided ty6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749152158; x=1749756958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0H5JejayswNFHuNqdTgm/gmscONTNKgClj6tOp77taE=; b=xGPiUC4hvvWurMK29xu5zLor4W5yKeZW9o7PsuvFyx22vZ5/znM7Hs19rwLiAg8vRW 51KAQK9v3TliuFYE7XMIgRKaxxJlO5b/RAiQhUQC0dF2OuY6CtUicGb50XDWkJOtS14R BQ3v+k5RRRKi6NoqKa0S/DCw71G0HhZvoRJAePuBIJRegZwp5+Kn9lc/J6qm5cXwzYoQ On2PjA7Qzljbqp168Nc3tMK0G2o2fZLxFEVfCxZG350mHRo9K8CrvR/2pAG8+UbFsbTg QeLYcdMwHclOd3v/MjDDZ1q3KcuSoQMHFX3oTxVGo9R2kBIkm4D1YJDDAT6o0Z+wGNw0 CrBg== X-Gm-Message-State: AOJu0YyHyO+7nOBdz3h+Izeb7LzASJNtIDigtYGzRKjDakktVfreFWMb QC++8L9Epi2NmfwkGuw0IRLYxkIT00qrjeXmeF9N8HJgwbi5beZzGmbCUHWjVMZsEbFnItpJjIR k+4Ve9CY= X-Gm-Gg: ASbGncvxHdgEwGgPzqKpXmMVnr8fJTakPK3HoommRqcTPepdwkOUGuQCfmepJ5DDnaO D9hAdAy3WnLwTg72njlkejgsBTuvzWNqHd185UiOjf5Bi70WgGtXTmaI2sJbgYQq8LhPCre9dlY DJRQ2hzK1xz1Q4dBzu+zZqHnSYZxqjcmxt5fn3rXlnT6blWnmz2n7PjY168U9519RKTaPgSfn6j A+WLFxUiC8Lg03CDW3Ehmwv5WaZIpNQ1dPGZFDuewvOMTGc7b0wBzqBNnZ3CPG95tr5JHy5YlDl isZrD/K+MCwFBVyXqImsA1/9/dtsCTsGMorK4r9JGnDUA5Gb7f4oiohnuJQ932nfb4bHnpTdOzH JVROgH+1BUTQyMaD5t6qfvy5k4gyalkEDsHZ0 X-Received: by 2002:a05:6000:220d:b0:3a4:f744:e013 with SMTP id ffacd0b85a97d-3a531cb8521mr290974f8f.30.1749152158248; Thu, 05 Jun 2025 12:35:58 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53244df06sm59169f8f.69.2025.06.05.12.35.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 05 Jun 2025 12:35:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Paolo Bonzini , qemu-arm@nongnu.org, Glenn Miles , =?utf-8?q?Marc-And?= =?utf-8?q?r=C3=A9_Lureau?= , Peter Maydell , Stefan Hajnoczi , Stefan Berger , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Daniel_P_=2E_Berrang?= =?utf-8?q?=C3=A9?= Subject: [PATCH 3/4] tests/unit/test-char: Avoid using g_alloca() Date: Thu, 5 Jun 2025 21:35:39 +0200 Message-ID: <20250605193540.59874-4-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250605193540.59874-1-philmd@linaro.org> References: <20250605193540.59874-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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 Do not use g_alloca(), simply allocate the CharBackend structure on the stack. Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-char.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unit/test-char.c b/tests/unit/test-char.c index 60a843b79d9..f30a39f61ff 100644 --- a/tests/unit/test-char.c +++ b/tests/unit/test-char.c @@ -993,7 +993,7 @@ static void char_udp_test_internal(Chardev *reuse_chr, int sock) struct sockaddr_in other; SocketIdleData d = { 0, }; Chardev *chr; - CharBackend *be; + CharBackend stack_be, *be = &stack_be; socklen_t alen = sizeof(other); int ret; char buf[10]; @@ -1009,7 +1009,6 @@ static void char_udp_test_internal(Chardev *reuse_chr, int sock) chr = qemu_chr_new("client", tmp, NULL); g_assert_nonnull(chr); - be = g_alloca(sizeof(CharBackend)); qemu_chr_fe_init(be, chr, &error_abort); }