Commit 84eac32
ata: libata-scsi: simplify __ata_scsi_queuecmd()
This patch cleans up the code of __ata_scsi_queuecmd(). Since each
branch of the "if" condition check that scmd->cmd_len is not zero, move
this check out of the "if" to simplify the conditions being checked in
the "else" branch.
While at it, avoid the if-else-if-else structure using if-else if
structure and remove the redundant rc local variable.
This patch does not change the function logic.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>1 parent db6a3f4 commit 84eac32
1 file changed
Lines changed: 21 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3958 | 3958 | | |
3959 | 3959 | | |
3960 | 3960 | | |
3961 | | - | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
3962 | 3964 | | |
3963 | 3965 | | |
3964 | | - | |
| 3966 | + | |
3965 | 3967 | | |
3966 | 3968 | | |
3967 | 3969 | | |
3968 | | - | |
3969 | | - | |
3970 | | - | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
3971 | 3973 | | |
3972 | | - | |
3973 | | - | |
3974 | | - | |
3975 | | - | |
3976 | | - | |
3977 | | - | |
3978 | | - | |
3979 | | - | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
3980 | 3978 | | |
3981 | | - | |
3982 | | - | |
3983 | | - | |
3984 | | - | |
3985 | | - | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
3986 | 3984 | | |
3987 | | - | |
3988 | | - | |
| 3985 | + | |
3989 | 3986 | | |
3990 | 3987 | | |
3991 | 3988 | | |
3992 | | - | |
3993 | | - | |
3994 | | - | |
| 3989 | + | |
3995 | 3990 | | |
3996 | | - | |
| 3991 | + | |
| 3992 | + | |
| 3993 | + | |
3997 | 3994 | | |
3998 | 3995 | | |
3999 | 3996 | | |
| |||
0 commit comments