Skip to content

Commit

Permalink
drivers: comedi: replace ternary operator with min()
Browse files Browse the repository at this point in the history
Fix the following coccicheck warning:

drivers/comedi/drivers.c:857:12-13: WARNING opportunity for min().

min() macro is defined in include/linux/minmax.h. It avoids multiple
evaluations of the arguments when non-constant and performs strict
type-checking.

Reviewed-by: Ian Abbott <[email protected]>
Signed-off-by: Guo Zhengkui <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Guo Zhengkui authored and gregkh committed May 19, 2022
1 parent 7394d2e commit 80ad54a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ int comedi_load_firmware(struct comedi_device *dev,
release_firmware(fw);
}

return ret < 0 ? ret : 0;
return min(ret, 0);
}
EXPORT_SYMBOL_GPL(comedi_load_firmware);

Expand Down

0 comments on commit 80ad54a

Please sign in to comment.