public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Julia Lawall <julia@diku.dk>
Cc: trivial@kernel.org, kernel-janitors@vger.kernel.org,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	target-devel <target-devel@vger.kernel.org>
Subject: Re: [PATCH 9/11] drivers/target/target_core_rd.c: trivial: use
Date: Thu, 04 Aug 2011 18:05:22 +0000	[thread overview]
Message-ID: <1312481122.22234.12.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <1312281304-11847-10-git-send-email-julia@diku.dk>

On Tue, 2011-08-02 at 12:35 +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
> 
> Use BUG_ON(x) rather than if(x) BUG();
> 
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ identifier x; @@
> -if (x) BUG();
> +BUG_ON(x);
> 
> @@ identifier x; @@
> -if (!x) BUG();
> +BUG_ON(!x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>
> 

Hi Julia,

Committed as 5acbe8a85d7 into lio-core-2.6.git/master, and will be
queued for the next round of target updates.

Thanks!

--nab

> ---
>  drivers/target/target_core_rd.c |   24 ++++++++----------------
>  1 file changed, 8 insertions(+), 16 deletions(-)
> 
> diff -u -p a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
> --- a/drivers/target/target_core_rd.c
> +++ b/drivers/target/target_core_rd.c
> @@ -390,12 +390,10 @@ static int rd_MEMCPY_read(struct rd_requ
>  				length = req->rd_size;
>  
>  			dst = sg_virt(&sg_d[i++]) + dst_offset;
> -			if (!dst)
> -				BUG();
> +			BUG_ON(!dst);
>  
>  			src = sg_virt(&sg_s[j]) + src_offset;
> -			if (!src)
> -				BUG();
> +			BUG_ON(!src);
>  
>  			dst_offset = 0;
>  			src_offset = length;
> @@ -415,8 +413,7 @@ static int rd_MEMCPY_read(struct rd_requ
>  				length = req->rd_size;
>  
>  			dst = sg_virt(&sg_d[i]) + dst_offset;
> -			if (!dst)
> -				BUG();
> +			BUG_ON(!dst);
>  
>  			if (sg_d[i].length = length) {
>  				i++;
> @@ -425,8 +422,7 @@ static int rd_MEMCPY_read(struct rd_requ
>  				dst_offset = length;
>  
>  			src = sg_virt(&sg_s[j++]) + src_offset;
> -			if (!src)
> -				BUG();
> +			BUG_ON(!src);
>  
>  			src_offset = 0;
>  			page_end = 1;
> @@ -510,12 +506,10 @@ static int rd_MEMCPY_write(struct rd_req
>  				length = req->rd_size;
>  
>  			src = sg_virt(&sg_s[i++]) + src_offset;
> -			if (!src)
> -				BUG();
> +			BUG_ON(!src);
>  
>  			dst = sg_virt(&sg_d[j]) + dst_offset;
> -			if (!dst)
> -				BUG();
> +			BUG_ON(!dst);
>  
>  			src_offset = 0;
>  			dst_offset = length;
> @@ -535,8 +529,7 @@ static int rd_MEMCPY_write(struct rd_req
>  				length = req->rd_size;
>  
>  			src = sg_virt(&sg_s[i]) + src_offset;
> -			if (!src)
> -				BUG();
> +			BUG_ON(!src);
>  
>  			if (sg_s[i].length = length) {
>  				i++;
> @@ -545,8 +538,7 @@ static int rd_MEMCPY_write(struct rd_req
>  				src_offset = length;
>  
>  			dst = sg_virt(&sg_d[j++]) + dst_offset;
> -			if (!dst)
> -				BUG();
> +			BUG_ON(!dst);
>  
>  			dst_offset = 0;
>  			page_end = 1;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2011-08-04 18:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 10:34 [PATCH 0/11] trivial: use BUG_ON Julia Lawall
2011-08-02 10:34 ` [PATCH 1/11] kernel/kfifo.c: " Julia Lawall
2011-08-02 11:33   ` Andrea Righi
2011-08-02 11:52     ` Julia Lawall
2011-08-02 12:03       ` Andrea Righi
2011-08-02 15:20         ` Julia Lawall
2011-08-02 19:27       ` Julia Lawall
2011-08-02 20:09         ` Andrea Righi
2011-08-03  6:30       ` Stefani Seibold
2011-08-02 10:34 ` [PATCH 2/11] drivers/message/fusion/mptsas.c: " Julia Lawall
2011-08-04  6:54   ` [PATCH 2/11] drivers/message/fusion/mptsas.c: trivial: use Nandigama, Nagalakshmi
2011-08-04  7:13   ` [PATCH 2/11] drivers/message/fusion/mptsas.c: trivial: use BUG_ON walter harms
2011-08-02 10:34 ` [PATCH 3/11] arch/arm/mach-s3c64xx/dma.c: " Julia Lawall
2011-08-02 10:34 ` [PATCH 4/11] arch/x86/kvm/vmx.c: " Julia Lawall
2011-08-02 16:44   ` Marcelo Tosatti
2011-08-02 10:34 ` [PATCH 5/11] kernel/sysctl.c: " Julia Lawall
2011-08-02 10:34 ` [PATCH 6/11] drivers/iommu/iommu.c: " Julia Lawall
2011-08-02 10:35 ` [PATCH 7/11] arch/m32r/kernel/smp.c: " Julia Lawall
2011-08-02 10:55   ` KOSAKI Motohiro
2011-08-02 10:35 ` [PATCH 8/11] fs/btrfs/volumes.c: " Julia Lawall
2011-08-02 10:35 ` [PATCH 9/11] drivers/target/target_core_rd.c: " Julia Lawall
2011-08-04 18:05   ` Nicholas A. Bellinger [this message]
2011-08-02 10:35 ` [PATCH 10/11] arch/openrisc/mm/init.c: " Julia Lawall
2011-08-02 13:55   ` Jonas Bonn
2011-08-02 10:35 ` [PATCH 11/11] arch/tile/mm/init.c: " Julia Lawall
2011-08-02 20:28   ` Chris Metcalf

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=1312481122.22234.12.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=target-devel@vger.kernel.org \
    --cc=trivial@kernel.org \
    /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