diff options
| author | Dan Carpenter <[email protected]> | 2023-10-17 14:06:53 +0000 |
|---|---|---|
| committer | Stephen Boyd <[email protected]> | 2023-10-19 00:56:13 +0000 |
| commit | 43a354a21a6a21f050b95317148661a465108cba (patch) | |
| tree | 93bd2ef557636e34a108ef509676b398f7901388 /net/unix/unix_bpf.c | |
| parent | clk: ti: fix double free in of_ti_divider_clk_setup() (diff) | |
| download | kernel-43a354a21a6a21f050b95317148661a465108cba.tar.gz kernel-43a354a21a6a21f050b95317148661a465108cba.zip | |
clk: at91: remove unnecessary conditions
This code checks "if (parent_hw)" is non-NULL, but then it has more
checks if parent_hw is non-NULL on the lines inside the if statement.
It is a bit confusing.
For the else statement, keep in mind that at the start of the function
we checked:
if (!(parent_name || parent_hw))
return ERR_PTR(-EINVAL);
That check ensures that if parent_hw is NULL that means that parent_name
is non-NULL. At least one must always be non-NULL. So here again, the
checks inside the if statement can be removed.
In the original code, it was a bit confusing and you could easily get
the impression that "init.num_parents" could be zero. When we remove
the unnecessary checking it's more obvious that it's always set to 1.
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Claudiu Beznea <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Diffstat (limited to 'net/unix/unix_bpf.c')
0 files changed, 0 insertions, 0 deletions
