Re: [PATCH] clk: at91: remove unnecessary conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Dan Carpenter (2023-10-17 07:06:53)
> 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 <dan.carpenter@xxxxxxxxxx>
> ---

Applied to clk-next




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux