linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: CGEL <cgel.zte@gmail.com>
To: Oliver Neukum <oliver@neukum.org>
Cc: Ali Akcaagac <aliakc@web.de>, Jamie Lenehan <lenehan@twibble.org>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	dc395x@twibble.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	jing yangyang <jing.yangyang@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH linux-next] scsi/dc395x: Use bitwise instead of arithmetic operator for flags
Date: Thu, 19 Aug 2021 20:04:07 -0700	[thread overview]
Message-ID: <20210820030407.12313-1-jing.yangyang@zte.com.cn> (raw)

From: jing yangyang <jing.yangyang@zte.com.cn>

This silences the following coccinelle warning:

"WARNING: sum of probable bitmasks, consider |"

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang@zte.com.cn>
---
 drivers/scsi/dc395x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 24c7cef..fbac95b 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -761,7 +761,7 @@ static void waiting_process_next(struct AdapterCtlBlk *acb)
 	struct list_head *dcb_list_head = &acb->dcb_list;
 
 	if (acb->active_dcb
-	    || (acb->acb_flag & (RESET_DETECT + RESET_DONE + RESET_DEV)))
+	    || (acb->acb_flag & (RESET_DETECT | RESET_DONE | RESET_DEV)))
 		return;
 
 	if (timer_pending(&acb->waiting_timer))
@@ -844,7 +844,7 @@ static void send_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb)
 
 	if (dcb->max_command <= list_size(&dcb->srb_going_list) ||
 	    acb->active_dcb ||
-	    (acb->acb_flag & (RESET_DETECT + RESET_DONE + RESET_DEV))) {
+	    (acb->acb_flag & (RESET_DETECT | RESET_DONE | RESET_DEV))) {
 		list_add_tail(&srb->list, &dcb->srb_waiting_list);
 		waiting_process_next(acb);
 		return;
@@ -1127,7 +1127,7 @@ static void reset_dev_param(struct AdapterCtlBlk *acb)
 	list_for_each_entry(dcb, &acb->dcb_list, list) {
 		u8 period_index;
 
-		dcb->sync_mode &= ~(SYNC_NEGO_DONE + WIDE_NEGO_DONE);
+		dcb->sync_mode &= ~(SYNC_NEGO_DONE | WIDE_NEGO_DONE);
 		dcb->sync_period = 0;
 		dcb->sync_offset = 0;
 
@@ -1685,7 +1685,7 @@ static void msgout_phase0(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
 		u16 *pscsi_status)
 {
 	dprintkdbg(DBG_0, "msgout_phase0: (0x%p)\n", srb->cmd);
-	if (srb->state & (SRB_UNEXPECT_RESEL + SRB_ABORT_SENT))
+	if (srb->state & (SRB_UNEXPECT_RESEL | SRB_ABORT_SENT))
 		*pscsi_status = PH_BUS_FREE;	/*.. initial phase */
 
 	DC395x_write16(acb, TRM_S1040_SCSI_CONTROL, DO_DATALATCH);	/* it's important for atn stop */
@@ -2901,7 +2901,7 @@ static void disconnect(struct AdapterCtlBlk *acb)
 		doing_srb_done(acb, DID_ABORT, srb->cmd, 1);
 		waiting_process_next(acb);
 	} else {
-		if ((srb->state & (SRB_START_ + SRB_MSGOUT))
+		if ((srb->state & (SRB_START_ | SRB_MSGOUT))
 		    || !(srb->
 			 state & (SRB_DISCONNECT | SRB_COMPLETED))) {
 			/*
-- 
1.8.3.1



                 reply	other threads:[~2021-08-20  3:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210820030407.12313-1-jing.yangyang@zte.com.cn \
    --to=cgel.zte@gmail.com \
    --cc=aliakc@web.de \
    --cc=dc395x@twibble.org \
    --cc=jejb@linux.ibm.com \
    --cc=jing.yangyang@zte.com.cn \
    --cc=lenehan@twibble.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=oliver@neukum.org \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).