Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp503918lqo; Thu, 16 May 2024 12:25:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVdScxosaXfPhPJ6RlinV0j9BcT7rN1iSFV5cG30u4UNKMyYV/24vYFFIMCdXJI3x6zX6G7R6tbmZMBAuhLQfmOWAfYbIBrmvPIfqN6VA== X-Google-Smtp-Source: AGHT+IGQalPwoWpXiZKv4k7Ef1zxh7J7GZQJGqipcjbAjDv3VDnEIk8xiTMUCXLFIUz7ubDQ45k7 X-Received: by 2002:a05:6a20:9783:b0:1ae:4266:b39c with SMTP id adf61e73a8af0-1afd1444f67mr27947511637.17.1715887521374; Thu, 16 May 2024 12:25:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715887521; cv=pass; d=google.com; s=arc-20160816; b=0idSxBnjLQBnaZreyVHmW9vsEc+VaXXn6Vaf9WTZB+GCyYEKCAeeyFif4yHVv04L/s PkrdQaX0i7l11P4zI12Iq2N0WpMwaXFSAxOmhDHCfBa2HtVdpooHwXo0iXrWIqi9r+9u qiLJY5USnVszQWU+Lax0ZAXAgc/p0wOdtfWjCsBQqCJzXCOgJuOIenTQ0LtJI6P+0Xtr k5/mI+rrq3+3cesElP+uu+n0bTaoQhWU71l5d2BsrFKPMo1opb4OkebAiH6wLCFlfW4Y lT/BEC6qbH2RDDtjqf0ZrJ4+9OKNHUazsdkgbWSFpv4XoVqc66dwjyJ4FHJ6DQWYc13T wQ3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SlAafPKrZ/klEmNYXl2TJjHIbtqsyFs7FtP+G4kmq8Y=; fh=DGE/Rt7UZyKJ8ICVIgmeDLsrdvw5JULr/fcEfbQDVFQ=; b=qdc0aJ9moKMY6YjQ29lETB0bjXO19rUlKrvzflBzJniMPrFEPXftshqJzvuaQtmuxW BoLp1h/KwVe28lnqZ1Hw3j4syXGAP3q0++wlpk9djVGpBvv4Cc1MmeO68fy2jjj5sF8f kObubzp+dvNWNxgD380/7zFz6UkJ5ad8/CHX9qLgmVuRXd9Pnj7iO+g758811S3v1zyJ if9m8Df/h6eSxt31bVzPBuoQmuIi8FI2yaM4XYCKhIfpZwpP2eQoiPZ0d6N+Xkb10PQA n1Ldgs6GQYfY6YGCINEWljdOTByMQAwS5emgD3TPkmptLAGJ0m7UEiSo9YqPoJ1MIL1d lpdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=mYcMPAKw; arc=pass (i=1 spf=pass spfdomain=cisco.com dkim=pass dkdomain=cisco.com dmarc=pass fromdomain=cisco.com); spf=pass (google.com: domain of linux-kernel+bounces-181506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181506-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cisco.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63411530655si16151039a12.501.2024.05.16.12.25.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 12:25:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=mYcMPAKw; arc=pass (i=1 spf=pass spfdomain=cisco.com dkim=pass dkdomain=cisco.com dmarc=pass fromdomain=cisco.com); spf=pass (google.com: domain of linux-kernel+bounces-181506-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181506-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cisco.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 017E0285704 for ; Thu, 16 May 2024 19:08:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 430CB15B99D; Thu, 16 May 2024 19:05:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cisco.com header.i=@cisco.com header.b="mYcMPAKw" Received: from aer-iport-5.cisco.com (aer-iport-5.cisco.com [173.38.203.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E57B915B0F2; Thu, 16 May 2024 19:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.38.203.67 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715886317; cv=none; b=snrNU6CIiP/ytC4MvhBsT+a8YNBhYa7rYhw4ZUBopv1ovI3ZbsVM5cvG8xGwCpiZIGhkIhjqtlpzJC7xswXIPxYff/22+AsYTGp4WdVZabyMOeBPcmy8lLI9bkzLdP6M7USHFHnLL10G17UZnMW7GDJjGq47IdOxpDfdF04wtf8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715886317; c=relaxed/simple; bh=Un26QMeCw3vpFkkSsLB4y9SsB1DGWGmNJr9wdtwpPVQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UjL9jJK2JjmR9f4kgAgk6w98sd5TckV48N1siAXxD0IhfuZArksXv83NmAup2Q0rtUJQvxEy+8i9mW66fmEA1Xqv7FYtczQr3c3/QdHwHlHbGIGRpbywmmBMXDTxy+2G/umYDgPZFRC3sHpUDmEFEXUozdzIYfYzO8ATl8VEaNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cisco.com; spf=pass smtp.mailfrom=cisco.com; dkim=pass (1024-bit key) header.d=cisco.com header.i=@cisco.com header.b=mYcMPAKw; arc=none smtp.client-ip=173.38.203.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=cisco.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cisco.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; i=@cisco.com; l=1219; q=dns/txt; s=iport; t=1715886315; x=1717095915; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SlAafPKrZ/klEmNYXl2TJjHIbtqsyFs7FtP+G4kmq8Y=; b=mYcMPAKwwJlGcEQNSMU6KA5ZwDJmJ2lq2+s45UilNjBjLK77MxSL805i 4KueADQpyDr59etEGd9iDD2kR4dfsxiZFY7fgykQRmgFU8E8cbewcRkM0 d8r0TVreUkI+5Ovlz0KdvcabYZt9Lt3P/8IukJ/4zFsL9LDaLUvhX9UF/ A=; X-CSE-ConnectionGUID: S1hSJNSaTp6Q9UX5slpTsA== X-CSE-MsgGUID: R3iLQmPOQvSxEe8c+vp2gw== X-IronPort-AV: E=Sophos;i="6.08,165,1712620800"; d="scan'208";a="9839850" Received: from aer-iport-nat.cisco.com (HELO aer-core-4.cisco.com) ([173.38.203.22]) by aer-iport-5.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2024 19:04:11 +0000 Received: from localhost (ams3-vpn-dhcp4879.cisco.com [10.61.83.14]) (authenticated bits=0) by aer-core-4.cisco.com (8.15.2/8.15.2) with ESMTPSA id 44GJ4AsO006132 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 May 2024 19:04:11 GMT From: Ariel Miculas To: rust-for-linux@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, tycho@tycho.pizza, brauner@kernel.org, viro@zeniv.linux.org.uk, ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com, shallyn@cisco.com, Ariel Miculas Subject: [RFC PATCH v3 08/22] rust: capnp: return an error when trying to display floating point values Date: Thu, 16 May 2024 22:03:31 +0300 Message-Id: <20240516190345.957477-9-amiculas@cisco.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240516190345.957477-1-amiculas@cisco.com> References: <20240516190345.957477-1-amiculas@cisco.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-User: amiculas@cisco.com X-Outbound-SMTP-Client: 10.61.83.14, ams3-vpn-dhcp4879.cisco.com X-Outbound-Node: aer-core-4.cisco.com The kernel doesn't support floating point values, so return an error when the kernel feature is enabled. Signed-off-by: Ariel Miculas --- rust/capnp/stringify.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/capnp/stringify.rs b/rust/capnp/stringify.rs index 426025fea0e8..f93e3521ce0b 100644 --- a/rust/capnp/stringify.rs +++ b/rust/capnp/stringify.rs @@ -71,8 +71,12 @@ pub(crate) fn print( dynamic_value::Reader::UInt16(x) => formatter.write_fmt(format_args!("{x}")), dynamic_value::Reader::UInt32(x) => formatter.write_fmt(format_args!("{x}")), dynamic_value::Reader::UInt64(x) => formatter.write_fmt(format_args!("{x}")), + #[cfg(not(feature = "kernel"))] dynamic_value::Reader::Float32(x) => formatter.write_fmt(format_args!("{x}")), + #[cfg(not(feature = "kernel"))] dynamic_value::Reader::Float64(x) => formatter.write_fmt(format_args!("{x}")), + #[cfg(feature = "kernel")] + dynamic_value::Reader::Float32(_) | dynamic_value::Reader::Float64(_) => Err(fmt::Error), dynamic_value::Reader::Enum(e) => match cvt(e.get_enumerant())? { Some(enumerant) => { formatter.write_str(cvt(cvt(enumerant.get_proto().get_name())?.to_str())?) -- 2.34.1