mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Patch v2] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
@ 2019-05-19  9:34 Hariprasad Kelam
       [not found] ` <b32e6bca-60ec-2004-f1d6-16d2b8a478ae@aol.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Hariprasad Kelam @ 2019-05-19  9:34 UTC (permalink / raw)
  To: Gao Xiang, Chao Yu, Greg Kroah-Hartman, linux-erofs, devel, linux-kernel

fix below warning reported by  coccicheck

drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON
instead of if condition followed by BUG.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
-----
Changes in v2:
  - replace BUG_ON with  DBG_BUGON
-----
---
 drivers/staging/erofs/unzip_pagevec.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/erofs/unzip_pagevec.h b/drivers/staging/erofs/unzip_pagevec.h
index f37d8fd..7938ee3 100644
--- a/drivers/staging/erofs/unzip_pagevec.h
+++ b/drivers/staging/erofs/unzip_pagevec.h
@@ -70,8 +70,7 @@ z_erofs_pagevec_ctor_next_page(struct z_erofs_pagevec_ctor *ctor,
 			return tagptr_unfold_ptr(t);
 	}
 
-	if (unlikely(nr >= ctor->nr))
-		BUG();
+	DBG_BUGON(nr >= ctor->nr);
 
 	return NULL;
 }
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch v2] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
       [not found] ` <b32e6bca-60ec-2004-f1d6-16d2b8a478ae@aol.com>
@ 2019-05-19 10:11   ` Hariprasad Kelam
  0 siblings, 0 replies; 3+ messages in thread
From: Hariprasad Kelam @ 2019-05-19 10:11 UTC (permalink / raw)
  To: Gao Xiang, Gao Xiang, Chao Yu, Greg Kroah-Hartman, linux-erofs,
	devel, linux-kernel

On Sun, May 19, 2019 at 05:50:40PM +0800, Gao Xiang wrote:
> 
> 
> On 2019/5/19 下午5:34, Hariprasad Kelam wrote:
> > fix below warning reported by  coccicheck
> > 
> > drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON
> > instead of if condition followed by BUG.
> > 
> > Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> > -----
> > Changes in v2:
> >   - replace BUG_ON with  DBG_BUGON
> > -----
> > ---
> >  drivers/staging/erofs/unzip_pagevec.h | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/erofs/unzip_pagevec.h b/drivers/staging/erofs/unzip_pagevec.h
> > index f37d8fd..7938ee3 100644
> > --- a/drivers/staging/erofs/unzip_pagevec.h
> > +++ b/drivers/staging/erofs/unzip_pagevec.h
> > @@ -70,8 +70,7 @@ z_erofs_pagevec_ctor_next_page(struct z_erofs_pagevec_ctor *ctor,
> >  			return tagptr_unfold_ptr(t);
> >  	}
> >  
> 
> I'd like to delete this line
> 
> > -	if (unlikely(nr >= ctor->nr))
> > -		BUG();
> > +	DBG_BUGON(nr >= ctor->nr);
> >  
> 
> and this line.. I have already sent a new patch based on your v1 patch,
> could you please check it out if it is acceptable for you? :)
> 
> Thanks,
> Gao Xiang

Hi Gai Xiang,

The patch which you sent has all required. 
Thanks for the  patch. We can ignore this v2 patch.

Thanks,
Hariprasad k



> >  	return NULL;
> >  }
> > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG
       [not found] ` <20190519093557.20982-1-hsiangkao@aol.com>
@ 2019-05-20  2:19   ` Chao Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2019-05-20  2:19 UTC (permalink / raw)
  To: Gao Xiang, Greg Kroah-Hartman
  Cc: linux-erofs, devel, LKML, Hariprasad Kelam, Gao Xiang

On 2019/5/19 17:35, Gao Xiang wrote:
> From: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> 
> fix below warning reported by  coccicheck
> 
> drivers/staging/erofs/unzip_pagevec.h:74:2-5: WARNING: Use BUG_ON
> instead of if condition followed by BUG.
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> [ Gao Xiang: use DBG_BUGON instead of BUG_ON for eng version only. ]
> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-20  2:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-19  9:34 [Patch v2] staging: erofs: fix Warning Use BUG_ON instead of if condition followed by BUG Hariprasad Kelam
     [not found] ` <b32e6bca-60ec-2004-f1d6-16d2b8a478ae@aol.com>
2019-05-19 10:11   ` Hariprasad Kelam
  -- strict thread matches above, loose matches on Subject: below --
2019-05-18 17:33 [PATCH] " Hariprasad Kelam
     [not found] ` <20190519093557.20982-1-hsiangkao@aol.com>
2019-05-20  2:19   ` [PATCH v2] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®