From patchwork Fri Nov 8 19:47:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 1192119 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=dabbelt.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dabbelt-com.20150623.gappssmtp.com header.i=@dabbelt-com.20150623.gappssmtp.com header.b="Phez6cVA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 478rSj60wMz9sNx for ; Sat, 9 Nov 2019 06:49:25 +1100 (AEDT) Received: from localhost ([::1]:59560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAG2-0000DY-HS for incoming@patchwork.ozlabs.org; Fri, 08 Nov 2019 14:49:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35805) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iTAFC-00009k-5G for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iTAFB-000642-6b for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:30 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:33716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iTAFB-00063b-0n for qemu-devel@nongnu.org; Fri, 08 Nov 2019 14:48:29 -0500 Received: by mail-pf1-x443.google.com with SMTP id c184so5346683pfb.0 for ; Fri, 08 Nov 2019 11:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:cc:from:to; bh=5agNHd9M2bORCVbIGO//JZMZDNyfUZl1bBgI5l6KvTQ=; b=Phez6cVAOAk6qvA3brvUjT0QhoQeK19ixiY6E8EHjShNInxaUAUxVga9N8f+ahKnB4 eZUDjKYVzlgD4hVBUQBW42rgQ7tfX2VLAWVm8gj+M3+9lUr0X+auUBHf+nwNOZKFOr2S TNBLth0FYYYnT5toF+rM/dDsjb5kJdepUsN8lZYHCtXWxWd2+NdyZuPc5/OviT1lWMn/ 0xEge9o7YRi/M7szla8/Qh/VvkaEOAtMewPqwyx/83iGRbuxImvjt8/edortm2heLP43 +MtOo6YPuRppc53pDpXMd+SglAST0/IGjZOOpkTNbFhfdI3uSJ+p/w+9/75c2wDvA/Lx MRJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:cc:from:to; bh=5agNHd9M2bORCVbIGO//JZMZDNyfUZl1bBgI5l6KvTQ=; b=nTP3caUhiUVmZyMp7K+jdF3HPiF/Eo0h0uZXgodVLQagrsMzznYQQNJQHWQb6+8Vfg ySaCuDev69e3r962iK2xmM2jDEJvCMEnOOSkF5Yv/Dv9FH+HylCU1jdM7wTrGab73EvN A9luJr3HqxA7Z5Gs1rrPShrjTuhwqwhCRhmSFfMKJEYBK0zmIK3Bc8UCW7AFq5jYi+q0 drqAQUsMA2HwtYj430TwS5fYgM6Gs1MxTeayx2KfWmoxCOkdTLPVmFYwyr9UNsk8vewp Vq6WOaTxyrjn6uB+wyFmL+AWV6rh48tIwuyozw5irCuhNy8JNL/OjZWv9TU5EX2+wsv3 nJag== X-Gm-Message-State: APjAAAVLzhGZtt0aipbx15mM3493Du4o7CHzAb9PUT7ECwj2/H2FQfJ1 +Sx8xItxTX039MXCv6A1gK0A+w== X-Google-Smtp-Source: APXvYqx89ckaICmNEcPymnIaPzw/La0DkOPJLAUZIE+RBy/lpguEOtXGyUt3wXoJKDiajjs6+Ikk0A== X-Received: by 2002:a63:7887:: with SMTP id t129mr13976804pgc.144.1573242507720; Fri, 08 Nov 2019 11:48:27 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id r68sm7456977pfr.78.2019.11.08.11.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 11:48:26 -0800 (PST) Subject: [PATCH v2 2/3] ARM/virt: Use fdt_setprop_strings() Date: Fri, 8 Nov 2019 11:47:57 -0800 Message-Id: <20191108194758.17813-3-palmer@dabbelt.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191108194758.17813-1-palmer@dabbelt.com> References: <20191108194758.17813-1-palmer@dabbelt.com> MIME-Version: 1.0 From: Palmer Dabbelt To: Peter Maydell , Alistair Francis , qemu-devel@nongnu.org, david@gibson.dropbear.id.au X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Palmer Dabbelt , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This new helper function encodes the idiom used by the ARM virt board to set a string array. I don't currently have a working ARM userspace, so I haven't tested this, but I made the helper function because I wanted to use it for the RISC-V virt board where I have tested it. Signed-off-by: Palmer Dabbelt --- hw/arm/virt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index d4bedc2607..4dc00f54d5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -304,9 +304,8 @@ static void fdt_add_timer_nodes(const VirtMachineState *vms) armcpu = ARM_CPU(qemu_get_cpu(0)); if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { - const char compat[] = "arm,armv8-timer\0arm,armv7-timer"; - qemu_fdt_setprop(vms->fdt, "/timer", "compatible", - compat, sizeof(compat)); + qemu_fdt_setprop_strings(vms->fdt, "/timer", "compatible", + "arm,armv8-timer\0arm,armv7-timer\0"); } else { qemu_fdt_setprop_string(vms->fdt, "/timer", "compatible", "arm,armv7-timer");