Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2022 16:51:56 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: fde05f986418 - stable/13 - Fix clang 15 warning in cxgbe
Message-ID:  <202207201651.26KGpu7M005639@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dim:

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

commit fde05f986418ad174c8dd7cb8cadeb01ccc0c19e
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-16 19:19:51 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-20 16:51:15 +0000

    Fix clang 15 warning in cxgbe
    
    Clang 15 warns:
    
        sys/dev/cxgbe/cudbg/cudbg_lib.c:2949:6: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
                int i = 0;
                    ^
    
    Apparently 'i' was meant as the current retry counter, but '1' was used
    in the while loop comparison instead, making the loop potentially
    infinite, if 'busy' never gets reset.
    
    MFC after:      3 days
    Reviewed by:    np
    Differential Revision: https://reviews.freebsd.org/D35834
    
    (cherry picked from commit fb0493d55998eeb9f062b15b40924ff722f3eba5)
---
 sys/dev/cxgbe/cudbg/cudbg_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/cxgbe/cudbg/cudbg_lib.c b/sys/dev/cxgbe/cudbg/cudbg_lib.c
index dcbcb24807b9..feded8e75863 100644
--- a/sys/dev/cxgbe/cudbg/cudbg_lib.c
+++ b/sys/dev/cxgbe/cudbg/cudbg_lib.c
@@ -2950,7 +2950,7 @@ static int check_busy_bit(struct adapter *padap)
 	int retry = 10;
 	int status = 0;
 
-	while (busy & (1 < retry)) {
+	while (busy && i < retry) {
 		val = t4_read_reg(padap, A_CIM_HOST_ACC_CTRL);
 		busy = (0 != (val & CUDBG_CIM_BUSY_BIT));
 		i++;



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