diff mbox series

scsi: advansys: Remove unnecessary parentheses

Message ID 20180920205858.6035-1-natechancellor@gmail.com (mailing list archive)
State Accepted
Headers show
Series scsi: advansys: Remove unnecessary parentheses | expand

Commit Message

Nathan Chancellor Sept. 20, 2018, 8:58 p.m. UTC
Clang warns when multiple pairs of parentheses are used for a single
conditional statement.

drivers/scsi/advansys.c:6451:20: warning: equality comparison with
extraneous parentheses [-Wparentheses-equality]
                                if ((sdtr_data == 0xFF)) {
                                     ~~~~~~~~~~^~~~~~~
drivers/scsi/advansys.c:6451:20: note: remove extraneous parentheses
around the comparison to silence this warning
                                if ((sdtr_data == 0xFF)) {
                                    ~          ^      ~
drivers/scsi/advansys.c:6451:20: note: use '=' to turn this equality
comparison into an assignment
                                if ((sdtr_data == 0xFF)) {
                                               ^~
                                               =
1 warning generated.

Link: https://github.com/ClangBuiltLinux/linux/issues/155
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/scsi/advansys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen Sept. 21, 2018, 3:11 a.m. UTC | #1
Nathan,

> Clang warns when multiple pairs of parentheses are used for a single
> conditional statement.
>
> drivers/scsi/advansys.c:6451:20: warning: equality comparison with
> extraneous parentheses [-Wparentheses-equality]
>                                 if ((sdtr_data == 0xFF)) {
>                                      ~~~~~~~~~~^~~~~~~
> drivers/scsi/advansys.c:6451:20: note: remove extraneous parentheses
> around the comparison to silence this warning
>                                 if ((sdtr_data == 0xFF)) {
>                                     ~          ^      ~
> drivers/scsi/advansys.c:6451:20: note: use '=' to turn this equality
> comparison into an assignment
>                                 if ((sdtr_data == 0xFF)) {
>                                                ^~
>                                                =
> 1 warning generated.

Applied to 4.20/scsi-queue, thanks!
Hannes Reinecke Sept. 21, 2018, 5:57 a.m. UTC | #2
On 9/20/18 10:58 PM, Nathan Chancellor wrote:
> Clang warns when multiple pairs of parentheses are used for a single
> conditional statement.
> 
> drivers/scsi/advansys.c:6451:20: warning: equality comparison with
> extraneous parentheses [-Wparentheses-equality]
>                                  if ((sdtr_data == 0xFF)) {
>                                       ~~~~~~~~~~^~~~~~~
> drivers/scsi/advansys.c:6451:20: note: remove extraneous parentheses
> around the comparison to silence this warning
>                                  if ((sdtr_data == 0xFF)) {
>                                      ~          ^      ~
> drivers/scsi/advansys.c:6451:20: note: use '=' to turn this equality
> comparison into an assignment
>                                  if ((sdtr_data == 0xFF)) {
>                                                 ^~
>                                                 =
> 1 warning generated.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/155
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>   drivers/scsi/advansys.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
> index 713f69033f20..44c96199e00a 100644
> --- a/drivers/scsi/advansys.c
> +++ b/drivers/scsi/advansys.c
> @@ -6448,7 +6448,7 @@ static void AscIsrChipHalted(ASC_DVC_VAR *asc_dvc)
>   				sdtr_data =
>   				    AscCalSDTRData(asc_dvc, ext_msg.xfer_period,
>   						   ext_msg.req_ack_offset);
> -				if ((sdtr_data == 0xFF)) {
> +				if (sdtr_data == 0xFF) {
>   
>   					q_cntl |= QC_MSG_OUT;
>   					asc_dvc->init_sdtr &= ~target_id;
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Martin K. Petersen Sept. 26, 2018, 12:48 a.m. UTC | #3
Hannes,

> On 9/20/18 10:58 PM, Nathan Chancellor wrote:
>> Clang warns when multiple pairs of parentheses are used for a single
>> conditional statement.

Applied to 4.20/scsi-queue, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 713f69033f20..44c96199e00a 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -6448,7 +6448,7 @@  static void AscIsrChipHalted(ASC_DVC_VAR *asc_dvc)
 				sdtr_data =
 				    AscCalSDTRData(asc_dvc, ext_msg.xfer_period,
 						   ext_msg.req_ack_offset);
-				if ((sdtr_data == 0xFF)) {
+				if (sdtr_data == 0xFF) {
 
 					q_cntl |= QC_MSG_OUT;
 					asc_dvc->init_sdtr &= ~target_id;