From patchwork Wed Apr 10 16:06:03 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: 1922145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=GVIQLZUf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VF7CM3VfKz1yYB for ; Thu, 11 Apr 2024 02:12:47 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruaTP-0000OL-P0; Wed, 10 Apr 2024 12:06:56 -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 1ruaT9-0000BS-Hq for qemu-ppc@nongnu.org; Wed, 10 Apr 2024 12:06:41 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruaT2-0002bv-J1 for qemu-ppc@nongnu.org; Wed, 10 Apr 2024 12:06:37 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-56e47843cc7so4343279a12.0 for ; Wed, 10 Apr 2024 09:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712765189; x=1713369989; 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=LDZo3IQYGRSUjwFMJgZFbdPKp1+CCXvSyhVLfSqq00c=; b=GVIQLZUfYb5YWk3EaBhzF41rlxWxBYtLa3btodEuOi8AnkW33w6CWn9t0kCSe3WwPI byC6IHn6hHHuJJXxhSsJZQsgJcPUDaafqUdPd+5SGZYZj4w7n3Une4Ji4XVLJgcJRo5J i/zJI1eh9GE1RoYLzGvz3Xg/uumKUZMGPJHecZdOi29L7C36VJG9Sa85i7PEEngRfaF4 s+SmuQzmteLVH122xlFEfz5c/TWIAGKss2yXCagKVrTkqqMDMjPQRNz85D05sQxBLIpv FUlObDXf06wavEINCpNICd/SE0Gi/4t5w8F4B53op5ZRl1jTqFqrpSq/6/0TgWp2AFKp ddRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712765189; x=1713369989; 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=LDZo3IQYGRSUjwFMJgZFbdPKp1+CCXvSyhVLfSqq00c=; b=PKmW3imb6Acm0ArSbeI/Qo3eQeGsVkOi81iPgZpimhvHpOFVzBIvbP4+3pXeOJ8bKO C+4y5H/vfKtxCQppiDsATuAGegEGsb6hrQr8Q1ZEppFi4QEoZ8IrpG+24U1a1zyz+gDg prMei4IlqqV/MyhX2QcEi1zNmh8A74iJY4hjspbmjsyZOPYeRmlenshVkZPux29u5ufn ou6Iytk621nDbo1p00guX4MmZw/qHs+URwy2uZG0A8iKABhppFvuDyvLj8FQMpKjzzZT E+r6kUUCLFzJV8OTpa81c+oOIrsuEr+7gIOtqcBY4P2mmtOM8JidBmIRBZXBv6bSx3i3 9h3A== X-Gm-Message-State: AOJu0YxUxxrkzQKdemDtLnoT9ORsHkcV+fLI4yX6Babm8bDG8bwVmJg3 whXzxqQ1sHepsaleTzbtAjp4vQYMRdTR0zuBoUJ5S9OyYVnPmVCMhlcNHNQ5Exg= X-Google-Smtp-Source: AGHT+IGrN0AGW8T694ISVr1qvtMzErPe2EDhLVU80NuaT77Fsg9gwCuOBJZRefQxXLlJO/qZoWbFQA== X-Received: by 2002:a50:bb07:0:b0:566:47ee:b8b4 with SMTP id y7-20020a50bb07000000b0056647eeb8b4mr1995538ede.17.1712765189165; Wed, 10 Apr 2024 09:06:29 -0700 (PDT) Received: from m1x-phil.lan (arl95-h02-176-184-34-173.dsl.sta.abo.bbox.fr. [176.184.34.173]) by smtp.gmail.com with ESMTPSA id by15-20020a0564021b0f00b0056e591bb644sm4078733edb.45.2024.04.10.09.06.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Apr 2024 09:06:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= Subject: [PATCH 02/12] hw/vfio/pci: Replace sprintf() by g_strdup_printf() Date: Wed, 10 Apr 2024 18:06:03 +0200 Message-ID: <20240410160614.90627-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240410160614.90627-1-philmd@linaro.org> References: <20240410160614.90627-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use g_strdup_printf() instead. Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/pci.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 64780d1b79..cc3cc89122 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2442,10 +2442,9 @@ void vfio_pci_post_reset(VFIOPCIDevice *vdev) bool vfio_pci_host_match(PCIHostDeviceAddress *addr, const char *name) { - char tmp[13]; - - sprintf(tmp, "%04x:%02x:%02x.%1x", addr->domain, - addr->bus, addr->slot, addr->function); + g_autofree char *tmp = g_strdup_printf("%04x:%02x:%02x.%1x", + addr->domain, addr->bus, + addr->slot, addr->function); return (strcmp(tmp, name) == 0); }