[bug report] cxl: Prevent adapter reset if an active context exists
Dan Carpenter
dan.carpenter at oracle.com
Thu Jul 5 00:40:50 AEST 2018
Hello Vaibhav Jain,
The patch 70b565bbdb91: "cxl: Prevent adapter reset if an active
context exists" from Oct 14, 2016, leads to the following static
checker warning:
drivers/misc/cxl/main.c:290 cxl_adapter_context_get()
warn: 'atomic_inc_unless_negative(&adapter->contexts_num)' is unsigned
drivers/misc/cxl/main.c
285 int cxl_adapter_context_get(struct cxl *adapter)
286 {
287 int rc;
288
289 rc = atomic_inc_unless_negative(&adapter->contexts_num);
290 return rc >= 0 ? 0 : -EBUSY;
atomic_inc_unless_negative() returns bool so it's always >= 0.
291 }
regards,
dan carpenter
More information about the Linuxppc-dev
mailing list