padlock: Use device_set_descf()

No functional change intended.

MFC after:	1 week
This commit is contained in:
Mark Johnston 2024-06-05 15:33:59 -04:00
parent 89848b3445
commit 131c8ee733

View File

@ -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);