From nobody Sat Feb 17 21:32:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tchq55kP8z59kpC; Sat, 17 Feb 2024 21:32:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tchq53xtdz4h6Q; Sat, 17 Feb 2024 21:32:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708205569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zsfvF+/XNO6jd+8Rvyrl6HLBoZmHLI/OIz1eTvYtMnI=; b=hdI7XTI7+AJnBbqA9DUyk6JmLF9lG/cOQWIVZ8JFMeNMAYIxNSLvjnJac3cjccF/o5ieGM GRHequnzqdjvwYmHtqlFnG/cOqLi0Kveqg2eeUBxKCffPMIsx6CVvnjeHB5UB9pXCfYOCH skrBYjiPSHUNDaY6FxFHVU0FdYuFHtLiNnM/KuboL3HYM+kZqxRQwqFt20CUtVvQu1vlal jmzsQKo3pjKifMd6tAEMZjszMdz24EPr1X+oT0eED/Ze/x2s+eF7CFdYTKH6Gdwn/CHkue UAtCXpA70hSK8BQAstloIGW7FDTRzqTrYfrPQLjfLWTNFOZS8x06Tuz9Zf4dLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708205569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zsfvF+/XNO6jd+8Rvyrl6HLBoZmHLI/OIz1eTvYtMnI=; b=jYr/Gpkt8F635HbUj6dQjfgZtRm7XZgTi2pGRRrI/Vgc8AE+YQ+oXZuKXusSVfCEhGuYZJ lHyGPxdiS00ogfIvVIxObvnZJ7pVrFhYtAOm9dYLxdAhhLvChUusHRDOiNZJVlCsWDADQD gomiWOSqILxi6JxwFnDruz8zu4YOu7tXv4nhU+CnaF+vSGm6RZHRINjiISSc05SvdUzcHa 1D8cvNe0jghJwVhHeEYiGDFW6LmTA4HJE7vjh0bK5bdXBYPxS7Rz6tYfG3l16xD0cANMo7 y8EaVyd9CSTmmBkQaWi1M7aR/MCPIJ7Icckzz/sCF9eF7rFo5A32GKrxcfZ1VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708205569; a=rsa-sha256; cv=none; b=BIQCNeDyhhyHL6zvM3DvWGD3rYQn1OloU3uWklX76M8mh7mOQCFaJVGv/AC3cz66E8I5nD zPL/Ib7ae/L8JPqUeH02HnTCqj3+pkdMyBVwnOiNvIY+i8JmXxlIpYR5JOhbzjh1eL4VJW RNTeyM1FhfZbYkGD4sVTjCFU7AnFU5M4uI9MUKgRE2cs5I4I19MiQ4Gg15923560OreW8d KKkvpp7lJAoDNEyzO7/USgyjVeqkUL8hTTmgtGX8FPEwF/hnGHmilaHRD2AccQ57EiisDS GoQC8qMxhAdwI9FHWIrsYvDMJ78Rul7pntwVnH05IJCr3guVc3aA2lcxoBQqgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tchq521D6zPbG; Sat, 17 Feb 2024 21:32:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41HLWnEY020360; Sat, 17 Feb 2024 21:32:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41HLWn8K020357; Sat, 17 Feb 2024 21:32:49 GMT (envelope-from git) Date: Sat, 17 Feb 2024 21:32:49 GMT Message-Id: <202402172132.41HLWn8K020357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: 1341925217a6 - stable/14 - LinuxKPI: Add str_on_off and other helpers to linux/string_helpers.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1341925217a6c1d2e47a54d1d2f9a8f83643e8a3 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=1341925217a6c1d2e47a54d1d2f9a8f83643e8a3 commit 1341925217a6c1d2e47a54d1d2f9a8f83643e8a3 Author: Vladimir Kondratyev AuthorDate: 2023-12-24 08:19:58 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-02-17 20:58:36 +0000 LinuxKPI: Add str_on_off and other helpers to linux/string_helpers.h Sponsored by: Serenity Cyber Security, LLC Reviewed by: manu, bz, imp (previous version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42794 (cherry picked from commit ae1084ff01bf9d9a9a2c56caf6c7095f3e96f579) --- .../linuxkpi/common/include/linux/string_helpers.h | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/string_helpers.h b/sys/compat/linuxkpi/common/include/linux/string_helpers.h index faa097c97a87..1bdff2730361 100644 --- a/sys/compat/linuxkpi/common/include/linux/string_helpers.h +++ b/sys/compat/linuxkpi/common/include/linux/string_helpers.h @@ -39,4 +39,31 @@ str_yes_no(bool value) return "no"; } -#endif /* _LINUXKPI_LINUX_STRING_HELPERS_H_ */ +static inline const char * +str_on_off(bool value) +{ + if (value) + return "on"; + else + return "off"; +} + +static inline const char * +str_enabled_disabled(bool value) +{ + if (value) + return "enabled"; + else + return "disabled"; +} + +static inline const char * +str_enable_disable(bool value) +{ + if (value) + return "enable"; + else + return "disable"; +} + +#endif