From patchwork Thu Sep 19 04:46:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13807331 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B3E7200DB for ; Thu, 19 Sep 2024 04:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726721219; cv=none; b=KYXIRjqn71wy3qdHAuAURz5cPdfSIaI9pYg9Jc4NCeBW84GVEq4mOOSOZlMOep/4xfHulfekc1Payn5hxsctswOYBMoQZZARFWXBitGhpK+wsxjeI7ikJsVxfR2DjsHS3tZd5lvYmP81Mq/AXu6yvgb2Kkq8sfaG67Qbr44TjhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726721219; c=relaxed/simple; bh=tBeGrz6uXuOASALerxc3vtg2PDwHLs8tXRn/ggYzN4c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=q2NkMvIae2vb0NVULxaEF5ikRpi7clxw+fbr3WmJIx+eC8/qxiaakEl8HHsDMQbVMnwE6Gg5yTcDpa2Nk9P0pRv25D7sjwQFcVF26RAqCPdYE0R5RMR+vemE3SmILzodZboQ5/xenuEgSJTbM9i0WmKze0+Tf296Bg0yjsP1tPI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=YUkcFh1d; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YUkcFh1d" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-718e3c98b5aso280049b3a.0 for ; Wed, 18 Sep 2024 21:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726721217; x=1727326017; darn=vger.kernel.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=KJkmiG3PhPpYsgMJ7XkEBDNaPQyoDU9Xw+XJyRk65WE=; b=YUkcFh1dTyfWiWevuwRHHuVnalVpBCm3JevuvXTRwBC37K1kIzxXJeuPAqbro4S0z0 UWxvOdA5nBRuLkcdgiDB9nhSn6yB0WULGf6I2xrUTMG3eMopxaQYW83u6P9lgTGDMFSH 2CtxzZLCOOO6DKpTW65W7yMMZ/NDcSpFInkN5ibIE+aLAZCMmarME7rYCgAkBeBO6w9w t2KJmXYgmnddkcq7YbvsleoB6UrpSawqotDamYpcvDXt0lStk1+71nX0X78tFdB1PV9n 6jT5un3ZuznHdBzEHYFBVgpSqw9m/nCndovS1F7/WkqU4dDYb4ZBS0r85TQcQrK4SHZU kDcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726721217; x=1727326017; 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=KJkmiG3PhPpYsgMJ7XkEBDNaPQyoDU9Xw+XJyRk65WE=; b=iS4JLLLlzGUhOv7jdFRzPotnum99rQP4VD5qqRW/FZg7JcoKV1/jLiuIkkxd3KJLJq HEO1XXrwrYqggU1HGweajdo4jLY3XxQ2ydLVvd3XEQaEPx9O6c+WX/PEyBZxjcflOIA/ LFsVpNAnx60bwWMss0m2htw+exI5ph+fORnG75QVNkOYLFqO9ImyDF8K4vAn+OTBGN+Z CIBzrh3PSg7RzvqXlvsv+WV9skb9TYHDU3PZ9m8vGHT2NvyyoxVXx1CaTgUPD6T9eCVW bK1Drgd7AqXwA933h3HLH0EtzJMg0OcJZRmcbhPP6WPjBqrBnei0+QOE6GRM4zzG2Ujn OaIg== X-Forwarded-Encrypted: i=1; AJvYcCUL7XRkT0EBuEUC6/NoDbcUq+V43+lbSOUc15sFBpGRSSLC5EUkvPFF+tMlqJUcgjoJHsc=@vger.kernel.org X-Gm-Message-State: AOJu0YwWFeEiKPRbRrsaLWmULGQb2/V0USIddVoay60XrCVE+Jylr9tR fZ0jBRgsmejx4B2tBCuY0SGddTvLRleWp371Ox963+SX8/LDcvHIEeB5zpIJapzVjKfqP0LNRgd sVqw84A== X-Google-Smtp-Source: AGHT+IFI8OaToJZDzbcw+Y/dxaLu3fYE/OJ9AAnzLLztALk/zezzILuHxXxJLn5xpki0Ylem6dbZgA== X-Received: by 2002:a05:6a00:2401:b0:718:dd53:70db with SMTP id d2e1a72fcca58-7192606c438mr38378490b3a.11.1726721216563; Wed, 18 Sep 2024 21:46:56 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944bc279csm7478601b3a.188.2024.09.18.21.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 21:46:56 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Palmer Dabbelt , Alistair Francis , Hyman Huang , Halil Pasic , kvm@vger.kernel.org, Bin Meng , Peter Xu , Liu Zhiwei , David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Dmitry Fleytman , Hanna Reitz , Klaus Jensen , Corey Minyard , Laurent Vivier , WANG Xuerui , Thomas Huth , Rob Herring , Eduardo Habkost , Nicholas Piggin , "Michael S. Tsirkin" , Harsh Prateek Bora , "Maciej S. Szmigiero" , Ani Sinha , Stefan Berger , Fam Zheng , Laurent Vivier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Keith Busch , Jean-Christophe Dubois , qemu-riscv@nongnu.org, Igor Mammedov , Akihiko Odaki , Sriram Yagnaraman , Jason Wang , Eric Farman , "Richard W.M. Jones" , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Nina Schoetterl-Glausch , Aurelien Jarno , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Marcel Apfelbaum , qemu-arm@nongnu.org, Christian Borntraeger , qemu-ppc@nongnu.org, Zhao Liu , Daniel Henrique Barboza , qemu-block@nongnu.org, Joel Stanley , Weiwei Li , Kevin Wolf , Helge Deller , Yanan Wang , Michael Rolnik , Jesper Devantier , Marcelo Tosatti , Peter Maydell , Pierrick Bouvier Subject: [PATCH v3 05/34] qobject: replace assert(0) with g_assert_not_reached() Date: Wed, 18 Sep 2024 21:46:12 -0700 Message-Id: <20240919044641.386068-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20240919044641.386068-1-pierrick.bouvier@linaro.org> References: <20240919044641.386068-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. Reviewed-by: Richard Henderson Reviewed-by: Kevin Wolf Signed-off-by: Pierrick Bouvier --- qobject/qlit.c | 2 +- qobject/qnum.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qobject/qlit.c b/qobject/qlit.c index be8332136c2..a62865b6423 100644 --- a/qobject/qlit.c +++ b/qobject/qlit.c @@ -118,7 +118,7 @@ QObject *qobject_from_qlit(const QLitObject *qlit) case QTYPE_QBOOL: return QOBJECT(qbool_from_bool(qlit->value.qbool)); default: - assert(0); + g_assert_not_reached(); } return NULL; diff --git a/qobject/qnum.c b/qobject/qnum.c index 2bbeaedc7b4..2138b563a9f 100644 --- a/qobject/qnum.c +++ b/qobject/qnum.c @@ -85,7 +85,7 @@ bool qnum_get_try_int(const QNum *qn, int64_t *val) return false; } - assert(0); + g_assert_not_reached(); return false; } @@ -123,7 +123,7 @@ bool qnum_get_try_uint(const QNum *qn, uint64_t *val) return false; } - assert(0); + g_assert_not_reached(); return false; } @@ -156,7 +156,7 @@ double qnum_get_double(QNum *qn) return qn->u.dbl; } - assert(0); + g_assert_not_reached(); return 0.0; } @@ -172,7 +172,7 @@ char *qnum_to_string(QNum *qn) return g_strdup_printf("%.17g", qn->u.dbl); } - assert(0); + g_assert_not_reached(); return NULL; }