From patchwork Fri Mar 5 20:12:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1448196 X-Patchwork-Delegate: trini@ti.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=secospa.onmicrosoft.com header.i=@secospa.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-secospa-onmicrosoft-com header.b=IYtMKioJ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dsf7f4ymPz9sVS for ; Sat, 6 Mar 2021 07:13:34 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1144682748; Fri, 5 Mar 2021 21:13:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=secospa.onmicrosoft.com header.i=@secospa.onmicrosoft.com header.b="IYtMKioJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E28AD826CA; Fri, 5 Mar 2021 21:12:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on061e.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::61e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DA3DC826B2 for ; Fri, 5 Mar 2021 21:12:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=seco.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sean.anderson@seco.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P6Ye/C080aR9aqCzq6ICuafuI9tlypfyswOC7T9dg+jUK6J8jKNFjaaGRzidjbmcdQe0UcPvoxPzzxdwZHESh6Onnx/KC7meNTzzIr31BRnW+Uno2Q/nLwnGsbGlDYTLOUXltKIrCA92yqOhYgASwQz8yW5u+YTA1+alr5zgmogeSFMHXT03C3DlzrmJQIHeCoUhKkUPoj7HzCyL3HCdpiv4g3iMnfCcdQshYpfIpQIYmHDkE0F+RLvkvJ9R/lAYTbkzJBKBsPVGVCZuoPSSmaWJcAENFz6/R5nYuUn5BOkIIsQ+Ak06JHowMP8aOV16/33I9UfPwcGqkWQNsDmq+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=USqIFY9GkscJJj02o5SwMIL+TorUaFPk8Uo/sS4m7r4=; b=df1lmtMwG9zjhzzixWtp0aZ+gmtcIIkptqlU4xztb+BzOmi3j1BrFNMoxPmUWkaDROOISsqE/wa7qaGGYpXOVvD7N7WX8+Re3yzU4B4T7a+kITwzGnwFeMt+Cni+TybKDINMqKSkz8/drPPSViHJp7MsdzYc4eJLlBQ1Jxxq7o88Duk0eFHwdW0zZqy5yIIafq0exyHNg/qxPA8ekaRXUNZTz8DzOuirLYBLiifNmtXtCVpPeyMWdDCY7Km1CxxtgqcN0p4AVbSIk8enN4wXfFCIgwUS037x8sg0xFaOrnHUeo3Ioj2dxVhCNiGTPi/hyCKtuyCMld+7/uFr8wJPOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=USqIFY9GkscJJj02o5SwMIL+TorUaFPk8Uo/sS4m7r4=; b=IYtMKioJryIMtfeCeOmkFOlwBADQIYfNkVALxGVNK0aScpgc9zoEn6LatxFJ+Jg0DbamOt2747UqJi2+5zczgemATTaWZ5hbHSo1ml4cOLC3WC17c0t5d16eMTveh+P27Nkm/L6Hy9d/GJ3+tekMUPin7pgUybXbjOWVdglSHm4= Authentication-Results: chromium.org; dkim=none (message not signed) header.d=none;chromium.org; dmarc=none action=none header.from=seco.com; Received: from AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) by AM0PR03MB4338.eurprd03.prod.outlook.com (2603:10a6:208:c3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Fri, 5 Mar 2021 20:12:44 +0000 Received: from AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::439:40f3:673f:f32e]) by AM0PR03MB4514.eurprd03.prod.outlook.com ([fe80::439:40f3:673f:f32e%7]) with mapi id 15.20.3890.034; Fri, 5 Mar 2021 20:12:44 +0000 From: Sean Anderson To: Simon Glass , u-boot@lists.denx.de Cc: Sean Anderson , Alexandru Gagniuc , Bin Meng , Dario Binacchi , Marek Vasut , Michal Simek , Philippe Reynes , Reuben Dowle , Samuel Holland , Ye Li Subject: [PATCH v2 3/5] sysinfo: Require that sysinfo_detect be called before other methods Date: Fri, 5 Mar 2021 15:12:23 -0500 Message-Id: <20210305201225.3753841-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201225.3753841-1-sean.anderson@seco.com> References: <20210305201225.3753841-1-sean.anderson@seco.com> X-Originating-IP: [50.195.82.171] X-ClientProxiedBy: BL1PR13CA0258.namprd13.prod.outlook.com (2603:10b6:208:2ba::23) To AM0PR03MB4514.eurprd03.prod.outlook.com (2603:10a6:208:d0::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from plantagenet.inhand.com (50.195.82.171) by BL1PR13CA0258.namprd13.prod.outlook.com (2603:10b6:208:2ba::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.10 via Frontend Transport; Fri, 5 Mar 2021 20:12:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4cf08c4-9237-4557-3206-08d8e0130974 X-MS-TrafficTypeDiagnostic: AM0PR03MB4338: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xmVjiHxkgKZUWtrvTB6RVEM5W9eNZJdqkJHS1eLiZBk41zcstHYhNJT22gHayjTDXIMz+yoySNUauIUNIOcE71zRLWdu11mZPUYH1L3sVwUZkQxk/TOZd/sp7PF15tnFLapQNplc5tM+KOV7bx4y5FTwrZQOM54ElaE6bYdIB0kDf5FnjvelkJqc+wDV1r0PsQONwfNvl0Dr4hAm0hKx1LPYyDR/DfYQgw8REVwA1w0Wl2QAiPewEs2MlXYjmZFuUHE2PqZvAJGCqdZiYc6Jp+RcCMRyR0HPyCbt4/gOY/aZLCJ6IKsFnqfsGIXYve3OqNGpm6+y9U4KXv9+exekl/DXdSCNYr0dOgex7r+P1Ho2KI3PyIlApeL6/2p1ogRLuuD+XFT7V4UUEyNU/x96xvYK6FxJo4Dawer6Tx1Rj+mTmhI6y9A9EjjTTquSBhu4sHZlO1+CfTzHaw/nTxqt9jocpaguJ0LspN47nWgrP5y51uHZoo3S7uGlQSPLPyh3oDQG03gxgIE4bNoOLkV2rg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR03MB4514.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(39840400004)(136003)(346002)(396003)(366004)(6512007)(6506007)(66946007)(5660300002)(66556008)(52116002)(8676002)(6666004)(2616005)(83380400001)(16526019)(7416002)(186003)(36756003)(956004)(1076003)(66476007)(86362001)(44832011)(316002)(26005)(2906002)(4326008)(54906003)(6486002)(8936002)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: GKOr8Co0FT86a6Sz1789T5eG/rafx/Vvzvwi8JUWkT9+PqifZEeJrkEjQ1yl6Du71fEN8bKpI9mPxnPvpnLWB8u2bvsSJMBDa1BD/e0POe/Q069st57XRPb0HPdlnJ8z9q7xtXSojQs6PC6NP+b0fDooShqHzOaAl+/Ih3HEpTFiBgR51T54WJ05hT0WLLifZqehY83UcYQ8LOU3r/EsfZTZIW/gS+vORDeySTnG/VyH2W2GghHvwLscc6FB0h9fQFYNzf7CXJ8d7p6uLMJq/HhDDJmFtBWwxNlzW+TOvBPXDjYeDELYk7Z4JivhyJtxowDOpLLdmDxVw+NqGu0MYFa7OvMK8BZ/U/+QPP054xCefMAPydw4pnPnXC3A1VTg/YGyshJbsFcJXaHUXx/MiFSLVgtlZt+ysx5GMe+L7e90q+rLQYXkq6sKUfAoDnqd+4JzjTO+b0nwI56b6UypfVwqW8fDupAQHxMvm83lRN65vrvTe9jrL6YnOrkGxkfx1PfvdhyWEUqfblsgvHFzkrFvmvzTRlM5dw5PRlPI+rlzTE2ob8dOI/UHRF7TCvz0+k0Rk6gmQf2gKCwzf+K2NaDh2N1nLkEAR96JErDYaiCBeUUjtUGmAce93W4op1vks0GVnTsdrbyYH26TM1QO6yAmiM73FZHaq/RE/s7B9h4QaFyQTvP7j1Tpk1BXkx0bfj0QdARMW2yiMIeTvM8QV9nQXnvddkAV1XP5U05tvPUYsXkXbm1lYYjKpiaU9YXbTwLiSHjfi+z98+c6HtWbcsxN/s5Gbzc2hS6wnYjKPmOOcmxXCIAmtIXkrwDur11miwSVKpfMKzoXNwNkb9H3l7wYTHG2IL5zMBSCSZ/0jJASKbnyW2CtdIuHJ0dwU0W1QTeTb5P8Neys2lOlydFL7ejpGXCeYwzZXEk56ixllWjYRTGrGADSmDfxrX2F5hTvKaMkWcEDd9L5hDHQCmJzKdutmAhnPB+7/UELJzjrDLN7pX/erAHfjJa3RLt4S5BzvMKU6/WVYRVLKGECevApBDhmAKQL0FLqjz4w6XV0M8fyqgjkhT6MphNVKFblz/mqb0nBBbAonUKPqn9AabXGA0W4MxHrGxP2m78mpToMWi3kr+IY+UNQOCtEsPlfq/FWcHY6yraRESMHdGqBT35C3az1/bDDfkgQco9nBqieleNcrdqmrsGgbk4v7eI88WjUNqnHr6foxjbKIaeaps5yd1OsZZ9TypJ8fqw/mxL1xAftkY5vYqKHJMAwCKEv/ON2Delk9qA9NMOhJRxkHgXE/IdgqV8Hrp1tftWEYOuVUPJ8V8+ObBJ03gBRdCPwWd/o X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4cf08c4-9237-4557-3206-08d8e0130974 X-MS-Exchange-CrossTenant-AuthSource: AM0PR03MB4514.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2021 20:12:44.2944 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T/LIMgO9n1YXCzIWm1NZYmKkssEGbdLkk+HAFGtRvEcNLzjuyxU5mByxlzCiGlHeAXQ08uVZkjiYAaQK08BV/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB4338 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean This has the uclass enforce calling detect() before other methods. This allows drivers to cache information in detect() and perform (cheaper) retrieval in the other accessors. This also modifies the only instance where this sequencing was not followed. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- Changes in v2: - Enforce sysinfo detect ordering in uclass. Users must still call sysinfo_detect beforehand. - Modify sysinfo test to check for detect() ordering. common/spl/spl_fit.c | 4 ++++ drivers/sysinfo/sysinfo-uclass.c | 25 ++++++++++++++++++++++++- include/sysinfo.h | 26 +++++++++++++++++--------- test/dm/sysinfo.c | 23 ++++++++++++++--------- 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index a6ad094e91..4d17582af5 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -116,6 +116,10 @@ static int spl_fit_get_image_name(const void *fit, int images, * no string in the property for this index. Check if the * sysinfo-level code can supply one. */ + rc = sysinfo_detect(sysinfo); + if (rc) + return rc; + rc = sysinfo_get_fit_loadable(sysinfo, index - i - 1, type, &str); if (rc && rc != -ENOENT) diff --git a/drivers/sysinfo/sysinfo-uclass.c b/drivers/sysinfo/sysinfo-uclass.c index 6df58fe160..f034ee0870 100644 --- a/drivers/sysinfo/sysinfo-uclass.c +++ b/drivers/sysinfo/sysinfo-uclass.c @@ -15,19 +15,29 @@ int sysinfo_get(struct udevice **devp) int sysinfo_detect(struct udevice *dev) { + int ret; + bool *detected = dev_get_uclass_priv(dev); struct sysinfo_ops *ops = sysinfo_get_ops(dev); if (!ops->detect) return -ENOSYS; - return ops->detect(dev); + ret = ops->detect(dev); + if (!ret) + *detected = true; + + return ret; } int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type, const char **strp) { + bool *detected = dev_get_uclass_priv(dev); struct sysinfo_ops *ops = sysinfo_get_ops(dev); + if (!*detected) + return -EPERM; + if (!ops->get_fit_loadable) return -ENOSYS; @@ -36,8 +46,12 @@ int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type, int sysinfo_get_bool(struct udevice *dev, int id, bool *val) { + bool *detected = dev_get_uclass_priv(dev); struct sysinfo_ops *ops = sysinfo_get_ops(dev); + if (!*detected) + return -EPERM; + if (!ops->get_bool) return -ENOSYS; @@ -46,8 +60,12 @@ int sysinfo_get_bool(struct udevice *dev, int id, bool *val) int sysinfo_get_int(struct udevice *dev, int id, int *val) { + bool *detected = dev_get_uclass_priv(dev); struct sysinfo_ops *ops = sysinfo_get_ops(dev); + if (!*detected) + return -EPERM; + if (!ops->get_int) return -ENOSYS; @@ -56,8 +74,12 @@ int sysinfo_get_int(struct udevice *dev, int id, int *val) int sysinfo_get_str(struct udevice *dev, int id, size_t size, char *val) { + bool *detected = dev_get_uclass_priv(dev); struct sysinfo_ops *ops = sysinfo_get_ops(dev); + if (!*detected) + return -EPERM; + if (!ops->get_str) return -ENOSYS; @@ -68,4 +90,5 @@ UCLASS_DRIVER(sysinfo) = { .id = UCLASS_SYSINFO, .name = "sysinfo", .post_bind = dm_scan_fdt_dev, + .per_device_auto = sizeof(bool), }; diff --git a/include/sysinfo.h b/include/sysinfo.h index 9386bdf49a..e2aef4abe9 100644 --- a/include/sysinfo.h +++ b/include/sysinfo.h @@ -54,7 +54,8 @@ struct sysinfo_ops { * This operation might take a long time (e.g. read from EEPROM, * check the presence of a device on a bus etc.), hence this is not * done in the probe() method, but later during operation in this - * dedicated method. + * dedicated method. This method will be called before any other + * methods. * * Return: 0 if OK, -ve on error. */ @@ -98,7 +99,7 @@ struct sysinfo_ops { * get_fit_loadable - Get the name of an image to load from FIT * This function can be used to provide the image names based on runtime * detection. A classic use-case would when DTBOs are used to describe - * additionnal daughter cards. + * additional daughter cards. * * @dev: The sysinfo instance to gather the data. * @index: Index of the image. Starts at 0 and gets incremented @@ -120,6 +121,9 @@ struct sysinfo_ops { * * @dev: The device containing the information * + * This function must be called before any other accessor function for this + * device. + * * Return: 0 if OK, -ve on error. */ int sysinfo_detect(struct udevice *dev); @@ -131,7 +135,8 @@ int sysinfo_detect(struct udevice *dev); * @id: A unique identifier for the bool value to be read. * @val: Pointer to a buffer that receives the value read. * - * Return: 0 if OK, -ve on error. + * Return: 0 if OK, -EPERM if called before sysinfo_detect(), else -ve on + * error. */ int sysinfo_get_bool(struct udevice *dev, int id, bool *val); @@ -142,7 +147,8 @@ int sysinfo_get_bool(struct udevice *dev, int id, bool *val); * @id: A unique identifier for the int value to be read. * @val: Pointer to a buffer that receives the value read. * - * Return: 0 if OK, -ve on error. + * Return: 0 if OK, -EPERM if called before sysinfo_detect(), else -ve on + * error. */ int sysinfo_get_int(struct udevice *dev, int id, int *val); @@ -154,7 +160,8 @@ int sysinfo_get_int(struct udevice *dev, int id, int *val); * @size: The size of the buffer to receive the string data. * @val: Pointer to a buffer that receives the value read. * - * Return: 0 if OK, -ve on error. + * Return: 0 if OK, -EPERM if called before sysinfo_detect(), else -ve on + * error. */ int sysinfo_get_str(struct udevice *dev, int id, size_t size, char *val); @@ -166,7 +173,8 @@ int sysinfo_get_str(struct udevice *dev, int id, size_t size, char *val); * function that returns the unique device. This is especially useful for use * in sysinfo files. * - * Return: 0 if OK, -ve on error. + * Return: 0 if OK, -EPERM if called before sysinfo_detect(), else -ve on + * error. */ int sysinfo_get(struct udevice **devp); @@ -174,7 +182,7 @@ int sysinfo_get(struct udevice **devp); * sysinfo_get_fit_loadable - Get the name of an image to load from FIT * This function can be used to provide the image names based on runtime * detection. A classic use-case would when DTBOs are used to describe - * additionnal daughter cards. + * additional daughter cards. * * @dev: The sysinfo instance to gather the data. * @index: Index of the image. Starts at 0 and gets incremented @@ -183,8 +191,8 @@ int sysinfo_get(struct udevice **devp); * @strp: A pointer to string. Untouched if the function fails * * - * Return: 0 if OK, -ENOENT if no loadable is available else -ve on - * error. + * Return: 0 if OK, -EPERM if called before sysinfo_detect(), -ENOENT if no + * loadable is available else -ve on error. */ int sysinfo_get_fit_loadable(struct udevice *dev, int index, const char *type, const char **strp); diff --git a/test/dm/sysinfo.c b/test/dm/sysinfo.c index 4aaa9e85bc..fd13f6aac5 100644 --- a/test/dm/sysinfo.c +++ b/test/dm/sysinfo.c @@ -24,33 +24,38 @@ static int dm_test_sysinfo(struct unit_test_state *uts) ut_assertok(sysinfo_get(&sysinfo)); ut_assert(sysinfo); - sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT, &called_detect); + ut_asserteq(-EPERM, sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT, + &called_detect)); ut_assert(!called_detect); sysinfo_detect(sysinfo); - sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT, &called_detect); + ut_assertok(sysinfo_get_bool(sysinfo, BOOL_CALLED_DETECT, + &called_detect)); ut_assert(called_detect); - sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), + str)); ut_assertok(strcmp(str, "R'lyeh")); - sysinfo_get_int(sysinfo, INT_TEST1, &i); + ut_assertok(sysinfo_get_int(sysinfo, INT_TEST1, &i)); ut_asserteq(0, i); - sysinfo_get_int(sysinfo, INT_TEST2, &i); + ut_assertok(sysinfo_get_int(sysinfo, INT_TEST2, &i)); ut_asserteq(100, i); - sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), + str)); ut_assertok(strcmp(str, "Carcosa")); - sysinfo_get_int(sysinfo, INT_TEST1, &i); + ut_assertok(sysinfo_get_int(sysinfo, INT_TEST1, &i)); ut_asserteq(1, i); - sysinfo_get_int(sysinfo, INT_TEST2, &i); + ut_assertok(sysinfo_get_int(sysinfo, INT_TEST2, &i)); ut_asserteq(99, i); - sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), str); + ut_assertok(sysinfo_get_str(sysinfo, STR_VACATIONSPOT, sizeof(str), + str)); ut_assertok(strcmp(str, "Yuggoth")); return 0;