Re: [PATCH] smiapp: re-use clamp_t instead of min(..., max(...))

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sakari,

On Wednesday 24 July 2013 18:55:38 Sakari Ailus wrote:
> On Wed, Jul 24, 2013 at 06:49:24PM +0300, Andy Shevchenko wrote:
> > On Wed, Jul 24, 2013 at 6:45 PM, Sakari Ailus <sakari.ailus@xxxxxx> wrote:
> > 
> > []
> > 
> > >> +     max_m = clamp_t(u32, max_m,
> > >> sensor->limits[SMIAPP_LIMIT_SCALER_M_MIN], +                    
> > >> sensor->limits[SMIAPP_LIMIT_SCALER_M_MAX]);
> > > 
> > > Do you need clamp_t()? Wouldn't plain clamp() do?
> > 
> > The *_t variants are preferred due to they are faster (no type checking).
> > 
> > > I can change it if you're ok with that.
> > 
> > I don't know why you may choose clamp instead of clamp_t here. Are you
> > going to change variable types?
> 
> Probably not. But clamp() would serve as a sanity check vs. clamp_t() which
> just does the thing. I'd prefer clamp() --- the compiler will not spend much
> time on it anyway.

Should I take this patch in my tree ? If so, could you please repost it with 
clamp() instead of clamp_t(), and your SoB or Acked-by ?

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux