# Re: \[RFC PATCH v2 06/20\] tracing/filters: Optimise scalar vs cpumask filtering when the user mask is a single CPU

- From: Steven Rostedt \<rostedt@goodmis.org\>
- Date: 2023-07-31 15:55:18 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2023/07/2285863
- Thread: https://ratatoskr.run/linux-trace-kernel/2023/07/2272830/t.md

```text
On Mon, 31 Jul 2023 15:07:52 +0300
Dan Carpenter [ref] wrote:

> On Sat, Jul 29, 2023 at 03:55:47PM -0400, Steven Rostedt wrote:
> > > @@ -1761,6 +1761,11 @@ static int parse_pred(const char *str, void *data,
> > >  				FILTER_PRED_FN_CPUMASK;
> > >  		} else if (field->filter_type == FILTER_CPU) {
> > >  			pred->fn_num = FILTER_PRED_FN_CPU_CPUMASK;
> > > +		} else if (single) {
> > > +			pred->op = pred->op == OP_BAND ? OP_EQ : pred->op;  
> > 
> > Nit, the above can be written as:
> > 
> > 			pred->op = pret->op != OP_BAND ? : OP_EQ;
> >   
> 
> Heh.  Those are not equivalent.  The right way to write this is:

You mean because of my typo?

> 
> 	if (pred->op == OP_BAND)
> 		pred->op = OP_EQ;

But sure, I'm fine with that, and it's probably more readable too.

-- Steve
```
