From nobody Tue Jan 27 18:44:20 2026 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 4f0vT11tkgz6QFyV for ; Tue, 27 Jan 2026 18:44:21 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f0vT06mK5z3rWp for ; Tue, 27 Jan 2026 18:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769539461; 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=nbw5AnJ9gUgcC05StDShOWO99qIEBShkM60HdSRw6zQ=; b=AlAKHATt8mWJz9+Yk67/QDTfwFwcXN90UpqMaCDJUykVAx7gBcZiWIqXNTLvJE5W3uJAbH jxVQMCZuLORT5fpcy3fSXZ7LLvQwtdLuTKXzFDssdip1zknOCdaVv3jlmxiZlpPQ0ihV8X TV64Qfu4a9SAGiDCN58E012MHJeQaAt6O3Nx7VrciYrDwDJFeqET7gb48G+eWGjovTx5GK +D8ZFUgEK07K9/GecytlCB/9eeeSKunW6XJCMNkjduOxwsQezPw8TiZU3+4ryW/dJaT8qv UXNkw4BCX+4LVTE6u2fmYGrhXq+9ZvootPEPryNaSXPrhrLngsrqUUAJM0wVvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769539461; 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=nbw5AnJ9gUgcC05StDShOWO99qIEBShkM60HdSRw6zQ=; b=vDeVzFdHw5O4mUcSyLWKE4lmViegqaueL23M/qp+kjIRNAGjKWFGmewazOFjyzfGJx29li hh5jpA5w4wCkx7kb9pPtAfkoPhiqDstWXnUznEonW6zalCBqS9O5wR9n/hFqAI7xBrDvru w6nTe1litl97fva5tGMgb7Yh/Tqhql3QfHHMitfoZDklottiPFKKp7lCNE7Mpt9kXG2dKR 95HSs73pSEl0mupz4ihJQTmLZHNtXveSlD0Dk1i/3miMAX8xuV30oGU93B5XOVZv59fuOT y4vZks8VQsHx0viVRnCMxRnJzJfCZG5q1+M3xFVyX5f5HMbOsxFK9o+cV+sqrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769539461; a=rsa-sha256; cv=none; b=OjS9XjmO6q2bqBXurrgRoLh4IDnTzmM+iIAHNDC2O7wdfcbP7U19hZEQKxCz6bljuiC5uW K2+NtCoTnaUPn8q5/XmguiD34oYUL9vRUwZVdqQkjdKvfiiEZf5oJGosb/jKMdSGcbvmQO TU+55fr8Z9hVdQTnj9K5vQjcCPXE1uBanwMUdqArCOkvYZzb/hSIkQPiGRw8EjlWpyRiww nf+gs/tilye+ljp3xfQ3RRqWMqfoytypMDd01QDbl1GHAoppibDU9ir9fRKgOIz43AoJ6k rOqec5aA9CZPox+Q0QoWKdMvUKpqfGNUcRwnzU9xb2F5ml8UBLqZZ7MiOrvbNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f0vT0669xz3dX for ; Tue, 27 Jan 2026 18:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 200a7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 27 Jan 2026 18:44:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8ac917c7ce6c - stable/14 - ctl_ioctl.h: Do not use enums for bit fields of flags 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ac917c7ce6c6b85511cb3d392b809357bad5ec8 Auto-Submitted: auto-generated Date: Tue, 27 Jan 2026 18:44:20 +0000 Message-Id: <69790784.200a7.6af0f342@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8ac917c7ce6c6b85511cb3d392b809357bad5ec8 commit 8ac917c7ce6c6b85511cb3d392b809357bad5ec8 Author: John Baldwin AuthorDate: 2025-04-02 18:40:54 +0000 Commit: John Baldwin CommitDate: 2026-01-27 18:15:57 +0000 ctl_ioctl.h: Do not use enums for bit fields of flags C++ does not permit treating enum values as individual bits used with the bitwise operators. For types that are a mask of flags, switch the typedef to an unsigned int and use preprocessor macros for flag constants. Reviewed by: imp, asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D49138 (cherry picked from commit 48000952260469477346c8a89e927af69ebc00e2) --- sys/cam/ctl/ctl_ioctl.h | 104 ++++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/sys/cam/ctl/ctl_ioctl.h b/sys/cam/ctl/ctl_ioctl.h index 9fef169c300c..59a9d9336b77 100644 --- a/sys/cam/ctl/ctl_ioctl.h +++ b/sys/cam/ctl/ctl_ioctl.h @@ -110,10 +110,10 @@ typedef enum { CTL_SS_ERROR } ctl_stats_status; -typedef enum { - CTL_STATS_FLAG_NONE = 0x00, - CTL_STATS_FLAG_TIME_VALID = 0x01 -} ctl_stats_flags; +typedef u_int ctl_stats_flags; + +#define CTL_STATS_FLAG_NONE 0x00 +#define CTL_STATS_FLAG_TIME_VALID 0x01 struct ctl_io_stats { uint32_t item; @@ -149,16 +149,16 @@ struct ctl_get_io_stats { * CONTINUOUS: This error will stay around until explicitly cleared. * DESCRIPTOR: Use descriptor sense instead of fixed sense. */ -typedef enum { - CTL_LUN_INJ_NONE = 0x000, - CTL_LUN_INJ_ABORTED = 0x001, - CTL_LUN_INJ_MEDIUM_ERR = 0x002, - CTL_LUN_INJ_UA = 0x003, - CTL_LUN_INJ_CUSTOM = 0x004, - CTL_LUN_INJ_TYPE = 0x0ff, - CTL_LUN_INJ_CONTINUOUS = 0x100, - CTL_LUN_INJ_DESCRIPTOR = 0x200 -} ctl_lun_error; +typedef u_int ctl_lun_error; + +#define CTL_LUN_INJ_NONE 0x000 +#define CTL_LUN_INJ_ABORTED 0x001 +#define CTL_LUN_INJ_MEDIUM_ERR 0x002 +#define CTL_LUN_INJ_UA 0x003 +#define CTL_LUN_INJ_CUSTOM 0x004 +#define CTL_LUN_INJ_TYPE 0x0ff +#define CTL_LUN_INJ_CONTINUOUS 0x100 +#define CTL_LUN_INJ_DESCRIPTOR 0x200 /* * Flags to specify what type of command the given error pattern will @@ -178,18 +178,18 @@ typedef enum { * RANGE: For read/write commands, act when the LBA is in the * specified range. */ -typedef enum { - CTL_LUN_PAT_NONE = 0x000, - CTL_LUN_PAT_READ = 0x001, - CTL_LUN_PAT_WRITE = 0x002, - CTL_LUN_PAT_READWRITE = CTL_LUN_PAT_READ | CTL_LUN_PAT_WRITE, - CTL_LUN_PAT_READCAP = 0x004, - CTL_LUN_PAT_TUR = 0x008, - CTL_LUN_PAT_ANY = 0x0ff, - CTL_LUN_PAT_MASK = 0x0ff, - CTL_LUN_PAT_CMD = 0x100, - CTL_LUN_PAT_RANGE = 0x200 -} ctl_lun_error_pattern; +typedef u_int ctl_lun_error_pattern; + +#define CTL_LUN_PAT_NONE 0x000 +#define CTL_LUN_PAT_READ 0x001 +#define CTL_LUN_PAT_WRITE 0x002 +#define CTL_LUN_PAT_READWRITE CTL_LUN_PAT_READ | CTL_LUN_PAT_WRITE +#define CTL_LUN_PAT_READCAP 0x004 +#define CTL_LUN_PAT_TUR 0x008 +#define CTL_LUN_PAT_ANY 0x0ff +#define CTL_LUN_PAT_MASK 0x0ff +#define CTL_LUN_PAT_CMD 0x100 +#define CTL_LUN_PAT_RANGE 0x200 /* * This structure allows the user to specify a particular CDB pattern to @@ -229,10 +229,10 @@ struct ctl_error_desc { STAILQ_ENTRY(ctl_error_desc) links; /* Kernel use only */ }; -typedef enum { - CTL_OOA_FLAG_NONE = 0x00, - CTL_OOA_FLAG_ALL_LUNS = 0x01 -} ctl_ooa_flags; +typedef u_int ctl_ooa_flags; + +#define CTL_OOA_FLAG_NONE 0x00 +#define CTL_OOA_FLAG_ALL_LUNS 0x01 typedef enum { CTL_OOA_OK, @@ -240,16 +240,16 @@ typedef enum { CTL_OOA_ERROR } ctl_get_ooa_status; -typedef enum { - CTL_OOACMD_FLAG_NONE = 0x00, - CTL_OOACMD_FLAG_DMA = 0x01, - CTL_OOACMD_FLAG_BLOCKED = 0x02, - CTL_OOACMD_FLAG_ABORT = 0x04, - CTL_OOACMD_FLAG_RTR = 0x08, - CTL_OOACMD_FLAG_DMA_QUEUED = 0x10, - CTL_OOACMD_FLAG_STATUS_QUEUED = 0x20, - CTL_OOACMD_FLAG_STATUS_SENT = 0x40 -} ctl_ooa_cmd_flags; +typedef u_int ctl_ooa_cmd_flags; + +#define CTL_OOACMD_FLAG_NONE 0x00 +#define CTL_OOACMD_FLAG_DMA 0x01 +#define CTL_OOACMD_FLAG_BLOCKED 0x02 +#define CTL_OOACMD_FLAG_ABORT 0x04 +#define CTL_OOACMD_FLAG_RTR 0x08 +#define CTL_OOACMD_FLAG_DMA_QUEUED 0x10 +#define CTL_OOACMD_FLAG_STATUS_QUEUED 0x20 +#define CTL_OOACMD_FLAG_STATUS_SENT 0x40 struct ctl_ooa_entry { ctl_ooa_cmd_flags cmd_flags; @@ -320,18 +320,18 @@ typedef enum { * * The OFFLINE flag tells us that this LUN can not access backing store. */ -typedef enum { - CTL_LUN_FLAG_ID_REQ = 0x01, - CTL_LUN_FLAG_STOPPED = 0x02, - CTL_LUN_FLAG_NO_MEDIA = 0x04, - CTL_LUN_FLAG_PRIMARY = 0x08, - CTL_LUN_FLAG_SERIAL_NUM = 0x10, - CTL_LUN_FLAG_DEVID = 0x20, - CTL_LUN_FLAG_DEV_TYPE = 0x40, - CTL_LUN_FLAG_UNMAP = 0x80, - CTL_LUN_FLAG_EJECTED = 0x100, - CTL_LUN_FLAG_READONLY = 0x200 -} ctl_backend_lun_flags; +typedef u_int ctl_backend_lun_flags; + +#define CTL_LUN_FLAG_ID_REQ 0x01 +#define CTL_LUN_FLAG_STOPPED 0x02 +#define CTL_LUN_FLAG_NO_MEDIA 0x04 +#define CTL_LUN_FLAG_PRIMARY 0x08 +#define CTL_LUN_FLAG_SERIAL_NUM 0x10 +#define CTL_LUN_FLAG_DEVID 0x20 +#define CTL_LUN_FLAG_DEV_TYPE 0x40 +#define CTL_LUN_FLAG_UNMAP 0x80 +#define CTL_LUN_FLAG_EJECTED 0x100 +#define CTL_LUN_FLAG_READONLY 0x200 /* * LUN creation parameters: