]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs_proxy: remove redundant unsigned >= 0 comparison 62372/head
authorKefu Chai <tchaikov@gmail.com>
Wed, 19 Mar 2025 01:52:18 +0000 (09:52 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 19 Mar 2025 01:58:06 +0000 (09:58 +0800)
Fix a clang warning in proxy_async.c where an unsigned value was being
unnecessarily compared against 0:
```
/home/kefu/dev/ceph/src/libcephfs_proxy/proxy_async.c:29:12: warning: result of comparison of unsigned expression >= 0 is always true [-Wtautological-unsigned-zero-compare]
   29 |         if ((size >= 0) && !info->write) {
      |              ~~~~ ^  ~
1 warning generated.
```

Since unsigned values are always >= 0 by definition, remove this
tautological check to resolve the "-Wtautological-unsigned-zero-compare"
warning.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/libcephfs_proxy/proxy_async.c

index 629a9feda5da4dac7e66550a960e9f84e0010134..9efe0ff0faf86979ebdd7f67884c8794a7c5bdc8 100644 (file)
@@ -26,7 +26,7 @@ static int32_t libcephfsd_cbk_nonblocking_rw(proxy_async_t *async,
 
        info->result = cbk->ll_nonblocking_rw.res;
 
-       if ((size >= 0) && !info->write) {
+       if (!info->write) {
                iov = info->iov;
                count = info->iovcnt;
                while (size > 0) {