]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
libctf: Remove checks for CTFv1
authorMark Johnston <markj@FreeBSD.org>
Wed, 23 Feb 2022 14:57:41 +0000 (09:57 -0500)
committerMark Johnston <markj@FreeBSD.org>
Wed, 23 Feb 2022 16:41:22 +0000 (11:41 -0500)
Per commit 7db423d69273 ("libctf: Rip out CTFv1 support") this support
is obsolete.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

cddl/contrib/opensolaris/common/ctf/ctf_open.c
cddl/contrib/opensolaris/common/ctf/ctf_types.c

index d64337a68bfffb64e2ddc9b9c2b17567f5dc6c98..5ab06890d7f17c604d0926acb3a326f97ba20d59 100644 (file)
@@ -229,8 +229,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
                        break;
                case CTF_K_STRUCT:
                case CTF_K_UNION:
-                       if (fp->ctf_version == CTF_VERSION_1 ||
-                           size < CTF_LSTRUCT_THRESH) {
+                       if (size < CTF_LSTRUCT_THRESH) {
                                ctf_member_t *mp = (ctf_member_t *)
                                    ((uintptr_t)tp + increment);
 
@@ -383,8 +382,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
                        if (err != 0 && err != ECTF_STRTAB)
                                return (err);
 
-                       if (fp->ctf_version == CTF_VERSION_1 ||
-                           size < CTF_LSTRUCT_THRESH)
+                       if (size < CTF_LSTRUCT_THRESH)
                                vbytes = sizeof (ctf_member_t) * vlen;
                        else {
                                vbytes = sizeof (ctf_lmember_t) * vlen;
@@ -399,8 +397,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
                        if (err != 0 && err != ECTF_STRTAB)
                                return (err);
 
-                       if (fp->ctf_version == CTF_VERSION_1 ||
-                           size < CTF_LSTRUCT_THRESH)
+                       if (size < CTF_LSTRUCT_THRESH)
                                vbytes = sizeof (ctf_member_t) * vlen;
                        else {
                                vbytes = sizeof (ctf_lmember_t) * vlen;
index 21b061cd9356b48898a0a3657d73828bbc428479..5b6b07655d82475adc49c5731423d26f4b5f956f 100644 (file)
@@ -33,8 +33,7 @@ ctf_get_ctt_size(const ctf_file_t *fp, const ctf_type_t *tp, ssize_t *sizep,
 {
        ssize_t size, increment;
 
-       if (fp->ctf_version > CTF_VERSION_1 &&
-           tp->ctt_size == CTF_LSIZE_SENT) {
+       if (tp->ctt_size == CTF_LSIZE_SENT) {
                size = CTF_TYPE_LSIZE(tp);
                increment = sizeof (ctf_type_t);
        } else {
@@ -75,7 +74,7 @@ ctf_member_iter(ctf_file_t *fp, ctf_id_t type, ctf_member_f *func, void *arg)
        if (kind != CTF_K_STRUCT && kind != CTF_K_UNION)
                return (ctf_set_errno(ofp, ECTF_NOTSOU));
 
-       if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+       if (size < CTF_LSTRUCT_THRESH) {
                const ctf_member_t *mp = (const ctf_member_t *)
                    ((uintptr_t)tp + increment);
 
@@ -425,8 +424,7 @@ ctf_type_align(ctf_file_t *fp, ctf_id_t type)
                if (LCTF_INFO_KIND(fp, tp->ctt_info) == CTF_K_STRUCT)
                        n = MIN(n, 1); /* only use first member for structs */
 
-               if (fp->ctf_version == CTF_VERSION_1 ||
-                   size < CTF_LSTRUCT_THRESH) {
+               if (size < CTF_LSTRUCT_THRESH) {
                        const ctf_member_t *mp = vmp;
                        for (; n != 0; n--, mp++) {
                                ssize_t am = ctf_type_align(fp, mp->ctm_type);
@@ -665,7 +663,7 @@ _ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name, ulong_t off,
        if (kind != CTF_K_STRUCT && kind != CTF_K_UNION)
                return (ctf_set_errno(ofp, ECTF_NOTSOU));
 
-       if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+       if (size < CTF_LSTRUCT_THRESH) {
                const ctf_member_t *mp = (const ctf_member_t *)
                    ((uintptr_t)tp + increment);
 
@@ -849,7 +847,7 @@ ctf_type_rvisit(ctf_file_t *fp, ctf_id_t type, ctf_visit_f *func, void *arg,
 
        (void) ctf_get_ctt_size(fp, tp, &size, &increment);
 
-       if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+       if (size < CTF_LSTRUCT_THRESH) {
                const ctf_member_t *mp = (const ctf_member_t *)
                    ((uintptr_t)tp + increment);