lkml.org 
[lkml]   [2023]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH v2] scsi: qla2xxx: Simplify if condition evaluation
    A logical evaluation of type (!A || A && B) can be simplified as
    (!A || B).
    Improvement by suggested by excluded_middle.cocci Coccinelel semantic
    patch.

    Signed-off-by: Deepak R Varma <drv@mailo.com>
    ---
    Please note: Change is compile tested only.

    Changes in v2:
    - Correct the if evaluation from (A && B) to (!A || B). Feedback
    from Lee Duncan <lduncan@suse.com>

    drivers/scsi/qla2xxx/qla_target.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
    index 548f22705ddc..4f104fbfe55d 100644
    --- a/drivers/scsi/qla2xxx/qla_target.c
    +++ b/drivers/scsi/qla2xxx/qla_target.c
    @@ -1028,8 +1028,7 @@ void qlt_free_session_done(struct work_struct *work)
    }

    if (ha->flags.edif_enabled &&
    - (!own || (own &&
    - own->iocb.u.isp24.status_subcode == ELS_PLOGI))) {
    + (!own || own->iocb.u.isp24.status_subcode == ELS_PLOGI)) {
    sess->edif.authok = 0;
    if (!ha->flags.host_shutting_down) {
    ql_dbg(ql_dbg_edif, vha, 0x911e,
    --
    2.34.1


    \
     
     \ /
      Last update: 2023-03-26 23:37    [W:2.167 / U:0.616 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site