lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <919fe2b30810051825l4f0907d1ucc9ffe9f201ddc4f@mail.gmail.com>
Date:	Sun, 5 Oct 2008 21:25:06 -0400
From:	"M. Asselstine" <asselsm@...aster.ca>
To:	"Julia Lawall" <julia@...u.dk>
Cc:	schwidefsky@...ibm.com, heiko.carstens@...ibm.com,
	linux390@...ibm.com, linux-s390@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 2/2] drivers/s390/cio/chsc_sch.c: Correct use of ! and &

On Sat, Oct 4, 2008 at 4:05 PM, Julia Lawall <julia@...u.dk> wrote:
> From: Julia Lawall <julia@...u.dk>
>
> In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337, 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@...u.dk>
Reviewed-by: Mark Asselstine <mark.asselstine@...driver.com>

>
> ---
>  drivers/s390/cio/chsc_sch.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -u -p a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
> --- a/drivers/s390/cio/chsc_sch.c
> +++ b/drivers/s390/cio/chsc_sch.c
> @@ -261,7 +261,7 @@ static int chsc_examine_irb(struct chsc_
>  {
>        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;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ