From patchwork Fri Apr 12 07:33:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 788262 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp591110wrm; Fri, 12 Apr 2024 00:36:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV0DDHNU2+XZQmkrVtbNMgWt6Ev71yPHSrdnibpnDOa6V6C7JQlKksgSw0ZBv7JftJoG2HqtqqOeQ9UcC375WNr X-Google-Smtp-Source: AGHT+IFYNcjCtEzeOF09bYfw7n4Y+w1cVGetW6zPbqHeCX7OzkK86+WWFHV0fW90rVpSbtyhmf4D X-Received: by 2002:a05:690c:1c:b0:618:822a:e69a with SMTP id bc28-20020a05690c001c00b00618822ae69amr891063ywb.9.1712907395312; Fri, 12 Apr 2024 00:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712907395; cv=none; d=google.com; s=arc-20160816; b=lq/sawX+AH7fnmeU2BobRwcNJ7mEkP3/Y3sZnx0o7RyuGrzklblwz0VmzC80Khpjei brHi9EKrq4nKNM5qYzWB/E0TBIKFgvznEhrIwLreLGfZRqz8cudUnO+JO5J7NeNLx69D sn85t0tz2OdNQy9O5iLyzwVZu3GPzheLlU7KD3DGiZFsLSBycrjTm/DBe4XQSiydkpbW A1XnfWl1+CenAuRSgSeFCrPTcE6I4SsFtXiueou0QuGBw2Rv9kIuzh4BzRmjronzqO+r fV8W0j6U1/MVI0YtB9ZHQ0eUjuKeTen3dOROwaSAdo7f3KNROg9z7QYeCVas9+hax0sy nHSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Yt7XTd0PVkVIabRbeCb1YqLB6pmup83tW4MV6eKsa+A=; fh=XWTD8Z9WAMjh+M8BxQj8k30uAZD5B0T9z1nl1AeO1vA=; b=hsAgVRloS4zXfwjCaJRoxm+GQg7LFlA9pTA50Ai+4Ii9JXM/oX6sUu2Eoqn5uAtu4u cTDJgjIKPNgr9HGEIvw4pGnBRVdf0COlQVOxPyc7I4R++nC9jbGvfXswJp5KtMojZqzG VATPPQ2jjUclyhDamQZNiMgC79Ce5W/IQPpWXa7BGgPWSpW4EOLUGcbagDqfrDKpOaLZ PCh4Yml/O1IlKTIxlUxGPUXQWJYksvdwKj7NS0ZYyan25Jm91uXo9LeOvUSnLXJVe10v 8XoGVTTyQbwEzNRSEnL1o6kN7yc9gMTg3P65p4MUJPI0VPGUBbs/5dh/Df6HX3/Zdk/c ZIzA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VHio1MKA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bk37-20020a05620a1a2500b0078d6349929dsi3555881qkb.458.2024.04.12.00.36.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Apr 2024 00:36:35 -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=VHio1MKA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvBQN-00076D-Pm; Fri, 12 Apr 2024 03:34: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 1rvBQJ-00074k-Et for qemu-devel@nongnu.org; Fri, 12 Apr 2024 03:34:11 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rvBQF-0007D3-DV for qemu-devel@nongnu.org; Fri, 12 Apr 2024 03:34:09 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1e3cf5b171eso5656715ad.0 for ; Fri, 12 Apr 2024 00:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712907246; x=1713512046; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Yt7XTd0PVkVIabRbeCb1YqLB6pmup83tW4MV6eKsa+A=; b=VHio1MKAPNeHvgol8km1xhIArWWaWECtb38vXpWymSJsrkFWe/vPWgbed1WmHv+7pl X5g92+qaFIhzCabPh9CC74SvhK1Pegae2GuZA65vAi4E7Qy4lMGxpk0NaeOeZ6dAvNz6 ewU0l2eudYVDUrOGHItGX0pLgVxZ9Gr1X/X+l4xs/UtKruO4R4vWgoaVIRu3lf5PAwox NlDV5hlTAMud5P3cHaX7TwFoAoj3YtSS/I3wiXpnv67Eac/5RXKblb3go3cRxeumeM8E U7IFXgXRrR3PqWTdlQLm1VDIpFzskm9wQDe5K3OlKAUijDcZEQ9JN8MRxA6i+E9WHfCR VwOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712907246; x=1713512046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Yt7XTd0PVkVIabRbeCb1YqLB6pmup83tW4MV6eKsa+A=; b=Fw3ZORSuFV0D3WtvxTFH1dNlpGip+CHLsrxU1OwLURivoHJCAnU2/2JgXcg/jzTeyy 5ies9edKA9cIh+9TSJ7RiX7Am5OTvQtWM7/gA/mxOQSFDi/46i7kmgv5M7ES7q/ICaDt aNksF66jsnGEimeQr810BaH5zdx2bf9jlvX+O9ctACUFRWqSMahkSxpkQq/Q4nJhIWpw ylzulcsGJlDfNpR9DkvRlsFCAG1GSsN35j/YpGdY52ldzLgs642kWDfjJw2w15fhD6KU DaqFPhSwWgH/k0YR/fVHMvJRyl7Uw1AAyjSLRnDTrB4mRmUGXHVIaUGrueo0re9o9piC ydYw== X-Gm-Message-State: AOJu0YxVbCoQcoOhsMIA9ekUF2gitc4AecQsUNMzNBcF8104TJk1IkGo Likpc6sVvb5w0kfNf5Hu9ayAWlQn/+LMBqEICNYlflWZDMDF8mQrGLKL9uRBqw9n6sb3RB8f24m W X-Received: by 2002:a17:902:ebc4:b0:1e2:96d3:1bc1 with SMTP id p4-20020a170902ebc400b001e296d31bc1mr2001016plg.1.1712907245985; Fri, 12 Apr 2024 00:34:05 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id e5-20020a17090301c500b001e556734814sm2206099plh.134.2024.04.12.00.34.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 00:34:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH v3 23/27] hw/misc/imx: Replace sprintf() by snprintf() Date: Fri, 12 Apr 2024 00:33:42 -0700 Message-Id: <20240412073346.458116-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240412073346.458116-1-richard.henderson@linaro.org> References: <20240412073346.458116-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: Philippe Mathieu-Daudé sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Message-Id: <20240411104340.6617-6-philmd@linaro.org> Signed-off-by: Richard Henderson --- hw/misc/imx25_ccm.c | 2 +- hw/misc/imx31_ccm.c | 2 +- hw/misc/imx6_ccm.c | 4 ++-- hw/misc/imx6_src.c | 2 +- hw/misc/imx6ul_ccm.c | 4 ++-- hw/misc/imx7_src.c | 2 +- hw/net/imx_fec.c | 2 +- hw/ssi/imx_spi.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/misc/imx25_ccm.c b/hw/misc/imx25_ccm.c index d888966014..faa726a86a 100644 --- a/hw/misc/imx25_ccm.c +++ b/hw/misc/imx25_ccm.c @@ -91,7 +91,7 @@ static const char *imx25_ccm_reg_name(uint32_t reg) case IMX25_CCM_LPIMR1_REG: return "lpimr1"; default: - sprintf(unknown, "[%u ?]", reg); + snprintf(unknown, sizeof(unknown), "[%u ?]", reg); return unknown; } } diff --git a/hw/misc/imx31_ccm.c b/hw/misc/imx31_ccm.c index a9059bb1f7..125d4fceeb 100644 --- a/hw/misc/imx31_ccm.c +++ b/hw/misc/imx31_ccm.c @@ -89,7 +89,7 @@ static const char *imx31_ccm_reg_name(uint32_t reg) case IMX31_CCM_PDR2_REG: return "PDR2"; default: - sprintf(unknown, "[%u ?]", reg); + snprintf(unknown, sizeof(unknown), "[%u ?]", reg); return unknown; } } diff --git a/hw/misc/imx6_ccm.c b/hw/misc/imx6_ccm.c index 56489d8b57..b1def7f05b 100644 --- a/hw/misc/imx6_ccm.c +++ b/hw/misc/imx6_ccm.c @@ -85,7 +85,7 @@ static const char *imx6_ccm_reg_name(uint32_t reg) case CCM_CMEOR: return "CMEOR"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } @@ -224,7 +224,7 @@ static const char *imx6_analog_reg_name(uint32_t reg) case USB_ANALOG_DIGPROG: return "USB_ANALOG_DIGPROG"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx6_src.c b/hw/misc/imx6_src.c index 0c6003559f..3766bdf561 100644 --- a/hw/misc/imx6_src.c +++ b/hw/misc/imx6_src.c @@ -68,7 +68,7 @@ static const char *imx6_src_reg_name(uint32_t reg) case SRC_GPR10: return "SRC_GPR10"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx6ul_ccm.c b/hw/misc/imx6ul_ccm.c index bbc0be9921..0ac49ea34b 100644 --- a/hw/misc/imx6ul_ccm.c +++ b/hw/misc/imx6ul_ccm.c @@ -143,7 +143,7 @@ static const char *imx6ul_ccm_reg_name(uint32_t reg) case CCM_CMEOR: return "CMEOR"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } @@ -274,7 +274,7 @@ static const char *imx6ul_analog_reg_name(uint32_t reg) case USB_ANALOG_DIGPROG: return "USB_ANALOG_DIGPROG"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/misc/imx7_src.c b/hw/misc/imx7_src.c index b3725ff6e7..d19f0450d4 100644 --- a/hw/misc/imx7_src.c +++ b/hw/misc/imx7_src.c @@ -75,7 +75,7 @@ static const char *imx7_src_reg_name(uint32_t reg) case SRC_GPR10: return "SRC_GPR10"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } } diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index cee84af7ba..8c91d20d44 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -41,7 +41,7 @@ static const char *imx_default_reg_name(IMXFECState *s, uint32_t index) { static char tmp[20]; - sprintf(tmp, "index %d", index); + snprintf(tmp, sizeof(tmp), "index %d", index); return tmp; } diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c index d8a7583ff3..12d897d306 100644 --- a/hw/ssi/imx_spi.c +++ b/hw/ssi/imx_spi.c @@ -53,7 +53,7 @@ static const char *imx_spi_reg_name(uint32_t reg) case ECSPI_MSGDATA: return "ECSPI_MSGDATA"; default: - sprintf(unknown, "%u ?", reg); + snprintf(unknown, sizeof(unknown), "%u ?", reg); return unknown; } }