[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/15] x86/hyperlaunch: add domain id parsing to domain config
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 19 Dec 2024 11:40:49 -0500
- Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734626454; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=Lxg3CIzptPf8GHQ8oRlHduu2/DUaDOMWS4If8u1uJHA=; b=cYcyucBv9vDG+FJNimq0cBpV87jt7UvhG7PY6601J1pjerTfMj2HZ9Bpdk7MzugYrFwkIYWApm63wvaVryH1UIMwKmA8PY2li+Z//OsEEZj0YB86Mwu7ztOAct2YAsbi+seugUP9K0oj6SzWYPOngh2Ka2EurgQFtFEC52+rFlc=
- Arc-seal: i=1; a=rsa-sha256; t=1734626454; cv=none; d=zohomail.com; s=zohoarc; b=U5wZMZ0g/SdwI6yvxHda0QHqJbSglH/zuv6+Q1qmiNz5rtp8uQXotyvg5NB67cr/v8ZcHPMfJUtMlSH1Qm7juM1REvwDoI3nShCgwuGvzjqcIwrsvZYYbV+GBCw8fVURnBuDkMog1kgnEpfGU7l/VScm/7KF74lwtwmNdqt2Xdw=
- Cc: jason.andryuk@xxxxxxx, christopher.w.clark@xxxxxxxxx, stefano.stabellini@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 19 Dec 2024 16:41:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 12/11/24 11:21, Daniel P. Smith wrote:
On 12/2/24 07:02, Jan Beulich wrote:
On 23.11.2024 19:20, Daniel P. Smith wrote:
--- a/xen/arch/x86/domain_builder/fdt.h
+++ b/xen/arch/x86/domain_builder/fdt.h
@@ -27,6 +27,24 @@ static inline int __init fdt_cell_as_u64(const
fdt32_t *cell, uint64_t *val)
return 0;
}
+static inline int __init fdt_prop_as_u32(
+ const struct fdt_property *prop, uint32_t *val)
+{
+ if ( !prop || fdt32_to_cpu(prop->len) < sizeof(u32) )
+ return -EINVAL;
+
+ return fdt_cell_as_u32((fdt32_t *)prop->data, val);
+}
+
+static inline bool __init match_fdt_property(
+ const void *fdt, const struct fdt_property *prop, const char *s)
+{
+ int slen, len = strlen(s);
Plain int isn't quite appropriate for strlen()'s return. It doesn't
strictly
need to be size_t, but it should be at least unsigned int.
Ack.
I wanted to reply back on this one before posting the next version. By
implementing Jason's recommendation to unroll this function, the
strlen() call goes away and slen becomes name_len. But name_len remains
plain int to align with the fdt_get_string() parameter type.
v/r,
dps
|