Skip to content

Commit

Permalink
Cleanup: Remove branches that always evaluate the same way
Browse files Browse the repository at this point in the history
Coverity reported that the ASSERT in taskq_create() is always true and
the `*offp > MAXOFFSET_T` check in zfs_file_seek() is always false.

We delete them as cleanup.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes openzfs#14130
  • Loading branch information
ryao authored and andrewc12 committed Nov 11, 2022
1 parent b03171c commit 373df0e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion module/os/linux/spl/spl-taskq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,6 @@ taskq_create(const char *name, int threads_arg, pri_t pri,

ASSERT(name != NULL);
ASSERT(minalloc >= 0);
ASSERT(maxalloc <= INT_MAX);
ASSERT(!(flags & (TASKQ_CPR_SAFE))); /* Unsupported */

/* Scale the number of threads using nthreads as a percentage */
Expand Down
2 changes: 1 addition & 1 deletion module/os/linux/zfs/zfs_file_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ zfs_file_seek(zfs_file_t *fp, loff_t *offp, int whence)
{
loff_t rc;

if (*offp < 0 || *offp > MAXOFFSET_T)
if (*offp < 0)
return (EINVAL);

rc = vfs_llseek(fp, *offp, whence);
Expand Down

0 comments on commit 373df0e

Please sign in to comment.