From: Peter Krempa Date: Wed, 24 Jan 2024 14:24:27 +0000 (+0100) Subject: virPCIVPDResourceIsValidTextValue: Adjust comment to reflect actual code X-Git-Tag: v10.1.0-rc1~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42df6cc1b4acc40d05ff6bc8e85587e4faec6cac;p=thirdparty%2Flibvirt.git virPCIVPDResourceIsValidTextValue: Adjust comment to reflect actual code The function does not reject '&', '<', '>' contrary to what it actually states. Move and adjust the comment. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c index 39557c7347..248a9b2790 100644 --- a/src/util/virpcivpd.c +++ b/src/util/virpcivpd.c @@ -167,19 +167,15 @@ virPCIVPDResourceGetFieldValueFormat(const char *keyword) * value or text field value. The expectations are based on the keywords specified * in relevant sections of PCI(e) specifications * ("I.3. VPD Definitions" in PCI specs, "6.28.1 VPD Format" PCIe 4.0). + * + * The PCI(e) specs mention alphanumeric characters when talking about text fields + * and the string resource but also include spaces and dashes in the provided example. + * Dots, commas, equal signs have also been observed in values used by major device vendors. */ bool virPCIVPDResourceIsValidTextValue(const char *value) { size_t i = 0; - /* - * The PCI(e) specs mention alphanumeric characters when talking about text fields - * and the string resource but also include spaces and dashes in the provided example. - * Dots, commas, equal signs have also been observed in values used by major device vendors. - * The specs do not specify a full set of allowed code points and for Libvirt it is important - * to keep values in the ranges allowed within XML elements (mainly excluding less-than, - * greater-than and ampersand). - */ if (value == NULL) return false;