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
| ||
|
Date: Sat, 3 Nov 2012 21:30:24 +0100 From: Julia Lawall <Julia.Lawall@...6.fr> To: "James E.J. Bottomley" <JBottomley@...allels.com> Cc: kernel-janitors@...r.kernel.org, linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org Subject: [PATCH 7/8] drivers/scsi/scsi_transport_fc.c: drop if around WARN_ON From: Julia Lawall <Julia.Lawall@...6.fr> Just use WARN_ON rather than an if containing only WARN_ON(1). A simplified version of the semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e; @@ - if (e) WARN_ON(1); + WARN_ON(e); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr> --- drivers/scsi/scsi_transport_fc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index e894ca7..f54c945 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -1699,9 +1699,8 @@ fc_stat_show(const struct device *dev, char *buf, unsigned long offset) struct fc_host_statistics *stats; ssize_t ret = -ENOENT; - if (offset > sizeof(struct fc_host_statistics) || - offset % sizeof(u64) != 0) - WARN_ON(1); + WARN_ON(offset > sizeof(struct fc_host_statistics) || + offset % sizeof(u64) != 0); if (i->f->get_fc_host_stats) { stats = (i->f->get_fc_host_stats)(shost); -- 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