ntb.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] ntb_perf: fix doubletest cocci warning
@ 2022-04-19  7:18 Guo Zhengkui
  2022-04-19 15:37 ` Dave Jiang
  2022-04-19 15:49 ` Logan Gunthorpe
  0 siblings, 2 replies; 4+ messages in thread
From: Guo Zhengkui @ 2022-04-19  7:18 UTC (permalink / raw)
  To: Jon Mason, Dave Jiang, Allen Hubbe, Yang Li, Guo Zhengkui,
	Alexander Fomichev, Serge Semin, open list:NTB DRIVER CORE,
	open list
  Cc: zhengkui_guo

`!data->ops.init` has been repeated triple. The original logic is to
check whether `.init`, `.run` and `.clear` callbacks are NULL or not.

Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
---
 drivers/ntb/test/ntb_perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index c106c3a5097e..dcae4be91365 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -1451,7 +1451,7 @@ static void perf_ext_lat_work(struct work_struct *work)
 {
 	struct perf_ext_lat_data *data = to_ext_lat_data(work);
 
-	if (!data->ops.init || !data->ops.init || !data->ops.init) {
+	if (!data->ops.init || !data->ops.run || !data->ops.clear) {
 		struct perf_ctx *perf = data->perf;
 
 		data->status = -EFAULT;
-- 
2.20.1


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

* Re: [PATCH] ntb_perf: fix doubletest cocci warning
  2022-04-19  7:18 [PATCH] ntb_perf: fix doubletest cocci warning Guo Zhengkui
@ 2022-04-19 15:37 ` Dave Jiang
  2022-04-19 15:49 ` Logan Gunthorpe
  1 sibling, 0 replies; 4+ messages in thread
From: Dave Jiang @ 2022-04-19 15:37 UTC (permalink / raw)
  To: Guo Zhengkui, Jon Mason, Allen Hubbe, Yang Li,
	Alexander Fomichev, Serge Semin, open list:NTB DRIVER CORE,
	open list
  Cc: zhengkui_guo


On 4/19/2022 12:18 AM, Guo Zhengkui wrote:
> `!data->ops.init` has been repeated triple. The original logic is to
> check whether `.init`, `.run` and `.clear` callbacks are NULL or not.
>
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>


> ---
>   drivers/ntb/test/ntb_perf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
> index c106c3a5097e..dcae4be91365 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -1451,7 +1451,7 @@ static void perf_ext_lat_work(struct work_struct *work)
>   {
>   	struct perf_ext_lat_data *data = to_ext_lat_data(work);
>   
> -	if (!data->ops.init || !data->ops.init || !data->ops.init) {
> +	if (!data->ops.init || !data->ops.run || !data->ops.clear) {
>   		struct perf_ctx *perf = data->perf;
>   
>   		data->status = -EFAULT;

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

* Re: [PATCH] ntb_perf: fix doubletest cocci warning
  2022-04-19  7:18 [PATCH] ntb_perf: fix doubletest cocci warning Guo Zhengkui
  2022-04-19 15:37 ` Dave Jiang
@ 2022-04-19 15:49 ` Logan Gunthorpe
  2022-04-20  8:46   ` Alexander Fomichev
  1 sibling, 1 reply; 4+ messages in thread
From: Logan Gunthorpe @ 2022-04-19 15:49 UTC (permalink / raw)
  To: Guo Zhengkui, Jon Mason, Dave Jiang, Allen Hubbe, Yang Li,
	Alexander Fomichev, Serge Semin, open list:NTB DRIVER CORE,
	open list
  Cc: zhengkui_guo



On 2022-04-19 01:18, Guo Zhengkui wrote:
> `!data->ops.init` has been repeated triple. The original logic is to
> check whether `.init`, `.run` and `.clear` callbacks are NULL or not.
> 
> Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>

This appears to be a patch against Alexander's patch which has not been
accepted yet. Posting a note on his patch so he fixes it for the next
posting would be preferable.

Logan

> ---
>  drivers/ntb/test/ntb_perf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
> index c106c3a5097e..dcae4be91365 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -1451,7 +1451,7 @@ static void perf_ext_lat_work(struct work_struct *work)
>  {
>  	struct perf_ext_lat_data *data = to_ext_lat_data(work);
>  
> -	if (!data->ops.init || !data->ops.init || !data->ops.init) {
> +	if (!data->ops.init || !data->ops.run || !data->ops.clear) {
>  		struct perf_ctx *perf = data->perf;
>  
>  		data->status = -EFAULT;

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

* Re: [PATCH] ntb_perf: fix doubletest cocci warning
  2022-04-19 15:49 ` Logan Gunthorpe
@ 2022-04-20  8:46   ` Alexander Fomichev
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Fomichev @ 2022-04-20  8:46 UTC (permalink / raw)
  To: Logan Gunthorpe
  Cc: Guo Zhengkui, Jon Mason, Dave Jiang, Allen Hubbe, Yang Li,
	Serge Semin, open list:NTB DRIVER CORE, open list, zhengkui_guo

Thanks, nice catch.
I'll include it into the next patch version.

Regards,
Alexander.

вт, 19 апр. 2022 г. в 18:50, Logan Gunthorpe <logang@deltatee.com>:
>
>
>
> On 2022-04-19 01:18, Guo Zhengkui wrote:
> > `!data->ops.init` has been repeated triple. The original logic is to
> > check whether `.init`, `.run` and `.clear` callbacks are NULL or not.
> >
> > Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
>
> This appears to be a patch against Alexander's patch which has not been
> accepted yet. Posting a note on his patch so he fixes it for the next
> posting would be preferable.
>
> Logan
>
> > ---
> >  drivers/ntb/test/ntb_perf.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
> > index c106c3a5097e..dcae4be91365 100644
> > --- a/drivers/ntb/test/ntb_perf.c
> > +++ b/drivers/ntb/test/ntb_perf.c
> > @@ -1451,7 +1451,7 @@ static void perf_ext_lat_work(struct work_struct *work)
> >  {
> >       struct perf_ext_lat_data *data = to_ext_lat_data(work);
> >
> > -     if (!data->ops.init || !data->ops.init || !data->ops.init) {
> > +     if (!data->ops.init || !data->ops.run || !data->ops.clear) {
> >               struct perf_ctx *perf = data->perf;
> >
> >               data->status = -EFAULT;

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

end of thread, other threads:[~2022-04-20  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19  7:18 [PATCH] ntb_perf: fix doubletest cocci warning Guo Zhengkui
2022-04-19 15:37 ` Dave Jiang
2022-04-19 15:49 ` Logan Gunthorpe
2022-04-20  8:46   ` Alexander Fomichev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).