Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jun 2024 20:38:08 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 131c8ee7331a - main - padlock: Use device_set_descf()
Message-ID:  <202406162038.45GKc85G079875@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=131c8ee7331af701c78e694c9c7051f53600c4fe

commit 131c8ee7331af701c78e694c9c7051f53600c4fe
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-06-05 19:33:59 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-06-16 20:37:26 +0000

    padlock: Use device_set_descf()
    
    No functional change intended.
    
    MFC after:      1 week
---
 sys/crypto/via/padlock.c | 21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/sys/crypto/via/padlock.c b/sys/crypto/via/padlock.c
index 8ff222ef413b..359618409f09 100644
--- a/sys/crypto/via/padlock.c
+++ b/sys/crypto/via/padlock.c
@@ -79,31 +79,14 @@ padlock_identify(driver_t *drv, device_t parent)
 static int
 padlock_probe(device_t dev)
 {
-	char capp[256];
-
 #if defined(__amd64__) || defined(__i386__)
 	/* If there is no AES support, we has nothing to do here. */
 	if (!(via_feature_xcrypt & VIA_HAS_AES)) {
 		device_printf(dev, "No ACE support.\n");
 		return (EINVAL);
 	}
-	strlcpy(capp, "AES-CBC", sizeof(capp));
-#if 0
-	strlcat(capp, ",AES-EBC", sizeof(capp));
-	strlcat(capp, ",AES-CFB", sizeof(capp));
-	strlcat(capp, ",AES-OFB", sizeof(capp));
-#endif
-	if (via_feature_xcrypt & VIA_HAS_SHA) {
-		strlcat(capp, ",SHA1", sizeof(capp));
-		strlcat(capp, ",SHA256", sizeof(capp));
-	}
-#if 0
-	if (via_feature_xcrypt & VIA_HAS_AESCTR)
-		strlcat(capp, ",AES-CTR", sizeof(capp));
-	if (via_feature_xcrypt & VIA_HAS_MM)
-		strlcat(capp, ",RSA", sizeof(capp));
-#endif
-	device_set_desc_copy(dev, capp);
+	device_set_descf(dev, "AES-CBC%s",
+	    (via_feature_xcrypt & VIA_HAS_SHA) ? ",SHA1,SHA256" : "");
 	return (0);
 #else
 	return (EINVAL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406162038.45GKc85G079875>