From patchwork Thu Sep 12 06:52:15 2024 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: 827776 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127591wrc; Wed, 11 Sep 2024 23:52:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWpn1tQqNMYmq3msrhbpXwUZ4Cv3bSi6ZBhsUq2ElJh9baqkoKuzHIIaao2JDtX32yphO9flw==@linaro.org X-Google-Smtp-Source: AGHT+IH5vyc+WQGmNAxv8xEjuuM0dLn6LoZxf5QV5d4/tXypvTuKTEC/LbVjjOTN8wvgeZnVaWNC X-Received: by 2002:a05:622a:52:b0:458:5dd8:c7d5 with SMTP id d75a77b69052e-4586032670emr27184701cf.31.1726123974636; Wed, 11 Sep 2024 23:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726123974; cv=none; d=google.com; s=arc-20240605; b=BK/PqqGHaQzmDkwmEu/auMmSJHqO15ouoxLHEvjICUKon3oqAlWKz2IdmU5fo0BiVG vM/TorvE1JAuLbsJQ+bY36mmjyZ7e7pVRZlAiXp5avqDoyMVD1A6EdYP/3ZUdfRXUMkJ glGGyqsNdl0fuaudE32ItVLXgh6oIcY72bkwYhcA9iSbbnHPOBpxIUauWbmuMLCjCEUZ FI48qTIc8S6gNZxZF7BYFj47RCzKE2kF5cU0TyGOKMr2oVc5/Mrgc4uPc91NJSprZsBQ gVsH0Ei96zNDMDoKCGj8pI4Xk6g1fzCbQQQtb4PmV0nGuYCsZwX062vxLKC6G4ssb1FX HNTw== 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:to:from :dkim-signature; bh=930EOxitUPSbWDmKCRCTZhjU+xHgrO7ejJVauC14yVw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=EZcH90NeHCa94q5S63Jxouw1rnUqznYhaFUNI8TB5g71eA5nGXcdYHn8Opauo33QT/ 7fZFh2zPzkwFwO6ducWFxRFxLYzepyuq/cDvamp/zEU2oZbz85YdpRi3jbIhW+AZ2g+L wvih6/rQYO66wsjSctvgeRhmJx/oNzcrvtJnZurJqUCxk5mEo5LqobFGpcqvZpzNv42M JtJSfOV1tPl+DjyIN1gocJehnvKlNyfYrFv6z9LzYqgy7mbINwmcdWYjVRMQW0HHOJi1 gFLO/hG6HbRomrDMBcyNLBLiH/9FImur/fKCrEaZGFZY36jcHRtSNfgyc4/LG/EmZiA+ /Edw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NOxrXpFg; 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 d75a77b69052e-45822fb00dcsi122651581cf.624.2024.09.11.23.52.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:52:54 -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=NOxrXpFg; 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 1sodh5-0003xL-U7; Thu, 12 Sep 2024 02:52:43 -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 1sodh3-0003rw-Oy for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:52:41 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodh1-0003Ow-SW for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:52:41 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42cba6cdf32so4614775e9.1 for ; Wed, 11 Sep 2024 23:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123958; x=1726728758; darn=nongnu.org; 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=930EOxitUPSbWDmKCRCTZhjU+xHgrO7ejJVauC14yVw=; b=NOxrXpFgxqcO2+LzMprcOOts1kj2pJwsJRrp9QdOOGq8rBHE9FMbfwBSMeX/HQ7EIk HdD40ILENyvmHpS8FCwMr5MN46JG4Bt2ZaxPsJ1sCoOIegSKSyrp5dd7LGCoFvUCL5Lu e09yAuNgTc8VtwWn8Dl9WbQtR+O5bSgk9Li/SsHpubSl9J4O0syab/c+BIKLv8tG5qIC tpBUWAjnf4I+Ey2TKlMUCP1kuzafMcCgesG55ueSP6HIWr8GKJzx+ijGc/+zoPzJMLBA ZM6vr0q5aVzEJEvcjJ2Yi4HyD+/Dzhb+UxtVXLYhoXsPcK/C+u8kwSU8imBvdH6MhmoS kLQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123958; x=1726728758; 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=930EOxitUPSbWDmKCRCTZhjU+xHgrO7ejJVauC14yVw=; b=CmbF1ZioOScJ4EFUbL2nhlev5ko2IENOc7VhWr7Z6u8ftutstLvGhtnnNSXv2DTlNN iFeCEA71uL/p0tjUzQsV9tkKJwCjd6p3L1p7n8AOZjMq3jps0Uq8I/AxZ45L0KJXyjlU q55v6HHHmMyYipBx3z8nMDh4efSPtIE+DzvfziNvTTuupTd7Xlqk9bJe5lvm6gj0kxFG zA2XdifyU/NnQ4ui65rmE2uM4w9hFk/rELoENWamhl/lALrV0bEAAQcKfVwLh1yGTii6 mDGWGN8CbRy+e+02ToHUPIEjthyRJKqraZNsRRpadI/Zz3PKdG9P7ojDmmtBLKPPLzTg 20OQ== X-Gm-Message-State: AOJu0Yze5k3XOpbaL+cKk7by2xSD8GC0tINOWaEDpmUiv8kfRMvMvYE7 mzd+rIa8butjzQs64oRmNf/OEpkURqmPTWQWPpfIBDcUiKHFihGS+n/001y/QrzlAoUN3O4sQPw I X-Received: by 2002:a05:600c:1c04:b0:42c:bd5a:9479 with SMTP id 5b1f17b1804b1-42cdb54cf2amr14877375e9.18.1726123957154; Wed, 11 Sep 2024 23:52:37 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675b7esm13427501f8f.50.2024.09.11.23.52.36 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:52:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 44/61] hw/sensor/tmp105: Coding style fixes Date: Thu, 12 Sep 2024 08:52:15 +0200 Message-ID: <20240912065227.67848-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 From: Guenter Roeck Coding style asks for no space between variable and "++". The next patch in this series will change one of those assignments. Instead of changing just one with that patch, change all of them for consistency. While at it, also fix other coding style problems reported by checkpatch. Signed-off-by: Guenter Roeck Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Message-Id: <20240906154911.86803-2-philmd@linaro.org> --- hw/sensor/tmp105.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index a8730d0b7f..ad97c9684c 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -29,16 +29,17 @@ static void tmp105_interrupt_update(TMP105State *s) { - qemu_set_irq(s->pin, s->alarm ^ ((~s->config >> 2) & 1)); /* POL */ + qemu_set_irq(s->pin, s->alarm ^ ((~s->config >> 2) & 1)); /* POL */ } static void tmp105_alarm_update(TMP105State *s) { - if ((s->config >> 0) & 1) { /* SD */ - if ((s->config >> 7) & 1) /* OS */ - s->config &= ~(1 << 7); /* OS */ - else + if ((s->config >> 0) & 1) { /* SD */ + if ((s->config >> 7) & 1) { /* OS */ + s->config &= ~(1 << 7); /* OS */ + } else { return; + } } if (s->config >> 1 & 1) { @@ -89,7 +90,8 @@ static void tmp105_get_temperature(Object *obj, Visitor *v, const char *name, visit_type_int(v, name, &value, errp); } -/* Units are 0.001 centigrades relative to 0 C. s->temperature is 8.8 +/* + * Units are 0.001 centigrades relative to 0 C. s->temperature is 8.8 * fixed point, so units are 1/256 centigrades. A simple ratio will do. */ static void tmp105_set_temperature(Object *obj, Visitor *v, const char *name, @@ -118,30 +120,30 @@ static void tmp105_read(TMP105State *s) { s->len = 0; - if ((s->config >> 1) & 1) { /* TM */ + if ((s->config >> 1) & 1) { /* TM */ s->alarm = 0; tmp105_interrupt_update(s); } switch (s->pointer & 3) { case TMP105_REG_TEMPERATURE: - s->buf[s->len ++] = (((uint16_t) s->temperature) >> 8); - s->buf[s->len ++] = (((uint16_t) s->temperature) >> 0) & - (0xf0 << ((~s->config >> 5) & 3)); /* R */ + s->buf[s->len++] = (((uint16_t) s->temperature) >> 8); + s->buf[s->len++] = (((uint16_t) s->temperature) >> 0) & + (0xf0 << ((~s->config >> 5) & 3)); /* R */ break; case TMP105_REG_CONFIG: - s->buf[s->len ++] = s->config; + s->buf[s->len++] = s->config; break; case TMP105_REG_T_LOW: - s->buf[s->len ++] = ((uint16_t) s->limit[0]) >> 8; - s->buf[s->len ++] = ((uint16_t) s->limit[0]) >> 0; + s->buf[s->len++] = ((uint16_t) s->limit[0]) >> 8; + s->buf[s->len++] = ((uint16_t) s->limit[0]) >> 0; break; case TMP105_REG_T_HIGH: - s->buf[s->len ++] = ((uint16_t) s->limit[1]) >> 8; - s->buf[s->len ++] = ((uint16_t) s->limit[1]) >> 0; + s->buf[s->len++] = ((uint16_t) s->limit[1]) >> 8; + s->buf[s->len++] = ((uint16_t) s->limit[1]) >> 0; break; } } @@ -153,18 +155,20 @@ static void tmp105_write(TMP105State *s) break; case TMP105_REG_CONFIG: - if (s->buf[0] & ~s->config & (1 << 0)) /* SD */ + if (s->buf[0] & ~s->config & (1 << 0)) { /* SD */ printf("%s: TMP105 shutdown\n", __func__); + } s->config = s->buf[0]; - s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ + s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ tmp105_alarm_update(s); break; case TMP105_REG_T_LOW: case TMP105_REG_T_HIGH: - if (s->len >= 3) + if (s->len >= 3) { s->limit[s->pointer & 1] = (int16_t) ((((uint16_t) s->buf[0]) << 8) | s->buf[1]); + } tmp105_alarm_update(s); break; } @@ -175,7 +179,7 @@ static uint8_t tmp105_rx(I2CSlave *i2c) TMP105State *s = TMP105(i2c); if (s->len < 2) { - return s->buf[s->len ++]; + return s->buf[s->len++]; } else { return 0xff; } @@ -215,7 +219,7 @@ static int tmp105_post_load(void *opaque, int version_id) { TMP105State *s = opaque; - s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ + s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ tmp105_interrupt_update(s); return 0; From patchwork Thu Sep 12 06:52:16 2024 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: 827778 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127658wrc; Wed, 11 Sep 2024 23:53:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVHJtPS52ksN/tASt+eHcjDeKXBoyh079hZLjuTyFSn03o3djlckL8pFB7REm/n1EWD4Gdi/Q==@linaro.org X-Google-Smtp-Source: AGHT+IGVaDjfawIqXw/84GUJM+EJH8ZNiZTIzD805j7M9Vu9mb4MyBrVW6JfCOmnP0WF/TIYxZWx X-Received: by 2002:ac8:5a8e:0:b0:458:34ee:3a62 with SMTP id d75a77b69052e-458602bbc3fmr24927191cf.7.1726123989931; Wed, 11 Sep 2024 23:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726123989; cv=none; d=google.com; s=arc-20240605; b=TKNGbcwOqJzgljAAe89F3xmAyiuwQ2IL4wH07IwFF6l9edlCzGoRY0El7wlJU4PVz5 hUxHrIfPkI37FeuabS/oe9xDC0eTWHe7IWt0mt/KqENl64cI5YyCqtp1wLxJ/yadqXXC ECwRZ7M57cwsrLSnJbmVGDLLlKdEkZeyU7NDkoxyMZcsymVFOwIV34MdW2rqgJJMF1Kr LSUbS4QNyBz8gHYFmVTRTVndX6MsLJN68r6xnzlZHB6mQN+oLm9d9NjrabJwlW34nhOd A/U5PpR5vFoGpI6t6LowDz+fVJSOPYHpC5sRhlJXGfSc1uXv5JA6T7Ul+Q5BExsI6tF0 akqA== 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:to:from :dkim-signature; bh=Botq1S9eMbImFvY+BTnSLblpWc6KEMCJ0flPbOePxcU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=NAmAyB0KVWkppanoVc3dRd7cKCjGez5bvVH7ez3b8rfTIsMECZUBsmdwIy/dk+PCRy SeX1Lp7VfsTWEvKmqzfUChWn5AKQzc/P99ZvNwTVUo1nZ8gVkgEnitShyQVmGH0GJW13 RMmxMsN8af9npvi8YfmN3g8kIdT1qTzaOKUOgBjyKr9j0i5wyP8vG04I94oX1v+Pp9an 0ai+BNEupBRAGHFsS3q3spv+oBHMK2nHDarGh3eR9WJpYaxwgVeg7KjHcMRPMVzl85Y9 JkhOMFvor57G0eb/HS3m9vSHNC2cnSAETZrlPLto44sY1lV2rjbGoGMCcYlG9ZJJUJv1 3qRQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ITyET9NG; 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 d75a77b69052e-45822f3eaebsi118170031cf.371.2024.09.11.23.53.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:53:09 -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=ITyET9NG; 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 1sodhA-00047S-M3; Thu, 12 Sep 2024 02:52:48 -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 1sodh8-00046Z-Uc for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:52:47 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodh6-0003Pz-J3 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:52:46 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42cb0f28bfbso4675265e9.1 for ; Wed, 11 Sep 2024 23:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123963; x=1726728763; darn=nongnu.org; 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=Botq1S9eMbImFvY+BTnSLblpWc6KEMCJ0flPbOePxcU=; b=ITyET9NG1v9LS/5ZY7GOKpj7YqwZoB9F+ijElH/w3l9vtJDT4fn8Veg3p2A6B0fBqI 9MFvQgZ1DPFuuY99QscwjYwjy1oc7JH4FY5cbTgc6ykSWAjBVVGlU63YvW3byrFb9lo1 WTyabpuIsufL7pzSYLRaqHRXQwu0oP3f9RjH6LspV7tSPrnIReLuADzZ+f/mvKSeB5Ig /5+F5g9NTHDiEiWLMM19Gkc8x9YL1Pn/ERHtxLxY5d1ohqLeWSnDWUJtXCd6bNzElRDY U5dE3fj+XUTuqOdKyQz4bJ+vwLb8YZWu4rqd60ll3ft9t41Lo8KyQeg+KCSjp4l22XTb r5Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123963; x=1726728763; 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=Botq1S9eMbImFvY+BTnSLblpWc6KEMCJ0flPbOePxcU=; b=oEmrAvWzy0NawNYMwrpiS9u+PdC9SA/z9u0Ryf3rv3BUIsNr7z5JEPbzPxnp9w/ete BjGKQveAGA6Evj/jKEbDFpkxCiPV/r3/EhzP+CUWnUh5c/WKGOjvGXuYGGhfVsnA185q LT0O5YiGkkCAd1Lo0cPl3N9/G5O6qB857vSolzUk7hkq6PocniwK/hMLFOQfBUmy1vt4 iC/+3gHFGgqqilBSArD1jmEo3g4M1N7BlFJ/cQ/xAswwKIqcOAmlGj7oYpsvsGQzGF9N 00Y5H5eq044KaZmB+q5ER+ldPpGX5HV/bR6LA4cI6rJvEq+ehyKqrKVcn9dBtSeNxzms OE2A== X-Gm-Message-State: AOJu0YwU7SB16plYLhOF5K9zjf1N+UVN+hNi1BlwtYGZehJ23aU4Lh18 y/5L0fj+tzcJGVmWpXYtmc/C2duPVdywCM66c8aIOsz6BrA/K9lhKtB99ylzpbSPT3yP/CS311Q c X-Received: by 2002:a05:600c:4e10:b0:42b:a9b4:3f59 with SMTP id 5b1f17b1804b1-42cdb529b15mr13640265e9.14.1726123962664; Wed, 11 Sep 2024 23:52:42 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956d363asm13523896f8f.72.2024.09.11.23.52.41 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:52:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 45/61] hw/sensor/tmp105: Use registerfields API Date: Thu, 12 Sep 2024 08:52:16 +0200 Message-ID: <20240912065227.67848-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 To improve readability, use the registerfields API. Define the register bits with FIELD(), and use the FIELD_EX8() and FIELD_DP8() macros. Remove the abbreviations in comments. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Guenter Roeck Message-Id: <20240906154911.86803-3-philmd@linaro.org> --- hw/sensor/tmp105.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index ad97c9684c..150d09b278 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -26,23 +26,31 @@ #include "qapi/error.h" #include "qapi/visitor.h" #include "qemu/module.h" +#include "hw/registerfields.h" + +FIELD(CONFIG, SHUTDOWN_MODE, 0, 1) +FIELD(CONFIG, THERMOSTAT_MODE, 1, 1) +FIELD(CONFIG, POLARITY, 2, 1) +FIELD(CONFIG, FAULT_QUEUE, 3, 2) +FIELD(CONFIG, CONVERTER_RESOLUTION, 5, 2) +FIELD(CONFIG, ONE_SHOT, 7, 1) static void tmp105_interrupt_update(TMP105State *s) { - qemu_set_irq(s->pin, s->alarm ^ ((~s->config >> 2) & 1)); /* POL */ + qemu_set_irq(s->pin, s->alarm ^ FIELD_EX8(~s->config, CONFIG, POLARITY)); } static void tmp105_alarm_update(TMP105State *s) { - if ((s->config >> 0) & 1) { /* SD */ - if ((s->config >> 7) & 1) { /* OS */ - s->config &= ~(1 << 7); /* OS */ + if (FIELD_EX8(s->config, CONFIG, SHUTDOWN_MODE)) { + if (FIELD_EX8(s->config, CONFIG, ONE_SHOT)) { + s->config = FIELD_DP8(s->config, CONFIG, ONE_SHOT, 0); } else { return; } } - if (s->config >> 1 & 1) { + if (FIELD_EX8(s->config, CONFIG, THERMOSTAT_MODE)) { /* * TM == 1 : Interrupt mode. We signal Alert when the * temperature rises above T_high, and expect the guest to clear @@ -120,7 +128,7 @@ static void tmp105_read(TMP105State *s) { s->len = 0; - if ((s->config >> 1) & 1) { /* TM */ + if (FIELD_EX8(s->config, CONFIG, THERMOSTAT_MODE)) { s->alarm = 0; tmp105_interrupt_update(s); } @@ -129,7 +137,7 @@ static void tmp105_read(TMP105State *s) case TMP105_REG_TEMPERATURE: s->buf[s->len++] = (((uint16_t) s->temperature) >> 8); s->buf[s->len++] = (((uint16_t) s->temperature) >> 0) & - (0xf0 << ((~s->config >> 5) & 3)); /* R */ + (0xf0 << (FIELD_EX8(~s->config, CONFIG, CONVERTER_RESOLUTION))); break; case TMP105_REG_CONFIG: @@ -155,11 +163,11 @@ static void tmp105_write(TMP105State *s) break; case TMP105_REG_CONFIG: - if (s->buf[0] & ~s->config & (1 << 0)) { /* SD */ + if (FIELD_EX8(s->buf[0] & ~s->config, CONFIG, SHUTDOWN_MODE)) { printf("%s: TMP105 shutdown\n", __func__); } s->config = s->buf[0]; - s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ + s->faults = tmp105_faultq[FIELD_EX8(s->config, CONFIG, FAULT_QUEUE)]; tmp105_alarm_update(s); break; @@ -219,7 +227,7 @@ static int tmp105_post_load(void *opaque, int version_id) { TMP105State *s = opaque; - s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ + s->faults = tmp105_faultq[FIELD_EX8(s->config, CONFIG, FAULT_QUEUE)]; tmp105_interrupt_update(s); return 0; @@ -277,7 +285,7 @@ static void tmp105_reset(I2CSlave *i2c) s->temperature = 0; s->pointer = 0; s->config = 0; - s->faults = tmp105_faultq[(s->config >> 3) & 3]; + s->faults = tmp105_faultq[FIELD_EX8(s->config, CONFIG, FAULT_QUEUE)]; s->alarm = 0; s->detect_falling = false; From patchwork Thu Sep 12 06:52:17 2024 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: 827777 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127609wrc; Wed, 11 Sep 2024 23:52:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX/aFpS7QO83u+nielpb6+7j6OaRbs0wdvPxuvAnjUp2RjXPUV5rvbn2/xFE8GPm5Z0z/wmSA==@linaro.org X-Google-Smtp-Source: AGHT+IEHuiyTSDzk1lBpimaiPH1PEr2EHFrWcNV9QY+Y3EKzilWMGfTOQ6oe03+qJhllVwoLQVZt X-Received: by 2002:a05:620a:1917:b0:7a9:ba49:8b25 with SMTP id af79cd13be357-7a9e5f934d2mr319172385a.42.1726123978553; Wed, 11 Sep 2024 23:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726123978; cv=none; d=google.com; s=arc-20240605; b=GRW3fwMJpe8XeGSFIy2hYRTh9VJvS9VEWH66zq0lVWek7Bv3iC7wLqRPvKA/axU8YE YCXnOnKpyhkbFDPMGkqBAP6aM5sQ1aqBnSOUehG/9MOWLfCpblIrQ20/fepqfV05FCgN sLkIKwjGGVrDiIOTmpk42GWs+jHse7OAwWKEbgKF9LXbAYccCM/bv4ROkLA1/EdNy/rj DPt3WAsk/LNK/cwmxKRIwDNUCTjDON6rpZDXmdDCCQZJvAfEyhaVcAyillZ53N1w00bD dHJFLco1t9DYY+jqpqg9ky12GlDuIByiGxbOoeFDT/erVceHxF7FbZSi7gZ+SrhuRDil ncgw== 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:to:from :dkim-signature; bh=V5BN+QwDDBigOpVAkHKfRD9kl52tOEsyOrGfIU6uf3I=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=SGGk2DMSmhjCRjWr3eFjkLof/ZMkq4r7xif2QKe9cyeOEdExhX/NZLDRtPcKVea/gr eS5CmKNfgIHl8sUg0HZDTgc31Lgxg3FIH6tthM00BxscdOG+bj+OShdf76CzZfUsJWGu lWFToKstpv4Yz112VkrHjKjPEs2728nDUnWII4ko0GE/98R/HMkASQodi4cEsIiqYUFW WOULfoYCEVJnsjpbVEBbiFHOziT+8JX/13s8hQbEdkstD5uLuwphlirEw/VV+qo6juK5 zcjqu6TNrD7vZIZcl3xzbRbuXZIDJXMiQll+4Gp/WUWBO1acBM400CaVRA5p+L3u4q2Z xHOQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fgD/Ppqm"; 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 af79cd13be357-7a9a79c65acsi1245907185a.25.2024.09.11.23.52.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:52:58 -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="fgD/Ppqm"; 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 1sodhG-0004VY-8N; Thu, 12 Sep 2024 02:52:54 -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 1sodhE-0004Py-S4 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:52:52 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhC-0003R3-IH for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:52:52 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42cb6f3a5bcso6203995e9.2 for ; Wed, 11 Sep 2024 23:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123968; x=1726728768; darn=nongnu.org; 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=V5BN+QwDDBigOpVAkHKfRD9kl52tOEsyOrGfIU6uf3I=; b=fgD/Ppqm2kWBOy2kW376Ib9pzFf5aj5jWbob5uuZ8Ec5tvcsznAD0ahaz81yC8FO3i zbKME9gB46Vq1rridUA7sov3OxkdIdJVRZGAcXOtpqU+rFX3mNRzXdk5iOJBdrZdXOJM UBdSmzzSiUDCYQunwLGmlU6Rsw1ek16bMd2SKURpj/ygOyaU6qtS54pk+AoDC2jfCC7Q TkPnWTuHgp6jYMTWQp67T1exkGJM+VexWFkBHaZUc38jN2A+7WWYNyTXKMFUcWaYkdsg UuYbmh7NtqwySYoG8nKfmOAQgLXnbcVseM1uoxQapCShMzV0g5vHHOsNSuu0nIqalQXC AuJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123968; x=1726728768; 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=V5BN+QwDDBigOpVAkHKfRD9kl52tOEsyOrGfIU6uf3I=; b=o3ht71DMfeDzxf3Cmd8w9fzgm8r7vrrKK2n8/MXY5qzjnToHZEPWyR6ko5SppjvPRJ 1JYaxFNk2cG4FVw5YVPlKwSEvp9Eqn7HyFoFk5bRWXqVj64hspnoUDC4Vn45e7z6untR KzpzFs9QeY10EvM4sWt+qYVxxDZpyM12q0F8RsBEgUU0nAWAUxafzCPVKn/TDAq7cU/x VSVjsJV5Rx5WDrS/uaGoBCZacgnkPpp64fOduaflA3+2mMPlhmopwetio+C9MUM4it24 L1vrn/8rMW5oHg2vowYYLX0O7MZy3YdiQicc4AQT9HTcxsxnXCiy1I/tS5JbzkJmWA6t oraw== X-Gm-Message-State: AOJu0Yyb6tfY4msLmMR3KxbCEvUKX0vljY1VZDWjaYUqUg3Gt2yeVaxa ZZsFTBjmkWByrbrMXtxX+yKssXbxYgg760VpDaJEZUNdRFaP5UN8sDHRIEWxknXTzgFc2psEtcF w X-Received: by 2002:a05:600c:154c:b0:42c:b950:6821 with SMTP id 5b1f17b1804b1-42cdb5495e8mr13462905e9.19.1726123968162; Wed, 11 Sep 2024 23:52:48 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956e8700sm13401232f8f.116.2024.09.11.23.52.47 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:52:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 46/61] hw/sensor/tmp105: Pass 'oneshot' argument to tmp105_alarm_update() Date: Thu, 12 Sep 2024 08:52:17 +0200 Message-ID: <20240912065227.67848-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 The next commit will clear the ONE_SHOT bit in the WRITE path (to keep the READ path trivial). As a preliminary step, pass the 'oneshot' value as argument to tmp105_alarm_update(). No logical change intended. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Guenter Roeck Message-Id: <20240906154911.86803-4-philmd@linaro.org> --- hw/sensor/tmp105.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index 150d09b278..6740200aea 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -40,10 +40,10 @@ static void tmp105_interrupt_update(TMP105State *s) qemu_set_irq(s->pin, s->alarm ^ FIELD_EX8(~s->config, CONFIG, POLARITY)); } -static void tmp105_alarm_update(TMP105State *s) +static void tmp105_alarm_update(TMP105State *s, bool one_shot) { if (FIELD_EX8(s->config, CONFIG, SHUTDOWN_MODE)) { - if (FIELD_EX8(s->config, CONFIG, ONE_SHOT)) { + if (one_shot) { s->config = FIELD_DP8(s->config, CONFIG, ONE_SHOT, 0); } else { return; @@ -119,7 +119,7 @@ static void tmp105_set_temperature(Object *obj, Visitor *v, const char *name, s->temperature = (int16_t) (temp * 256 / 1000); - tmp105_alarm_update(s); + tmp105_alarm_update(s, false); } static const int tmp105_faultq[4] = { 1, 2, 4, 6 }; @@ -168,7 +168,7 @@ static void tmp105_write(TMP105State *s) } s->config = s->buf[0]; s->faults = tmp105_faultq[FIELD_EX8(s->config, CONFIG, FAULT_QUEUE)]; - tmp105_alarm_update(s); + tmp105_alarm_update(s, FIELD_EX8(s->buf[0], CONFIG, ONE_SHOT)); break; case TMP105_REG_T_LOW: @@ -177,7 +177,7 @@ static void tmp105_write(TMP105State *s) s->limit[s->pointer & 1] = (int16_t) ((((uint16_t) s->buf[0]) << 8) | s->buf[1]); } - tmp105_alarm_update(s); + tmp105_alarm_update(s, false); break; } } From patchwork Thu Sep 12 06:52:18 2024 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: 827787 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1128023wrc; Wed, 11 Sep 2024 23:54:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWZb5TEJNBHIlS1JOXxrDmHmvy3LKBOxFhI/SrZ48QAQ2jB6IL676EHy1V1/GXmo9m0g0PWvQ==@linaro.org X-Google-Smtp-Source: AGHT+IFmqwE8DDoweUz8Fl8qp7rU+/GZsCyK4PWUkeJ/s8JkLpcaEkESR2qbvZqQGzO+t+clkmu9 X-Received: by 2002:a05:6214:3114:b0:6c3:6e19:aa23 with SMTP id 6a1803df08f44-6c57356d938mr30410436d6.41.1726124091615; Wed, 11 Sep 2024 23:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124091; cv=none; d=google.com; s=arc-20240605; b=KeguVzdjkAGYmjFdA0WcvlEgyW69c2aaIJAh5zj142jRAG3fx/kGhk/I5HxxPhQTtc wPczSi5u0cf4aE2y5LhBMybEMFwrgu7KSCsys1L36L76QFEAR+n4d/PflXJv3h8J024P 1m3UimzbR7kDklMJwbPcRRwPOvmrgbpv+SAyRx5xJbRlNbtR0HnC6cgY9b9s4R4ci10r nw5SSREdN9nvnk5YfzxvhKyG5fLXAKuhVmrXxWq3IoWkTDLnaAkX1n0cm7IIrllMid2F XPSdiU7ozFb4bXR3s+HLLzJWPs6mWTg6zt/SLXf2UBYZLIoWTRfj/fm2ETsQ/fRQCxPr UNvA== 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:to:from :dkim-signature; bh=LFdQQyV2bmEsjuWxwcR0v9/S6TIwatMWxB854Zl8gYU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=XHqKZx4to/3rk+4mNPSvAVi9BjrqkzLtn2XYHmKAd7AVnp/a7a4cn0an4Xlj6UoAYY DSmRv8Ss9ChLxyjqI3pi6gzVIgXnjm0OSb9mUEJfNXRPUNacO5AbtdcEuLdAH90S/Rrl x8pNP0gkBLGMzzXgs4MH+r6ZreoksiRQYZ5XbdduL2Q80M2QD38omKbWShDSPkUQmh7u yNflc87ZinY0IJrZgulHKR3V861KZjK3HZvbmGJZot8IjMhhna91m/dap3HtVKiIbNnC tbtnDG4elletyjiome0yo82pjj+pPSF32/jknIxwCd/qdUGDkZXfs1kcA1dIfxRiu8bK vvMg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QDrSJhFY; 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-6c5348dbf2fsi121238516d6.602.2024.09.11.23.54.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:54:51 -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=QDrSJhFY; 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 1sodhK-0004pf-52; Thu, 12 Sep 2024 02:52:58 -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 1sodhJ-0004lu-6F for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:52:57 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhH-0003RH-L7 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:52:56 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42cc43454d5so4409255e9.3 for ; Wed, 11 Sep 2024 23:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123974; x=1726728774; darn=nongnu.org; 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=LFdQQyV2bmEsjuWxwcR0v9/S6TIwatMWxB854Zl8gYU=; b=QDrSJhFYYzRN/r++sEcuVCDm87wrU6I21xjiuoddNraTrx34+96RBt/2xjjiMBGqaw q5g+Q/D3hT4lph7Yb/+lB4wAeT1fdxWgVKPyfCoy7ghJf0iNmunfs+s3UQYZdikVXejh Sdf/kWcSew3Q6bO5zBQqtWf9j89t5pv0tCDfTyA/TSd2iyqJ7FL89CR9zOQrxrLckxMa 7Lws9WKtEJPJ6WuseD0LOgMxnZpR5hqz1jy+Rz0Aft7pi4YrK4wXoZsWDYrNoPsJYzbB ussXI+UM1e4jioGM+/Z83YQ7ZsIKvnAXknHpJgdI4W+z2bpOAv4KFDZzlvijNSFEqI/J rGVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123974; x=1726728774; 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=LFdQQyV2bmEsjuWxwcR0v9/S6TIwatMWxB854Zl8gYU=; b=tnHAGb9z0UT2qUjTdwA2Wkf0+YvacxLZM89MJ0BWzRKq0whisuma2MA3+yupMxE1Hc B3ulm5HAPI4nSAC1nORWEr/n9IGGtx6IGBZtTe1EBXicRw1PPWcOQMx9mx1Ayqdl19UA Y0YgK5JTbSYvR1FXvxH46mbhSIgsuRjPCiOIzCkuxsE/EAVOcU2LmJ47jrkEPh6+tH/x b5GEyZpIzkof9GPqj07P+4YgbJTxn193996fMUwkVbG06Rv7gnEStFPSs5qvj+lS/uCY keJ1quZ2CqDdeJmOBjv5E/kn3UWCqPHap8E7ud/lWSVgIHuJh15CPk+71y4LVNC4aDEV kD8Q== X-Gm-Message-State: AOJu0YwAhh1Zx6Mqt4XVTnDUDKqZBjQmb3S0S6h5QxGVefZ3MWR7joXo ZBAZIE6BilC4qKIjE9A0uU4gtODB4Zgx+FkUzscIpp/VAx8SlcqhXHkAURVj8if7js6fowRCjVa 1 X-Received: by 2002:a05:600c:3b14:b0:426:6edf:6597 with SMTP id 5b1f17b1804b1-42cdb547d4emr9707885e9.19.1726123973680; Wed, 11 Sep 2024 23:52:53 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42cb73ab096sm125266255e9.22.2024.09.11.23.52.52 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:52:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 47/61] hw/sensor/tmp105: OS (one-shot) bit in config register always returns 0 Date: Thu, 12 Sep 2024 08:52:18 +0200 Message-ID: <20240912065227.67848-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 Per datasheet, "ONE-SHOT (OS)", the OS bit always returns 0 when reading the configuration register. Clear the ONE_SHOT bit in the WRITE path. Now than the READ path is simpler, we can also simplify tmp105_alarm_update(). Signed-off-by: Guenter Roeck Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Message-Id: <20240906154911.86803-5-philmd@linaro.org> --- hw/sensor/tmp105.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index 6740200aea..f5101af919 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -42,12 +42,8 @@ static void tmp105_interrupt_update(TMP105State *s) static void tmp105_alarm_update(TMP105State *s, bool one_shot) { - if (FIELD_EX8(s->config, CONFIG, SHUTDOWN_MODE)) { - if (one_shot) { - s->config = FIELD_DP8(s->config, CONFIG, ONE_SHOT, 0); - } else { - return; - } + if (FIELD_EX8(s->config, CONFIG, SHUTDOWN_MODE) && !one_shot) { + return; } if (FIELD_EX8(s->config, CONFIG, THERMOSTAT_MODE)) { @@ -166,7 +162,7 @@ static void tmp105_write(TMP105State *s) if (FIELD_EX8(s->buf[0] & ~s->config, CONFIG, SHUTDOWN_MODE)) { printf("%s: TMP105 shutdown\n", __func__); } - s->config = s->buf[0]; + s->config = FIELD_DP8(s->buf[0], CONFIG, ONE_SHOT, 0); s->faults = tmp105_faultq[FIELD_EX8(s->config, CONFIG, FAULT_QUEUE)]; tmp105_alarm_update(s, FIELD_EX8(s->buf[0], CONFIG, ONE_SHOT)); break; From patchwork Thu Sep 12 06:52:19 2024 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: 827779 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127687wrc; Wed, 11 Sep 2024 23:53:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX2bcy9IvFQf1sos13cniLanCy6WfS3lmj9JAvJWtUfAwSOLEZqP6Uq6lm1wcP+kjm6WnzXaQ==@linaro.org X-Google-Smtp-Source: AGHT+IG2y5/tafHjmKEcOIvD23LsBI9N0GGsTxurwqxs17cH/ImDD8QYrsOFyBrcsXslp6l1WCcV X-Received: by 2002:ac8:7d55:0:b0:458:532c:2059 with SMTP id d75a77b69052e-458602d8da7mr26918351cf.18.1726123996118; Wed, 11 Sep 2024 23:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726123996; cv=none; d=google.com; s=arc-20240605; b=C1fE6U9pFM9ZBR+40knJVV6RZ0yuvER+uhEgo4e75pJw5a3GE0lDgo+W2vBlHAnR59 EtUNdWGe7c+akoD+tX2psdcyD0mCxEX1xn1hcLN6Pxx6azDEOy/oKaIWxtmvok7ktuQ3 JBhHsYe9EaZWg92RBKcjx5f4BmMGq08bLjRiHGz6Zk9ab9LvKUKGmuwkCOrYXwTNQzHX 3N5EFCYvzvN/AasOoL/27wEopCo3AZsl7bVBSRa+Ba0/5AnTaaIX9UfBbRJtBO6DUbDh 3Z9+ldgqtSPRdGMUhAfoOiADKhF4ZRQa8Z5A/xEj6H9MQvm5axR9aOvzYyyBNBwuL+Yi w9mQ== 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:to:from :dkim-signature; bh=vlRmpnbCbgSErzwwLA97yhTv9fMzKif0TAzO/KO/JOk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Z2E7xQdSFKTlQ4mYBOKsHDrAbp5ucDtSVRQgfVtIcdWeYbrcfVx62pGMpCkfBE0n7F NZCVvi88iuCsCWxFjQCKcBPcR18R3UxNlcbmEbdgM8cdKpQgL9Lm3YJjIujv+I6fnybG Kzn6HueT1bWDwWoBAWczhVsfLbSiJQUd4xSP7w6xuRsw6PWuKYbQZRyJt8z2BSOYF67X Aa0JD6CWqV5FdSTwqk1jpo4RBm5rq+47rvUd15zx+OhMzPy4YSM3APdIlB7zrFKu2BaO 4cYsCLCrG6fZ/f2uroN0PT3YqbsDbTuyb0MhSg3JrAgQmNqCL4+N6uUMtzrfuZH+1Z5F sM7g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WtR5X7Kr; 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 d75a77b69052e-45822faf977si120409071cf.588.2024.09.11.23.53.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:53:16 -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=WtR5X7Kr; 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 1sodhQ-0005VD-D3; Thu, 12 Sep 2024 02:53:04 -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 1sodhO-0005ME-Iv for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:02 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhM-0003RX-Td for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:02 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-428e1915e18so4373065e9.1 for ; Wed, 11 Sep 2024 23:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123979; x=1726728779; darn=nongnu.org; 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=vlRmpnbCbgSErzwwLA97yhTv9fMzKif0TAzO/KO/JOk=; b=WtR5X7Kr61e7FTeTtdt7RHjLuhvm9ZcmZAHx8w4m6CU6T3DFKZILu1/6UqxxC1Yuua d/+lnh1TXhcIOCYNaho7D2YMvbKoxYUVfXkAkhpudVuyl+Ag7LAohwfQrU59ivFnKwp8 GgsgIaVL5InyxlcNsXp5NitxHdAFnjAAq3E3ujGLUtkSqKtXe4I+sdPq1VG4XJ5vT9ky NU/zhc33vfvNtg+YmBr3SbBGi1C5lEY0j37LlBRMwHUvgRGLRmW72I59tLbHjdEkxRWD UYaoAxla3/FdDKSfIHf/8w4X+nQ8VUBXNjwGFuAGyiKeO5S9REujHpGuWjCJ0YsvG6Cg tXdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123979; x=1726728779; 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=vlRmpnbCbgSErzwwLA97yhTv9fMzKif0TAzO/KO/JOk=; b=sCkJZkxp7qQeFecb0R7g98aftutTAxL20Cb0nDpyy5XlEsWmunYEIK1VytQ2QTYqel xgAkd8nCP5jsBzbgK/MABAOOXTvSBW99mXHhswVCxiQIELrbfSR0j5KS0PSV9jMrxUSn 8NGOCQAzdUDLFtdElklKJoID8odJpEDLTkIAICW6zOzGxMclzMwGGEE7AUlhvEX3wgj4 TYRN0QOvMHYlqlkQPP7HbhRMSdAKXw25f8yc0blkl5RDajsQK7G6fITCI4VYsueWLTOy TXiSP/+LeAjGX9bQqoSFM6nRUeK1tBFzSyeBefR9Ky1eD4U/EAQUOhR7ZIemURflIpAd O4ng== X-Gm-Message-State: AOJu0YzyBCoNl8mTtZhUiysH7fC8BLEKiYOp0bgis3XlhqaO0v6ldCJu K0faU51rqrArw4bmtrIe+IfCjEnKpAdf5dzwj7dJGh4HYvbfkgyF/rWPsihzw+5/98Fr253tdqi 4 X-Received: by 2002:a05:600c:1c1f:b0:42c:b6e4:e3ac with SMTP id 5b1f17b1804b1-42cdb531d35mr12560495e9.3.1726123978958; Wed, 11 Sep 2024 23:52:58 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb444b0sm163333205e9.21.2024.09.11.23.52.58 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:52:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 48/61] hw/sensor/tmp105: Lower 4 bit of limit registers are always 0 Date: Thu, 12 Sep 2024 08:52:19 +0200 Message-ID: <20240912065227.67848-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 From: Guenter Roeck Per datasheet, "HIGH AND LOW LIMIT REGISTERS", the lower 4 bit of the limit registers are unused and always report 0. The lower 4 bit should not be used for temperature comparisons, so mask the unused bits before storing the limits. Signed-off-by: Guenter Roeck Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Message-Id: <20240906154911.86803-6-philmd@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/sensor/tmp105.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index f5101af919..9d7b911f59 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -171,7 +171,7 @@ static void tmp105_write(TMP105State *s) case TMP105_REG_T_HIGH: if (s->len >= 3) { s->limit[s->pointer & 1] = (int16_t) - ((((uint16_t) s->buf[0]) << 8) | s->buf[1]); + ((((uint16_t) s->buf[0]) << 8) | (s->buf[1] & 0xf0)); } tmp105_alarm_update(s, false); break; From patchwork Thu Sep 12 06:52:20 2024 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: 827780 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127716wrc; Wed, 11 Sep 2024 23:53:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVNcuahRqAwyBWTHyAtOXbIqmZUknQwn8NeTxYtbxXima6xNfmOMG/pvgxKz98YOgFGg2oQ3w==@linaro.org X-Google-Smtp-Source: AGHT+IF56EhyO9FuyIJmcWUmvr6iElbLyH47bQmSMTuNslS93hM721DN+VJo+vbFAWDeglN0eyuV X-Received: by 2002:a05:6214:4188:b0:6c3:6455:85d2 with SMTP id 6a1803df08f44-6c573508014mr26328336d6.8.1726124009257; Wed, 11 Sep 2024 23:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124009; cv=none; d=google.com; s=arc-20240605; b=HZDlx4r8oaJSfgoSPUfUjJ+Zv6GJRPcdyktrrKrWlDaEJv7qV/v4pV683zsZ7PD40o 8G664glAaXh0YzSwGDOxtSDjaYTEquHSq7hLEzrGoyNTZieEMBJ9t+sFICQTw2e/CkeS W7xc2LDCUlY6hqkDw6uiOOj6RKIpZhPF3x6gKbNwnrK8XmAJtCa2n6xBuMZK/spXiPmI XY759QIemOGfWtlW9EYUNBSytF32g3e3LY5qXrVGN3R5x59qzlR8AxcOd4cU9ab0zMS3 PWMIS637RrbF1eT+xQ8gZndQPA2vfaJvfHOfTS3ZDyW5IEjQKVlW2Il46RlYIrCf2Wyy L78Q== 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:to:from :dkim-signature; bh=eioWWeRgyOaY5sg2V+9HU3V0/ONJkXh1P/1QORE0Zbo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jNM7+digq/OP3fPl5U2lgEcqc0yYlrX8wNvqbW43wj1Bf2t4/8nNn8MdFPYWePf4ZH QDz5BnzyxMRaTQIg1mOws5FFX1Qy2yZZcl88C8EOgbMK4CpzwP7AyA2Vz/oHE3Ixh3uB QmsKdblFlP8PDHWxs1UGwXxOvCBXaYJ80lW8/8Atj30Deq2Q3G31tagfPGh8f24hLES7 mPGl/N874Ydr/5rxHNkXY5YkEWcltwYdMeoNWgZYYHduYxTy/8CVppUiY/hjQ9r8sR6N 2HUoGaGiLs1hV9JFSMgX8/ioRsgn6pAKeNMCt1VyqHYR8Qpz7r9roF+V+M8BgeDtNqn4 NX4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BLBofvVc; 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-6c53433049fsi121519936d6.6.2024.09.11.23.53.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:53:29 -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=BLBofvVc; 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 1sodhW-00068g-Tv; Thu, 12 Sep 2024 02:53:10 -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 1sodhU-0005qx-RX for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:08 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhS-0003SY-S6 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:08 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so3336545e9.3 for ; Wed, 11 Sep 2024 23:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123984; x=1726728784; darn=nongnu.org; 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=eioWWeRgyOaY5sg2V+9HU3V0/ONJkXh1P/1QORE0Zbo=; b=BLBofvVcZdlCbH+iihUUPlP7+Xv5cUkvHl+uwPx2tiIpHgXIk4K86NgkzbkjsHTsx3 QKmBDhUeyb+ski4bjS739QZMQ13MY0/wveoDErXtwtSSq3c5MFQSH2cSoKzGMNUTjbjK mNLp+87yEgHrism6U0ZMxlFSdqDmVDFwiu/K5S78Qoh72NjaGDsUeFMpxiwAMlSadb+y v4W2kPDo+XhsVJON8lTStWxXEVSGmCd8gQK9EmNlD+Y+8cHsm0ofRNkK96x1Bczs14Pu NQfEcgsooBzdsayWvlc9elSlvXqjjIhGlfOUe9V2o7cdyQdw3JeT7hfLHuut6QhysaKA DWlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123984; x=1726728784; 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=eioWWeRgyOaY5sg2V+9HU3V0/ONJkXh1P/1QORE0Zbo=; b=B8KHIKqveLlaXrnVTRqcpfoUfvkHUqllDFOipmn/LxUNIk/MNNkYGt9zm9JDy2a5eI a58jo6rvtbpXw6LnVf17jtfFG6fogQHccN509RSg4lAQByopnUWfHiGXyPDcVDSEw+o4 WxwqWtKVdnHzJ7j0lMAZz2yaJNQv7Qj/CypGTpQlxvtJRz2Zi4a1tBlyw+cSuHs92F0o IyQYj4VnN66372SEWJE1IbkVaOvgLsFkOkcmXQwcswoY2BrfQQxiB2UD2xDREqJ5IwbK /PxTL2QmWXWK546QitlTcbgauSeR4oSbOO6mhwBvmB7rYECpYuxw2tb81gMlNhammP7L OeBw== X-Gm-Message-State: AOJu0Yw04lCnelxoHKq7fAMp6n4jlqRgcWne33PvrTmwVt8hqniHI4o1 JrNY8A8geO5XCNNsfchAtjdawOJdakgZ78r/usMbnjGCPY5e81x6khERtCCj7FQcQhH2z/ksvir b X-Received: by 2002:a05:600c:4ed1:b0:42c:aeaa:6aff with SMTP id 5b1f17b1804b1-42cdb54078dmr13652955e9.10.1726123984467; Wed, 11 Sep 2024 23:53:04 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ca87acf26sm181419795e9.10.2024.09.11.23.53.03 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 51/61] hw/char: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:20 +0200 Message-ID: <20240912065227.67848-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: assert(0); | } | ^ Solve that by unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240910221606.1817478-5-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- hw/char/avr_usart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/avr_usart.c b/hw/char/avr_usart.c index 5bcf9db0b7..e738a2ca97 100644 --- a/hw/char/avr_usart.c +++ b/hw/char/avr_usart.c @@ -86,7 +86,7 @@ static void update_char_mask(AVRUsartState *usart) usart->char_mask = 0b11111111; break; default: - assert(0); + g_assert_not_reached(); } } From patchwork Thu Sep 12 06:52:21 2024 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: 827785 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127998wrc; Wed, 11 Sep 2024 23:54:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNSQrOyFBYD4NGHzBRv1aRZf3ze0JchLdCDmw4kIHoXvEqryygcCB1A3Wi75TmynpVPPsuug==@linaro.org X-Google-Smtp-Source: AGHT+IFffbeZeRIE9yOlCMK+NjwSGWxPepYo5zONKt8F56xHXneufSeL6kQItREj2L0q7BQnVD/Z X-Received: by 2002:ac8:5fc2:0:b0:458:2894:984e with SMTP id d75a77b69052e-458602a7489mr28977271cf.3.1726124086417; Wed, 11 Sep 2024 23:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124086; cv=none; d=google.com; s=arc-20240605; b=hF+OFHqJT+y98jWejSYO3cezH2sqC0FjOFvCvFroLO7OHMdCpiKqzsIyG7zJ34Ur0G D8jsVbuXcutaGL3+HRPCJhjSMuKJ8hv/n1lx8TteibopKpTLqc8/tRDZNXIO84J2erjA DpYfCfwQr17eHW459jX5MYZc7rpCb+zt9ICU3RgVvCSaupVGKnFuL+m0HmySRI1xc5df l+qzapDRainFJ0HfuZ/KGhwbRTYeRl3PgcLDZADrXGviUWXsOTg4IGligBUe4lPbcvLX 9t2b7vEKL6H46IffxOsa1kgb0S3NZFtUayYbHVfWuSk8XGyNwYgVCpvuGGjHTlvStm4F UAEQ== 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:to:from :dkim-signature; bh=OsmhMkPXAJPNIk8exjedFxVnBkDRePms2WrWvHvrW1E=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Az/Y/MfJjgdPMGRWs2xiCqXZyAOwudONuaa7kYNJ05VVgu0iXfuYMRsliRtqK4NUpH rYqR4YbnrQCe47HthqQR/yziOs29V66T44ZTyHDfReWmPZL+6cFih1qHxRdwIleLRq35 lOlHPZJhgokeroo57WSGsjXJP4ft1Z1KNedtStmk0dcJ5LxT9e5Kl8qVUAr/vVN2AzrV UEmylZZ9NLwfMaOGosR08MqwZVtjEFrHEOKszeLQJIY+xv2/TskZfv2YkuTVZEaTF10W Wq7VkNEt0+MqEfnPI7XgirCZSSE18OPhZwsALKnU79+YdU8BG+66tFJtLrg8vpFxc1D3 84Tw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RFlLChLM; 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 d75a77b69052e-45822f81ccesi123777361cf.493.2024.09.11.23.54.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:54:46 -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=RFlLChLM; 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 1sodhb-0006dH-2B; Thu, 12 Sep 2024 02:53:15 -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 1sodhZ-0006Si-Nf for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:13 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhX-0003TO-Rb for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:13 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42cb1e623d1so5433045e9.0 for ; Wed, 11 Sep 2024 23:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123990; x=1726728790; darn=nongnu.org; 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=OsmhMkPXAJPNIk8exjedFxVnBkDRePms2WrWvHvrW1E=; b=RFlLChLM1SqMcMCg/U2GxVSUdkZc8dXMChWZwGxjCBzv3R/VCUJ2ZzEjuNj7NJ8vsf QFtlXjgtBgYeGJSrkwi7XZnUqqCT/9wapL8bddhOqMry2ts/NQKnKVKNfFWXKQzdFiNl PwFTQmss2oaqYxLnKuFdvGMTLjKDe7T0Q3pOpIFmhJrdoXI6OWneIPCT2qJGXoZqwJ0v ciswLyGylaUwoZKS0wQleqMMwG6qgMtygX0/9Y5/fDA9CE6a0vEhZ03nVaXxZFAFqUHq IHnAHGxQSsZRKx3UXdHVFvP3lCTPDp8uxQJWx3AqOOxA1DsVls0a5wzeWGTiXtiLUewf ATgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123990; x=1726728790; 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=OsmhMkPXAJPNIk8exjedFxVnBkDRePms2WrWvHvrW1E=; b=RdN33qyeVNHdCV38BRwqVL0bEg0OcJlJHiUfNm/NrkWNtEPwtQoNm+zpmR5BKKPSnQ fm/JKJQcUje9OqSuitpxP7xokhDLR58wMvPKxlpX58DFj0QfA3mJR+1SEMdLwQSy3tO0 IUp9TLZNA7WSV4Y9dg/sz+vae3KKGuNMIgMFMWVMx3kXvsActprG9bWvDx9oTjilSeP4 Ag4eTwIJznBUIXx2JuKoIji3CVXHKL4brPaERlEn2BOBR1FZL5yH50YAIJFQo02rsKFF 6CYoKITAtl7u3xcTcf7hkIJQRRdhzClzM6sKzA38LkyZu2lz66zf9U2slNbAeAQlNHWd R08g== X-Gm-Message-State: AOJu0Yyfumc+MN4/6fH8P4dLq5KlmPoLZx2LAyhUDpzHnnq1FGSZ/lVj yWO/7QmHkoVnhn/VrD85iIUovO6WhGvcyFApoeT1G277cU9HPlfbmEBQcg7ZghV7C+L23Fv60tz e X-Received: by 2002:a05:6000:cd2:b0:371:8f32:557e with SMTP id ffacd0b85a97d-378c2d4cab5mr908312f8f.39.1726123989897; Wed, 11 Sep 2024 23:53:09 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956654f4sm13450031f8f.43.2024.09.11.23.53.08 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 52/61] hw/core: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:21 +0200 Message-ID: <20240912065227.67848-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: assert(0); | } | ^ Solve that by unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240910221606.1817478-6-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- hw/core/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index fb81c1ed51..1b5f44baea 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -380,7 +380,7 @@ void parse_numa_hmat_lb(NumaState *numa_state, NumaHmatLBOptions *node, } lb_data.data = node->bandwidth; } else { - assert(0); + g_assert_not_reached(); } g_array_append_val(hmat_lb->list, lb_data); From patchwork Thu Sep 12 06:52:22 2024 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: 827781 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127722wrc; Wed, 11 Sep 2024 23:53:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWx+GYA8uNU0bb1/A8dLSAVhxuuGBCVTnzW8Duh2q8vch1WrZwCbFTrmAF3MSmSRWMu9zCm3A==@linaro.org X-Google-Smtp-Source: AGHT+IFr1cFNEqq8ZFqIeqCG0NY4WsfOTHEVQ+CpZFuU58OCWlMaMXJZIsJ1I+mqwOEvgLLmTO9T X-Received: by 2002:a05:620a:4693:b0:7a9:bae1:a1fd with SMTP id af79cd13be357-7a9e5f78e41mr277222085a.50.1726124010031; Wed, 11 Sep 2024 23:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124010; cv=none; d=google.com; s=arc-20240605; b=JqpWU9xefcHSa9XKt2a2NYSUB5odXWGxK+ApEdlf8dIAaulEBxShPYq/tntyzkjWmy O/M/QACYHHdhznlBV2F1hXYPxX7/CfUzTagY1YDfGFx+7wmEcaRMYd65gtVEGe9O5hqj lpWcRSBi979ZC0MoRGANnQZsNHbxRCK4OmvQsCqFeJpXAP7GVorp8WAejx9yo9BnwnCZ 6xQqLnCPFeK21ixCRTMIDuYtlYfjZzNfdyberQ0SuOwm1xnjChAMpDrm2uWCacPn4RT8 jqidvpL8njYKEUyTzWNLcsThkTep3MMDnEO4RbT3u6MnF1pB9KJSXImZVXU9M56TbjzI Htew== 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:to:from :dkim-signature; bh=CgFUNHEs52jLsHHSU5YLFjyTmIMNSfp3u0OOxY3dyBs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=iHbLmgFFObzEGgmC437kfP4V7moM9y5Tkt/05st9PhPRxtYENVNsOxduLZ6gaoCFJO g3T2ZENjAmgE2a0s5XeQFwPhGtrUAg99mN4YPPKJKtPuvetqDmnz9JSYD4i4zoRG1/bJ 0ZtK+/3vfl4NDnLPNWrZ4CzRsacDSF4MFOH1/gaHmBPi3oo+sXcqp96zlgm2gl8n/Zl/ 1TpUU4dMYBjdYhE1iuIzvb8M29RTU7/Iro/A5aKza5ioOr2TdE5UmQ04E1wHW4JD4gpx cODBcuezMK0hLguiXAvShJADHd5iQeqJ6cO/0vnO2GPDu6fwy1mEWWr6TANJF70FSzxQ cl0A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iFHcYUeF; 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 af79cd13be357-7a9a7a55ab7si1242145585a.544.2024.09.11.23.53.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:53:30 -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=iFHcYUeF; 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 1sodhk-0007X2-Qg; Thu, 12 Sep 2024 02:53:25 -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 1sodhe-00078h-Ot for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:19 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhd-0003Tl-51 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:18 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42cde6b5094so3337575e9.3 for ; Wed, 11 Sep 2024 23:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726123995; x=1726728795; darn=nongnu.org; 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=CgFUNHEs52jLsHHSU5YLFjyTmIMNSfp3u0OOxY3dyBs=; b=iFHcYUeFWMfxm8Lrvr83A9DQOl4TIW1jzGERRCNxE3or2PV7L675SYnnrWN+lpM5oy ZvcvugUSEJgFzBmRofubOQZ+NxaR34PtGAQnrgEb7tfAGQu+ohME34PJ3ojuNhVMGp3o HSOzVInmMW3zPkfKrl8jQgicpuDVJiC58Fkgp5FIz7j7UAJUpQgHHPmUKpW7bEJyTlrP Lymf3qpAqCMlX4noJIi/ClAHF//RxWSxL2ftdcTPgy4SdLEN82+9jxgEpKEzPXDBZUXH NIFpqH0qYe+S9c3ieRMNz1ZulxZIF+QixlUs2oMcY1ygrDE2rw0051VPAS4zmkugTfO8 sq3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726123995; x=1726728795; 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=CgFUNHEs52jLsHHSU5YLFjyTmIMNSfp3u0OOxY3dyBs=; b=LdpceVzOyNt9FaSXgLYIsOkGe1ksQBVSvS4jg5EQJmUYtEk0YoYQeSIzus4NssAqSS oQjUiLJ2gdbWrLER8NVSmxg+mtc9icYTl+S1E+zOakl0G7g9a4eerIutH9vaNt7hyQTo 4SeYdHudG9RIcckMa53tNaaXiQ21N/PocynmnF3aYkWVxc8BefdDdgyTo3wRQFQ8M8Ll 59M89tjy0jAi6ACTJlHLQ3bHRbKZqbDKS1DnElJ9XN8TcQk9vxSxVIV4L0hv8Z3bK4J/ lpVMFHRD6nBGxytEBQP2kmf6Wl9SVZbZWKl0w4kNsoa+ALRTKsn8UEa3PhZBQQWYBENC UH+A== X-Gm-Message-State: AOJu0YxLdm5yzveRSh7SEWTTaZ3mwQXaF46uJnfmA1LgcdqwT/lEti52 0nmXabjr+TrlIoHwK0UgH7pACZsU56M0ab/XhhcuKXxHmWMtzcRCDzB9AQoUNX04VEchSQnCr1k i X-Received: by 2002:a05:600c:45cf:b0:42c:bdb0:c61e with SMTP id 5b1f17b1804b1-42cdb547f05mr13201675e9.13.1726123995352; Wed, 11 Sep 2024 23:53:15 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb21cdfsm161707405e9.10.2024.09.11.23.53.14 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 53/61] hw/watchdog: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:22 +0200 Message-ID: <20240912065227.67848-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: assert(0); | } | ^ Solve that by unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard W.M. Jones Message-ID: <20240910221606.1817478-8-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- hw/watchdog/watchdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 955046161b..d0ce3c4ac5 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -85,7 +85,7 @@ void watchdog_perform_action(void) break; default: - assert(0); + g_assert_not_reached(); } } From patchwork Thu Sep 12 06:52:23 2024 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: 827789 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1128379wrc; Wed, 11 Sep 2024 23:56:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV/YLvymrIP/syDVisX95808UMDxY/6pC9DxVjLHnskFXMAOvmMZolURTNem3U+lxcEC9l51w==@linaro.org X-Google-Smtp-Source: AGHT+IE5HbKq/DuyaHDHqJhOCogWARDnMIfFm3Y4Cfkpwm7up4Oi2YxbtqfVGiI5IIEwNKjMsF9n X-Received: by 2002:a05:620a:4481:b0:7a9:bf2a:d7d8 with SMTP id af79cd13be357-7a9e5eea6e7mr270954685a.8.1726124169111; Wed, 11 Sep 2024 23:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124169; cv=none; d=google.com; s=arc-20240605; b=IOiK3Y5mpI+oiP4RSPFcvoZXOAt1gAZMwvjVnIwx5ohQFCa7lWKNvvo3QDRKidAlNn 5I4C7K4uVQKU1g+t9/v3EpMvxi2QiJEwpmDwTtRqRbaLgYzn68QYKtbrShqjO7fUMT8X kfE5SBOhL5FkhGrPYDRRy5kghEe1xWBxfDVd6uueP2eHQThBQeCVoBhidZ7FA2cb3SR6 zzrTMZAFZFAJWfdgZe8IS3CaHen7Z4KdVyId7kEn53bDR4Zy2VxJ6vE8tUkySwEZJiW/ BEWgd/siPrcuCdir6EppsJA+D1ry+OSsqw6uMsAhR6oUiTmyw9Ktdl08EGCfClxcmUeC y6Zg== 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:to:from :dkim-signature; bh=5FoqK1kIA8mj7Qd/lvT8K/kPhvh2nZqcUgQPUn/2U+o=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=UvM6yltVv7Y3mo3IAK3Yx95kji5Fbo7nfSjMe+GGo7p+gj2TU8nSeyHmAcMa//CV3e BZa/8kY3ERff6G3FK1bb1ga6aEx/4l6cs+pF3Gw7mMPooh6FpCS+zfwRzNZ8Qg1uKOPL NBJ7Mi+9YaCe3K9mAR+0NxiQXqEYXqE01lax4fAQ2dLdGaKR1i198ZjNNhEY2h+QyfrE g4qkayX5RzIIpv9GOk1Taxxf62WVBoFvy9F2xrdKdGLd/Kr8+15CI/YXzoF/CpuAlBLe rJlSb3uGL+kd8SQ48PQKxvRIyI46l4KqV+Y4hHJo7AqVkaFEDZ1o0vILXTXmbd4WBmi2 uVKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XTNUFyTu; 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 af79cd13be357-7a9a7a48a88si1173344485a.471.2024.09.11.23.56.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:56:09 -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=XTNUFyTu; 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 1sodhs-0008GE-6z; Thu, 12 Sep 2024 02:53:32 -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 1sodhm-0007my-65 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:28 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhk-0003U2-0W for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:25 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-5365aec6fc1so649599e87.3 for ; Wed, 11 Sep 2024 23:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726124001; x=1726728801; darn=nongnu.org; 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=5FoqK1kIA8mj7Qd/lvT8K/kPhvh2nZqcUgQPUn/2U+o=; b=XTNUFyTu2lmpzZsAWtv4mo0RQoaEe73o3W79l6tiGW87w4Hyeh2w5Dxh8GaUHpncsr yYRlXQSFFMKlrzZ9Aqwkl7+RyekhMQs13vG8d6BtLLBUrV1rLdm9KmgDob4TdgUohpMZ 5s/hCNRNfW8eyftk2Q8CblTZrRzKW27sASEXZRaDI7z3g6a+mjJcHFDi1cnEi28mdhiV KZSPzyIRynZqX1R6zsqTCCCJs3YmZZqcINXT0kk4TNKka2hhJzSf8VN3Qc8kyRvoxwsa jy7PpFrQjsBwON9QYzrEF08xu9ODcizc5htKwZ4+nXBVNLm59gZi8CJN6W+Fj8Uf/rZt /HUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726124001; x=1726728801; 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=5FoqK1kIA8mj7Qd/lvT8K/kPhvh2nZqcUgQPUn/2U+o=; b=QXukNxIxYcmSk+XrOzuT+TNvdXgpQr+l8QMI5nLzIv5oORJQKyUWctvZHsytZ151vF 54GW3u/wZqV5vsB5xbFhWjxthEvBH4+aNmVXLZTGzwAXjpwkWfWBFN8YNS4KeQZzqC9c CWPGHdmAYU64BjPsWKbxJ2cplU7IMWxIg05ohz6XVOVEUqzuYYUMJoRJ26BrTZqtQ4Om yVmD/Fiklz3QBHyHBq8fiEJA5Or1ko1jvDXJVsWOTAbb4nS0N6ETTfg4mQl1DzBHt1Ng z7ccJBvygkJhB3Wqazt8xv0vCMrPiWqrYpSItVl4AUPriOKllsJseKjJXX6GC1n99NWJ KHFA== X-Gm-Message-State: AOJu0YxX5W3AAUr63Lt2J/1zIKDzgiMmjorxiDM8oQehADgAqdQXw4Kr mHm7VjC9KPOVTA6ET/xxLgkcWGKg9zSKxtRnR6mR59gTQYMa0MgTxGjwnHrAJoLUwdYLsWT5Glt A X-Received: by 2002:a05:6512:4019:b0:52e:fc7b:39cb with SMTP id 2adb3069b0e04-53678fce759mr917978e87.26.1726124000681; Wed, 11 Sep 2024 23:53:20 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caf016a08sm161947705e9.16.2024.09.11.23.53.19 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 54/61] hw/gpio: remove break after g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:23 +0200 Message-ID: <20240912065227.67848-10-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: g_assert_not_reached(); break; | ^^^^^ Solve that by removing the unreachable 'break' statement, unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240910221606.1817478-28-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- hw/gpio/nrf51_gpio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/gpio/nrf51_gpio.c b/hw/gpio/nrf51_gpio.c index ffc7dff796..f259be651e 100644 --- a/hw/gpio/nrf51_gpio.c +++ b/hw/gpio/nrf51_gpio.c @@ -40,7 +40,6 @@ static bool is_connected(uint32_t config, uint32_t level) break; default: g_assert_not_reached(); - break; } return state; From patchwork Thu Sep 12 06:52:24 2024 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: 827784 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127921wrc; Wed, 11 Sep 2024 23:54:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXCO05oWMthHSs3VsPpKkcI4+IswoMQ8IkRGeFlJ4PwWDJNlitacrpWKvMXLWg+lZiq9c55Pw==@linaro.org X-Google-Smtp-Source: AGHT+IGSR1VECtKKirZ4W6D1L8rsjxYj/HXj5HCKUCD5GvnTHZTIUAfvSUStPI8f1GbxPS91gnZq X-Received: by 2002:a05:620a:1917:b0:7a9:ba49:8b25 with SMTP id af79cd13be357-7a9e5f934d2mr319623385a.42.1726124067289; Wed, 11 Sep 2024 23:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124067; cv=none; d=google.com; s=arc-20240605; b=AAP7KyngjO7TO9XQpuNM9zwyAb6+l2kwx/wBMUQyISgb8O6pPFkkkGmyiOQx4ivMCq JzIXj54j2bQZo0SVUHpVd3ttleBvALIVJLKtacYplL1HLkLZ0KrKS00jSRq3iL8CDDG1 Ea7qG0O9ufeeoaDiIMgkYCT6H8/eimXak/mfVeHJ/BYxWN2NWWoIxbJPvDWzW/dad2ee K+XIoGihiPXuI2GDUyDwNKkwddqpf1b5Sx5+5s3o6PLzIzK3f1WD7O1J2LE9Th8X1h5J ojm01krGUPFEk+OQCiaPjQXRVEJTsHFuJwufzk+MLPUQbFMr5+qLCAuwY0VoHnsa8DL/ P7Ew== 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:to:from :dkim-signature; bh=t/ZEidfxNqICq7WM8b0XlnmkWjSILpdbASTELUMU3dY=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=bfCmWieVLeXmGdEuFz5QMENmLRNZturKqHhS2qH0inqMCER1kYLAUYA9k8DV2I9TVr rtRTu9PmtJd6mka8DTtnlwuPq/KiEhNEj39zj/RN5bkg4YrPb0l1hW5Tiw4VvaNFnj4+ 5f2M4kbjPa/UgFhHDVpOpAAmPFkYcsFlStvCXWQShw2Mgx7PJ/FcxaOUlwHMXaY71Vhj YbqDAcBhoOY+sTejI0dHHcv4UXJcllNeWYBPkNK8W616nx+SG5JypJU1Sy5pIrqJSES3 +2WlrjS9NClGuGlqMY+ecrKf1Td/pC4x0ly4awEchrEGCM3c2qhvUp62gcTf+z34luSM lUKg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l3HdcZPo; 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 af79cd13be357-7a9ad7e3740si1107560485a.642.2024.09.11.23.54.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:54:27 -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=l3HdcZPo; 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 1sodhw-0000BL-5y; Thu, 12 Sep 2024 02:53: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 1sodhp-00081c-HM for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:29 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhn-0003Uo-RP for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:29 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4280ca0791bso5187445e9.1 for ; Wed, 11 Sep 2024 23:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726124006; x=1726728806; darn=nongnu.org; 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=t/ZEidfxNqICq7WM8b0XlnmkWjSILpdbASTELUMU3dY=; b=l3HdcZPozICfqf1Mr53aNrvyK+Y4gwzGmDhFdEzcFjqGiU6SPwv8DTTvjz+kQ1a3g9 vvvZO39u+ApqPnP2zzOLBGeF8KuCaj+Uhl3KyvUfSy/cVtsFAwRRT/bg0ah1BLK9OeK+ DAcJ81omqxl611Gn4mP05nnWf6LLWXfYQEv0eGH5ZBAwSY/10h50WHbUewwzCklVzhWj 5dNcyZWTAFQfNFCnIM0fb+dQRdilXLQjPFGmz16l15Og8+lpCGSRe2HbXcThus/ko0tn yNSjsPcvdy6aUjMSalnn2pzi9zhqBvwtZYd4tIPfUXht22ew+70iUM3iExWbstmFVuym aHyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726124006; x=1726728806; 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=t/ZEidfxNqICq7WM8b0XlnmkWjSILpdbASTELUMU3dY=; b=M/1CvG9i9kuQfg6Yq+x2+3ab2MajQ2KNxSbVEr1qJu6gzUdkwsFBXsGwRi3NB8at9R wTdUPf51qJeWx5ijSXXZLIynKHXTS6/Bzv1U1abmf8FTaSJl6tMJsiuTcJ9MBc2mOf/Y zq9uAdvghVgdoHQPXg+GsPzePwjoTWJwBP2f8VIbR5g0hfSNo544MLhlTfdPvDQ4lLhl uGsMsIsWy6FNHJ+Vp2XE5t9FHIJv620YBjDyhS2O3vUvVeKs6D1R0G10EJCD3fHJKTFu sEuD9ytnIq4UjxLdtLDZ4md8dDBrRXZLTWaf0JvcF65Np/6BNYbrfzMJ1DBUVeFbWNz9 +gWw== X-Gm-Message-State: AOJu0YwthuB7QUqcjpcXS/3tZMKDKQEtqYe8PGf5IM/SlrMJ01EwVNzI D4X0uWGjNH7dTPGcCb7EzhDAIs907G7YUS+34jBLjkij2tzvrOvce1HktalFrnJ5RJLmF4x87sh Y X-Received: by 2002:a7b:c453:0:b0:42c:de34:34be with SMTP id 5b1f17b1804b1-42cde3436e0mr9697815e9.3.1726124006044; Wed, 11 Sep 2024 23:53:26 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb8162dsm162743385e9.29.2024.09.11.23.53.25 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 55/61] hw/misc: remove break after g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:24 +0200 Message-ID: <20240912065227.67848-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: g_assert_not_reached(); break; | ^^^^^ Solve that by removing the unreachable 'break' statement, unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240910221606.1817478-29-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/imx6_ccm.c | 1 - hw/misc/mac_via.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/hw/misc/imx6_ccm.c b/hw/misc/imx6_ccm.c index b1def7f05b..fd5d7ce482 100644 --- a/hw/misc/imx6_ccm.c +++ b/hw/misc/imx6_ccm.c @@ -301,7 +301,6 @@ static uint64_t imx6_analog_get_periph_clk(IMX6CCMState *dev) default: /* We should never get there */ g_assert_not_reached(); - break; } trace_imx6_analog_get_periph_clk(freq); diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index 652395b84f..af2b2b1af3 100644 --- a/hw/misc/mac_via.c +++ b/hw/misc/mac_via.c @@ -495,7 +495,6 @@ static void via1_rtc_update(MOS6522Q800VIA1State *v1s) break; default: g_assert_not_reached(); - break; } return; } @@ -556,7 +555,6 @@ static void via1_rtc_update(MOS6522Q800VIA1State *v1s) break; default: g_assert_not_reached(); - break; } return; } From patchwork Thu Sep 12 06:52:25 2024 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: 827782 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1127772wrc; Wed, 11 Sep 2024 23:53:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWdv1UAxEYJZpoX+28lh2ViEsYtt5YErTww0fYMBLZOu4bLx6fvvXiGlW8T5ipVgAFxI2Qy4A==@linaro.org X-Google-Smtp-Source: AGHT+IH8ZVJPWJsxtUycRiugF4jjWujBuMHfT4tLJfGXA21NkOZv3dWhkOJFHhNunBoXMhgH0epN X-Received: by 2002:a05:620a:2910:b0:7a9:9ed7:b49f with SMTP id af79cd13be357-7a9e5f3f454mr220506885a.38.1726124023343; Wed, 11 Sep 2024 23:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124023; cv=none; d=google.com; s=arc-20240605; b=Oy0VwO4cZZcg2g0VSh5XL4nqxPqgSzE3r1cB7++/yylECFUywxkGgK5vGN0daHrelI AhCH7GshVI5kP/VqNYRFw2uO2PGEUGXAj+u/QEUkPbx1iztF53EA57amKPjsGmjqh0Xd P/gG0191bymkjZC3hDOM9wkydb8nDqAkT7KVQPKn26bd/zB/2YSGZDaWtCTWnAguZnth yYQfJgjumbub36YnqukzbcjMc+czQCXu/603jm0nW2p5sfjeDJ2jZPkqwNlsp1kWpQwk zEd4GpsQc+FbDiEloS0t0HXPiw+qzSarSDXVtbieN1Wtzps2+vcIz8BJ+gkBkjN3iJrs a/eA== 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:to:from :dkim-signature; bh=DoSSTd0j6/NNSb1Pb5Q11FBgrZrs0Txd/Ud1jRinqIs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=UhVFc7FIYNgfSLR7wLTYaPDHlC+hIjTtBHP12k4/lLfOsHqzxGC/Wkctgnrvq/7zSW pPukiZN0WlzqC1QwdR2TkT/3kDDko8b/8ma93MycOqIaWe/s8Zv9eZFgl9xqoGr4VLDx ZCiuTESBRL6VSnFNLaOzGO37etDRntizl6IVnPIHC0hN11xBbNZc7LGE2KZfrfkGh59C I48ZUf46/ko3qlHO/K40jJDnvj8zzwchNH+HrG/y9FbK58TZGyLCUOIGhHJUIvg+/7Qv ZBLZ3/wEfox9Q6xMz4NephphiR3AMrgI6eheCkJM3q7PZrNRvNrbozp+OSqXfYiq4P1G 3Ktw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eR8C5yd9; 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 af79cd13be357-7a9a79c5246si1199614585a.8.2024.09.11.23.53.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:53:43 -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=eR8C5yd9; 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 1sodhx-0000Os-HN; Thu, 12 Sep 2024 02:53:37 -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 1sodhw-0000Cy-1L for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:36 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodht-0003VJ-S9 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:35 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-371ba7e46easo518935f8f.0 for ; Wed, 11 Sep 2024 23:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726124012; x=1726728812; darn=nongnu.org; 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=DoSSTd0j6/NNSb1Pb5Q11FBgrZrs0Txd/Ud1jRinqIs=; b=eR8C5yd9t7UnYUYFHfjrJ8HwhqkeZmgJ2EmhX1KKO+KRzNqdqHHXYblrKXZohR6W2x Ne8pGo83IhLWlNJBNa2gd76Q1iAq5+w8cRAdvZu4t3zDoTHCmA9afoO8jmsJAU++Q/2O BUdluaBeQ96RAkGoJDN6gl83NASqmJGqqZ8iq0QmWyOCzFDEuykWziHFFHi6iGUVmwqT 2KloM/M8GXJuINFYraLa6Xg0Bsp4YW8pltF+8rNP0+yPOoA7jLEHjnlnVr+CB4sFNpXb QUMYtvbg1gBTuJTUZcREXMi6c/KCdBigEoDcWHd0YWVrVPP1jWb5isQZfL7ZU4NwhKAN 7o1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726124012; x=1726728812; 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=DoSSTd0j6/NNSb1Pb5Q11FBgrZrs0Txd/Ud1jRinqIs=; b=a9CmDmuH6GgfHOY+/noe9sq1kmkVx26ONZQMDQMRq6iPKkPFelkWRMI4304MLfESEM 6EyTR3cScFdTn5TEQbvAzngEqHJhylsfK6Q/iEtrdO2OKRSul0leEgGe0os2N4Tf7zyV CVfP/OL91kqUThwpMOZjeNd65qxm7E5hC2xw4zfzFK0sEtJpo7OWVnlb5vmGRy3aOFmv edu8ghasEnGHiHcWr/VTJ3dA9smVcK07BKudl3E/I5ZRcMUAP7YbhbJcoCLVmOngIpmO rGcfMBqFXQG5qAiLaQ7EeZrps/Koe5dnEYZi6Ep7FKCaLZN1t65AvIiGQoSnU0TnYhoB XRAg== X-Gm-Message-State: AOJu0Yx/hPk3Wv0f8e8l3teSSgvL98faJJlMjHCkEHM1kcixVToavwVY W6kdWJ6KghJvA6Wwo91no6Nud9Uzdjd5wq6thl2XfoCKXZj13SNk8hmWIIx5/VwCp5CWS4PIGi8 c X-Received: by 2002:a05:6000:2a8:b0:368:37ac:3f95 with SMTP id ffacd0b85a97d-378c2d032ebmr1378015f8f.31.1726124011715; Wed, 11 Sep 2024 23:53:31 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb44473sm162061135e9.26.2024.09.11.23.53.30 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 56/61] hw/pci-host: remove break after g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:25 +0200 Message-ID: <20240912065227.67848-12-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: g_assert_not_reached(); break; | ^^^^^ Solve that by removing the unreachable 'break' statement, unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240910221606.1817478-31-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/gt64120.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index 33607dfbec..5855741662 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -689,7 +689,6 @@ static void gt64120_writel(void *opaque, hwaddr addr, case GT_PCI0_CFGDATA: /* Mapped via in gt64120_pci_mapping() */ g_assert_not_reached(); - break; /* Interrupts */ case GT_INTRCAUSE: @@ -933,7 +932,6 @@ static uint64_t gt64120_readl(void *opaque, case GT_PCI0_CFGDATA: /* Mapped via in gt64120_pci_mapping() */ g_assert_not_reached(); - break; case GT_PCI0_CMD: case GT_PCI0_TOR: From patchwork Thu Sep 12 06:52:26 2024 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: 827788 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1128039wrc; Wed, 11 Sep 2024 23:54:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXzztgJSF6IcnKEr3kRau+P2c67Vv59MAj3CFgjLQd6gg440pF6ISr8ua14ahApgkAt2FRi7g==@linaro.org X-Google-Smtp-Source: AGHT+IFk5aFt1w14VCH6+TEwh2BxkOayl6AWnFtVJYOhAT7/3Llb97nuZOWMx7bLPh54AK6mzYtA X-Received: by 2002:a05:6214:3a02:b0:6c3:68d0:350d with SMTP id 6a1803df08f44-6c573510bcfmr32521316d6.14.1726124098075; Wed, 11 Sep 2024 23:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124098; cv=none; d=google.com; s=arc-20240605; b=KTHxHiq6ekLXO4JW21z2+4MIFQ9zUibCZGp6Tizugla3BRNYGyk52On3Icdg3A9H2R G+yuwDKuPjbnN3CZWEVbHKRk+jxSNaaaJjChkOezsfdjnTjTpz771Ag2kJxdde3mDn69 ydIBPVf6VB7CtkKXnRgVxD2bFx1rvlqhSjDsH4Fi2SHp5i+6eWck448CsFlxBMx0hqu3 KrLvqektwkbCBpQizerCWO10RSGXx5hyoQYyl3ntiIrqyeEamsopHQI4OKYpjijdKRlA 0pvlhgIFQYjszcRAx2XcdVFBL4d/ICqkuWFMI7ZOGBSgRUTMkqkDx/Ulete7nBVJmqL9 d8Iw== 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:to:from :dkim-signature; bh=jtNJDIJpUDW0bpRhizb3Cf8FodNOF9sdbTjBD++YWOI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=RPxyXxSy/nAFgFI5Tv1ZGeNj2NV5jUVNxpsqhrVyRuatDmSuw0CgA8phhpyVUu8/gU c7+y6wLHtgk4yxwb9qoH4oX9ZZgsfPU8pKdrC/cAk0WhHgCxaXGXegvo7vWhWjEnKXKn aztcpoocsALQqxI4wqCIhi9rbY8mi/VJXe0TPFk9gW2mcdfXj8RK+qx43Hum/qLOKtQb qhzlJjrDyRL1iHCJIPuI0beIXuPTIw+5aEddDMbe5Uy0uh09Vg4m3tW4Y3JI5APwUrTq W50+M0ahd7JgcbxJdcHOYj8CsteSoFNAxtt7BYdNvK5xWk/FPi/GaNM2X0U52n8K+gxt jlRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OOBjTxjR; 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-6c53478299fsi119361436d6.355.2024.09.11.23.54.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:54:58 -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=OOBjTxjR; 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 1sodiC-000197-V9; Thu, 12 Sep 2024 02:53:54 -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 1sodi1-0000lF-2t for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:41 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodhz-0003Vl-7p for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:40 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-374c7e64b60so404020f8f.2 for ; Wed, 11 Sep 2024 23:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726124017; x=1726728817; darn=nongnu.org; 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=jtNJDIJpUDW0bpRhizb3Cf8FodNOF9sdbTjBD++YWOI=; b=OOBjTxjRedfsg000zdCcywmC7wd+EohaoAPOteRVous/V4/87O7p9R9Y1rOP+iEF7/ c+UrWcLX6evU6ft4k5xwe9suskHomuyhqlGsDv85tBueVXSC+yN145a/D0Bqx4nmJReT Jv1HTkw5Tj+qGskA+sK4SbiPCgdif3ljEDwb7QjnQRAzLbKie2rumMALzuV7R/ruV9HZ nQbQ7hofEpnY5tzRou5alk8GJCuPHKkq0g9Nxh1FJ82vZfvFAvSZOeB7Eq7oUJumBA5v B6lwER1gHRc4PHoSWfcr+eCXrH8KA6U3+CImgVLAl623nis6/P/QYIvP+Q3jPX/tul5D pMJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726124017; x=1726728817; 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=jtNJDIJpUDW0bpRhizb3Cf8FodNOF9sdbTjBD++YWOI=; b=s5QfuWYy2m9Sa3YKW5OX3+4Yik0i1tAqPtzDQdYuUMBAaenb70AruHhuiiQ3DiU6GS mh3v1NcLIWIMy9p1V0CJyjIxhSAcI27+vfllBXpIlo41HTnyw8TbnacJzpu8hGXJYaFs 68VpxxPV1XYsXhnmx0v0SX17o8cy5QYhnGo/d6qwAl06VksrWtUEd++USQ9DgJpBW+Li aBZIAm2iJM5VVRshn0JPXFZqVEnWiyl0Kh2yJbncrPXShqE9RUNXVU4EUBvhbj0MIZup 9KuX7ZnC0fFS4v2DpLOspW7PPrnPnMcWN764K1QUYWNCdKA/nIdZ35lbfsUgyMgLe0NJ tUjg== X-Gm-Message-State: AOJu0YwG8n+ZtrfugcQQKEWgvM0S2MFrmlyfWK4XMAGuIHbgfg0KH2Y3 EErRhkOoi5jVgWqWONHJ9gnwqv09OZ9tZ5xwbeKEliN0bONBk5TGVnCWvIoE9kj3tcmAvKxvsid z X-Received: by 2002:a05:6000:ac4:b0:366:ee9b:847 with SMTP id ffacd0b85a97d-378c2d05d7emr900018f8f.14.1726124017186; Wed, 11 Sep 2024 23:53:37 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956653f9sm13440159f8f.31.2024.09.11.23.53.36 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 57/61] system: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:26 +0200 Message-ID: <20240912065227.67848-13-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: assert(0); | } | ^ Solve that by unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240910221606.1817478-11-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- system/rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/rtc.c b/system/rtc.c index dc44576686..216d2aee3a 100644 --- a/system/rtc.c +++ b/system/rtc.c @@ -62,7 +62,7 @@ static time_t qemu_ref_timedate(QEMUClockType clock) } break; default: - assert(0); + g_assert_not_reached(); } return value; } From patchwork Thu Sep 12 06:52:27 2024 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: 827786 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1128020wrc; Wed, 11 Sep 2024 23:54:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV9QyWEN39t+VToo7T4rSi/4LFhcAJwIxc6UmCZgi56rhvP6fyYs404Z6Hd/Xogeby+/RwuoQ==@linaro.org X-Google-Smtp-Source: AGHT+IF74YQMLeNbOLimlnCssJu4FTyDgFNftI7LKTOFAfZqFMPArEJSZQSZbRFZjiu3gLuMlEU0 X-Received: by 2002:ac8:5fc2:0:b0:458:2894:984e with SMTP id d75a77b69052e-458602a7489mr28978991cf.3.1726124091038; Wed, 11 Sep 2024 23:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726124091; cv=none; d=google.com; s=arc-20240605; b=ToQFGq+ECdOBbU/7Wytd5skDK72eFVmPyHtoE7NkFWjxTIvuGng8y0sONu3CCHD2o/ C9QmMFyHOST/CFZgNYeH9INSHUxb6eI0/6Q7dKaJznAMWIpyaMRZPevPVMJpXlAZ8/qB 8EKpZGHhsDhCe4KL06n6Ax3JnyB0BamVgl8r8dQ/VEtD1E5nxKulW01z+iMZQ7EdXZXY Ry/KLGxqezCvhoPHxc2427vdSSv1naVRT/CskED8BMjjGw831ZVRtgixo5VPXjRK1Rvq 5bOXxGSqYT/CI46tE/mKddoz13WxsRurfZQJzh/IH4DlGrj+ZAPA9KwTnvGbngP+DHAd D2lQ== 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:to:from :dkim-signature; bh=Z8JlX1hTCmbpuUkyTy+jdA1DfHzPSmi+/XVGPIHJ48I=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=FnyXuUtwmze2ASktr218KdWsjHDgKV4CliF6hlijGqmTAZL5/N6FpF4MH8IMywtN9F p8u+95YnU7s9Im/J01Tz58EYS0O7Tszev+Jmp5qTDk50gv1eYq18llbST7twtT3nx1r1 k88BN3InRPzvnAJ/pWYh6fT9SsAwUpCHDniNCkTrjvEeF3uooanqynd/1U8Bakb76R1B FeAtVY7wNWybzgyDF1dPgqG85u0yBC+l688qkKRmxVDnfQrJydpuXpE/t9qzQi3YtN8I nnjBIKwM9C+bKV7sjA3BLU1uUKMRgNsa19Llvz3kuFM4bIcGX58X2KwuzSZ5OAfb3a2F 43UA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vw3wAXP8; 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 d75a77b69052e-45822e624a7si125671791cf.22.2024.09.11.23.54.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2024 23:54:51 -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=vw3wAXP8; 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 1sodie-0003jZ-PY; Thu, 12 Sep 2024 02:54:20 -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 1sodiA-0001UK-2t for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:52 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sodi6-0003WN-Od for qemu-devel@nongnu.org; Thu, 12 Sep 2024 02:53:48 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-374ca7a10d4so436770f8f.3 for ; Wed, 11 Sep 2024 23:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726124025; x=1726728825; darn=nongnu.org; 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=Z8JlX1hTCmbpuUkyTy+jdA1DfHzPSmi+/XVGPIHJ48I=; b=vw3wAXP8YyzANzqGEgQrOwiwgB31HJpXKWjseKvB6y6bIkQBjfb4EK17i7YFtwXodI 9YMwilQxrFaR+RlaPhoguLtZid9DhRgOmRRMOSG3hsm9IH7/44jhNtvEtO00dMOeRQ0p HzioYey86r0hF7TBeU/FzEVKwxUAyxVtR17IrLBm9ED3sW5rWtwCSxi4EmeA2BtZCUJd XD7diH0F16jGv8NGGQ0JSKFtGxJlSRXhn3CG6Um73awRniignheZqDamBYKNKgPNgik9 YTigqKkQvZ1qy0AWiSKluFyq/uX7b+U0A+4nJgTBP2ttKVJw8691y418+LWb9XOLo2mt AFcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726124025; x=1726728825; 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=Z8JlX1hTCmbpuUkyTy+jdA1DfHzPSmi+/XVGPIHJ48I=; b=JkpsLV8WxxnL0TFoPXaOaFP8/zSxzabgcMzKhduBVUDu5jKx/8bUx2wpoDjg0X7Y4U fKORvjX6nyBs5dIWqvRPX0+TBjEpOSlJdJiq2sdMBslrYiZt7YIbPYoXb/HqdYQaNA3U 4sVuFmfHd1OjPWzsvO9hNaMrHN+J1LcSN5xpTT4KYuGofyVxyFWE5/w3U7E92YFvQSnS CnQFxoiPR/3i7VVeE62g6kGMmI1/GvFEyjcfZnUPOvQ/GRRJEuz7ttjNun26N9RLUIyi JAouCq99mdtu7Azy94K2G5Bw5NI//2VCrzFFsDilGg0iyjomSJhCuub4bLs6NJgLr8UA VdjA== X-Gm-Message-State: AOJu0YxZxvGOKXoaVNmauOix934mCOhg+MPm6+WgCjLMAXf/JVPwp0me Q57c7KxcjriY2WmDWTsAPhpb1r3tIXt+TA1QmZ8QizgR1INrT5zDW6Erw/pVyiVib9P3FGWFCWa a X-Received: by 2002:a05:6000:459f:b0:374:c0c5:3c05 with SMTP id ffacd0b85a97d-378c2d4d802mr923227f8f.42.1726124024412; Wed, 11 Sep 2024 23:53:44 -0700 (PDT) Received: from m1x-phil.lan (mic92-h03-176-184-33-210.dsl.sta.abo.bbox.fr. [176.184.33.210]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378956650fdsm13521670f8f.25.2024.09.11.23.53.43 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Sep 2024 23:53:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL v2 61/61] ui: remove break after g_assert_not_reached() Date: Thu, 12 Sep 2024 08:52:27 +0200 Message-ID: <20240912065227.67848-14-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240912065227.67848-1-philmd@linaro.org> References: <20240912065227.67848-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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 From: Pierrick Bouvier Use of assert(false) can trip spurious control flow warnings from some versions of GCC (i.e. using -fsanitize=thread with gcc-12): error: control reaches end of non-void function [-Werror=return-type] default: g_assert_not_reached(); break; | ^^^^^ Solve that by removing the unreachable 'break' statement, unifying the code base on g_assert_not_reached() instead. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240910221606.1817478-37-pierrick.bouvier@linaro.org> [PMD: Add description suggested by Eric Blake] Signed-off-by: Philippe Mathieu-Daudé --- ui/qemu-pixman.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c index 5ca55dd199..6cada8b45e 100644 --- a/ui/qemu-pixman.c +++ b/ui/qemu-pixman.c @@ -49,7 +49,6 @@ PixelFormat qemu_pixelformat_from_pixman(pixman_format_code_t format) break; default: g_assert_not_reached(); - break; } pf.amax = (1 << pf.abits) - 1;