Skip to content

Commit

Permalink
[S390] cio: Correct use of ! and &
Browse files Browse the repository at this point in the history
In commit e6bafba, a bug was fixed that
involved converting !x & y to !(x & y).  The code below shows the same
pattern, and thus should perhaps be fixed in the same way.  In particular,
the result of !scsw_stctl(&request->irb.scsw) & SCSW_STCTL_STATUS_PEND is
always just !scsw_stctl(&request->irb.scsw).

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E; constant C; @@
(
  !E & !C
|
- !E & C
+ !(E & C)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Julia Lawall authored and Martin Schwidefsky committed Oct 10, 2008
1 parent f9c9fe3 commit b2bbb64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/cio/chsc_sch.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static int chsc_examine_irb(struct chsc_request *request)
{
int backed_up;

if (!scsw_stctl(&request->irb.scsw) & SCSW_STCTL_STATUS_PEND)
if (!(scsw_stctl(&request->irb.scsw) & SCSW_STCTL_STATUS_PEND))
return -EIO;
backed_up = scsw_cstat(&request->irb.scsw) & SCHN_STAT_CHAIN_CHECK;
request->irb.scsw.cmd.cstat &= ~SCHN_STAT_CHAIN_CHECK;
Expand Down

0 comments on commit b2bbb64

Please sign in to comment.