1. 18 Oct, 2018 27 commits
  2. 17 Oct, 2018 9 commits
  3. 16 Oct, 2018 4 commits
    • YueHaibing's avatar
      scsi: megaraid_mbox: remove set but not used variables · 13eb34b6
      YueHaibing authored
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/scsi/megaraid/megaraid_mbox.c: In function 'megaraid_reset_handler':
      drivers/scsi/megaraid/megaraid_mbox.c:2580:7: warning:
       variable 'recovering' set but not used [-Wunused-but-set-variable]
      
      drivers/scsi/megaraid/megaraid_mbox.c: In function 'mbox_post_sync_cmd':
      drivers/scsi/megaraid/megaraid_mbox.c:2728:12: warning:
       variable 'mbox64' set but not used [-Wunused-but-set-variable]
      
      drivers/scsi/megaraid/megaraid_mbox.c: In function 'megaraid_mbox_support_random_del':
      drivers/scsi/megaraid/megaraid_mbox.c:3138:11: warning:
       variable 'mbox' set but not used [-Wunused-but-set-variable]
      
      drivers/scsi/megaraid/megaraid_mbox.c: In function 'megaraid_mbox_flush_cache':
      drivers/scsi/megaraid/megaraid_mbox.c:3266:10: warning:
       variable 'mbox' set but not used [-Wunused-but-set-variable]
      
      drivers/scsi/megaraid/megaraid_mbox.c: In function 'megaraid_mbox_fire_sync_cmd':
      drivers/scsi/megaraid/megaraid_mbox.c:3302:12: warning:
       variable 'mbox64' set but not used [-Wunused-but-set-variable]
      
      drivers/scsi/megaraid/megaraid_mbox.c: In function 'gather_hbainfo':
      drivers/scsi/megaraid/megaraid_mbox.c:3797:10: warning:
       variable 'dmajor' set but not used [-Wunused-but-set-variable]
      
      [mkp: applied by hand due to conflict with hch's DMA cleanup]
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      13eb34b6
    • Nathan Chancellor's avatar
      scsi: qla2xxx: Simplify conditional check · 0bfe7d3c
      Nathan Chancellor authored
      Clang generates a warning when it sees a logical not followed by a
      conditional operator like ==, >, or < because it thinks that the logical
      not should be applied to the whole statement:
      
      drivers/scsi/qla2xxx/qla_nx.c:3702:7: warning: logical not is only
      applied to the left hand side of this comparison
      [-Wlogical-not-parentheses]
                      if (!qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
                          ^
      drivers/scsi/qla2xxx/qla_nx.c:3702:7: note: add parentheses after the
      '!' to evaluate the comparison first
                      if (!qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
                          ^
                           (
      drivers/scsi/qla2xxx/qla_nx.c:3702:7: note: add parentheses around left
      hand side expression to silence this warning
                      if (!qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
                          ^
                          (
      1 warning generated.
      
      It assumes the author might have made a mistake in their logic:
      
      if (!a == b) -> if (!(a == b))
      
      Sometimes that is the case; other times, it's just a super convoluted
      way of saying 'if (a)' when b = 0:
      
      if (!1 == 0) -> if (0 == 0) -> if (true)
      
      Alternatively:
      
      if (!1 == 0) -> if (!!1) -> if (1)
      
      Simplify this comparison so that Clang doesn't complain.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/80Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      0bfe7d3c
    • Nathan Chancellor's avatar
      scsi: bfa: Remove unused functions · 6498cbc5
      Nathan Chancellor authored
      Clang warns when a variable is assigned to itself.
      
      drivers/scsi/bfa/bfa_fcbuild.c:199:6: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              len = len;
              ~~~ ^ ~~~
      drivers/scsi/bfa/bfa_fcbuild.c:838:6: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              len = len;
              ~~~ ^ ~~~
      drivers/scsi/bfa/bfa_fcbuild.c:917:6: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              len = len;
              ~~~ ^ ~~~
      drivers/scsi/bfa/bfa_fcbuild.c:981:6: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              len = len;
              ~~~ ^ ~~~
      drivers/scsi/bfa/bfa_fcbuild.c:1008:6: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              len = len;
              ~~~ ^ ~~~
      5 warnings generated.
      
      This construct is usually used to avoid unused variable warnings, which
      I assume is the case here. -Wunused-parameter is hidden behind -Wextra
      with GCC 4.6, which is the minimum version to compile the kernel as of
      commit cafa0010 ("Raise the minimum required gcc version to 4.6").
      
      However, upon further inspection, these functions aren't actually used
      anywhere; they're just defined. Rather than just removing the self
      assignments, remove all of this dead code.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/148Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      6498cbc5
    • Nathan Chancellor's avatar
      scsi: qla2xxx: Remove unnecessary self assignment · 3e59790e
      Nathan Chancellor authored
      Clang warns when a variable is assigned to itself.
      
      drivers/scsi/qla2xxx/qla_mbx.c:1514:4: warning: explicitly assigning
      value of variable of type 'uint64_t' (aka 'unsigned long long') to
      itself [-Wself-assign]
              l = l;
              ~ ^ ~
      1 warning generated.
      
      This construct is usually used to avoid unused variable warnings, which
      I assume is the case here. -Wunused-parameter is hidden behind -Wextra
      with GCC 4.6, which is the minimum version to compile the kernel as of
      commit cafa0010 ("Raise the minimum required gcc version to 4.6").
      Just remove this line to silence Clang.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/83Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      3e59790e