From nobody Sun May 01 18:15:21 2022 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 397121AC53BD; Sun, 1 May 2022 18:15:22 +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 4KrvXV0H2Gz3GnS; Sun, 1 May 2022 18:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651428922; 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=gDQT9mGEYMxvvEu3dpAKSBfjqROatRYG36Rk8qocmsY=; b=vQpeQG2aXrFazU/kZKMcbSQ4H+ML1GLlyfj6wKdFN93CZmgkHdXirSUbaQ6cYu+PerrHxE vWy0fFIXpiFmpw5s6J2dyi7WVkBgobvZaA8ICMwoGFd9/a+HsX4XXT0qgaP3bsjlR/zKts Ysg+C5tdPDfuZcIkRqGOuIyzzsQtuu5PVCKgrqzwDXvmCAdanBWOvsxNTdb5lODSgBRFSQ mLJg8Qq46IX7vCHBq3q/ufAlT+TWwz+rxudeD+PpcXT4b7oRlwSnhjG6Y7WFuoFZ+bK0ze Q0y9hW3v5jbocmKvwpslLnqMB2qUdpLLUwsxqKzaEgTERoQ14MuLYpo4MQZFxg== 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 D3F4C1A91D; Sun, 1 May 2022 18:15:21 +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 241IFLKO030197; Sun, 1 May 2022 18:15:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 241IFLVC030196; Sun, 1 May 2022 18:15:21 GMT (envelope-from git) Date: Sun, 1 May 2022 18:15:21 GMT Message-Id: <202205011815.241IFLVC030196@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: d095d6a34c72 - main - cam_xpt: Prefer bool to int where it's a boolean 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: d095d6a34c720122af5310c30a12255d1c1d8d6b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651428922; 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=gDQT9mGEYMxvvEu3dpAKSBfjqROatRYG36Rk8qocmsY=; b=DWaBmf2D1DvCM1J9KGcxLLz4qCc48fBVeQdLNCWUyV3CRBPJSq/ZhG9dLmKTLkimUzV/H7 6tGuRRyOCthxQCILQlgFjcmaU5fnqsEkD+4PVK5f0EmAMD5SfC+AlMPjZb/Mu8H6KVGR8i y14qXHNzq68koYdZSXGZ5YOzPUshYGEd7jyMG7xqDqmivSAJl9TsXxGGuOwgJFpJbMQaCD mf3wspR9L1dkr/xPvRvQ5c0eeeM2gtR11yYEeyxU3sCrb1C0aAVrswjl9DIXkOfRyqp0pV eX4VXnZSJ0gfdbLxQNrlUY60H88C9DJxjdGSNh3qBb2G7BAaXxQHDO9+v+uoLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651428922; a=rsa-sha256; cv=none; b=LwcyYLf2dcNBdkl9Fst8zcmFviKraoEIgcxtBqJQhyT1ipirKBjQ5ZXyDCNvMoch2llNLx jcuRWvlHpFAavYN6vBLtR3/QyBU1ob8NY0qS32PtpVigGxyWujj2gf7UlQWbE35u9Sy/Zp bljv3lDKUgxNkgICq9cCfWcd2WTyae5Y1XEmSMS2Dt7w2gRB/0BNAC9TrwJHelEwqnttKP z8l8PsahovDuNi5KN9/z/PQodmgrkRWJ86zpXJeUIxznuMybnh7pO8i6nLd57LT51YJxvC 5CDlv+5vP7VoN1+vkyNc9YJpZm5HFpAnM4QqbwRQtPo48O5Ss7uZAo6VNlAq4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d095d6a34c720122af5310c30a12255d1c1d8d6b commit d095d6a34c720122af5310c30a12255d1c1d8d6b Author: Warner Losh AuthorDate: 2022-05-01 18:04:13 +0000 Commit: Warner Losh CommitDate: 2022-05-01 18:09:42 +0000 cam_xpt: Prefer bool to int where it's a boolean In the places where we set an integer to 0 or 1 and then use it like a boolean, replace int with bool and 0/1 with false/true. Left alone places where this is a function argument or return value. No functional changes intended. Sponsored by: Netflix --- sys/cam/cam_xpt.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index b8fc9458ec03..f3e9f2772e62 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -605,12 +605,12 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread * struct periph_driver **p_drv; char *name; u_int unit; - int base_periph_found; + bool base_periph_found; ccb = (union ccb *)addr; unit = ccb->cgdl.unit_number; name = ccb->cgdl.periph_name; - base_periph_found = 0; + base_periph_found = false; #if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) if (ccb->ccb_h.func_code == XPT_SCSI_IO) ccb->csio.bio = NULL; @@ -664,7 +664,7 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread * struct cam_ed *device; int i; - base_periph_found = 1; + base_periph_found = true; device = periph->path->device; for (i = 0, periph = SLIST_FIRST(&device->periphs); periph != NULL; @@ -732,7 +732,7 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread * * passthrough driver, but doesn't have one in his * kernel. */ - if (base_periph_found == 1) { + if (base_periph_found) { printf("xptioctl: pass driver is not in the " "kernel\n"); printf("xptioctl: put \"device pass\" in " @@ -2833,9 +2833,9 @@ call_sim: struct ccb_getdevlist *cgdl; u_int i; struct cam_ed *device; - int found; + bool found; - found = 0; + found = false; /* * Don't want anyone mucking with our data. @@ -2868,10 +2868,10 @@ call_sim: nperiph->periph_name, sizeof(cgdl->periph_name)); cgdl->unit_number = nperiph->unit_number; - found = 1; + found = true; } } - if (found == 0) { + if (!found) { cgdl->status = CAM_GDEVLIST_ERROR; break; } @@ -4210,7 +4210,7 @@ xpt_async_process_dev(struct cam_ed *device, void *arg) struct cam_path *path = ccb->ccb_h.path; void *async_arg = ccb->casync.async_arg_ptr; u_int32_t async_code = ccb->casync.async_code; - int relock; + bool relock; if (path->device != device && path->device->lun_id != CAM_LUN_WILDCARD @@ -4237,9 +4237,9 @@ xpt_async_process_dev(struct cam_ed *device, void *arg) path->target->bus->path_id != CAM_BUS_WILDCARD)) { mtx_unlock(&device->device_mtx); xpt_path_lock(path); - relock = 1; + relock = true; } else - relock = 0; + relock = false; (*(device->target->bus->xport->ops->async))(async_code, device->target->bus, device->target, device, async_arg); @@ -5215,7 +5215,7 @@ xpt_register_async(int event, ac_callback_t *cbfunc, void *cbarg, { struct ccb_setasync csa; cam_status status; - int xptpath = 0; + bool xptpath = false; if (path == NULL) { status = xpt_create_path(&path, /*periph*/NULL, CAM_XPT_PATH_ID, @@ -5223,7 +5223,7 @@ xpt_register_async(int event, ac_callback_t *cbfunc, void *cbarg, if (status != CAM_REQ_CMP) return (status); xpt_path_lock(path); - xptpath = 1; + xptpath = true; } memset(&csa, 0, sizeof(csa));