From nobody Fri Nov 05 15:25:42 2021 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 D60761836046; Fri, 5 Nov 2021 15:25:45 +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 4Hm48R37VTz4l15; Fri, 5 Nov 2021 15:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 A43051A324; Fri, 5 Nov 2021 15:25:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A5FPg8D073326; Fri, 5 Nov 2021 15:25:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A5FPgwj073325; Fri, 5 Nov 2021 15:25:42 GMT (envelope-from git) Date: Fri, 5 Nov 2021 15:25:42 GMT Message-Id: <202111051525.1A5FPgwj073325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d836c48e7110 - main - cam_periph: wired is really a bool, update it to a bool. 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d836c48e7110f2894885cf84ce8990f7916663cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d836c48e7110f2894885cf84ce8990f7916663cc commit d836c48e7110f2894885cf84ce8990f7916663cc Author: Warner Losh AuthorDate: 2021-11-05 14:56:48 +0000 Commit: Warner Losh CommitDate: 2021-11-05 14:56:48 +0000 cam_periph: wired is really a bool, update it to a bool. Sponsored by: Netflix Reviewed by: scottl Differential Revision: https://reviews.freebsd.org/D32823 --- sys/cam/cam_periph.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index bb4baaf0888f..54fe9a0ef40c 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include static u_int camperiphnextunit(struct periph_driver *p_drv, - u_int newunit, int wired, + u_int newunit, bool wired, path_id_t pathid, target_id_t target, lun_id_t lun); static u_int camperiphunit(struct periph_driver *p_drv, @@ -539,7 +539,7 @@ cam_periph_unhold(struct cam_periph *periph) * numbers that did not match a wiring entry. */ static u_int -camperiphnextunit(struct periph_driver *p_drv, u_int newunit, int wired, +camperiphnextunit(struct periph_driver *p_drv, u_int newunit, bool wired, path_id_t pathid, target_id_t target, lun_id_t lun) { struct cam_periph *periph; @@ -555,14 +555,14 @@ camperiphnextunit(struct periph_driver *p_drv, u_int newunit, int wired, ; if (periph != NULL && periph->unit_number == newunit) { - if (wired != 0) { + if (wired) { xpt_print(periph->path, "Duplicate Wired " "Device entry!\n"); xpt_print(periph->path, "Second device (%s " "device at scbus%d target %d lun %d) will " "not be wired\n", periph_name, pathid, target, lun); - wired = 0; + wired = false; } continue; } @@ -600,8 +600,9 @@ static u_int camperiphunit(struct periph_driver *p_drv, path_id_t pathid, target_id_t target, lun_id_t lun, const char *sn) { + bool wired; u_int unit; - int wired, i, val, dunit; + int i, val, dunit; const char *dname, *strval; char pathbuf[32], *periph_name; @@ -610,29 +611,29 @@ camperiphunit(struct periph_driver *p_drv, path_id_t pathid, unit = 0; i = 0; dname = periph_name; - for (wired = 0; resource_find_dev(&i, dname, &dunit, NULL, NULL) == 0; - wired = 0) { + while (resource_find_dev(&i, dname, &dunit, NULL, NULL) == 0) { + wired = false; if (resource_string_value(dname, dunit, "at", &strval) == 0) { if (strcmp(strval, pathbuf) != 0) continue; - wired++; + wired = true; } if (resource_int_value(dname, dunit, "target", &val) == 0) { if (val != target) continue; - wired++; + wired = true; } if (resource_int_value(dname, dunit, "lun", &val) == 0) { if (val != lun) continue; - wired++; + wired = true; } if (resource_string_value(dname, dunit, "sn", &strval) == 0) { if (sn == NULL || strcmp(strval, sn) != 0) continue; - wired++; + wired = true; } - if (wired != 0) { + if (wired) { unit = dunit; break; }