Re: [PATCH] ASoC: soc-dapm: Fix comparison of pointers

2014-12-12 Thread Mark Brown
On Fri, Dec 12, 2014 at 02:43:27PM +0100, Rasmus Villemoes wrote: > On Fri, Dec 12 2014, Mark Brown wrote: > > If we're worrying about standards conformance type stuff here this is > > also buggy since it's out of spec to compare pointers that are not part > > of the same array like this. Castin

Re: [PATCH] ASoC: soc-dapm: Fix comparison of pointers

2014-12-12 Thread Rasmus Villemoes
On Fri, Dec 12 2014, Mark Brown wrote: > On Tue, Dec 09, 2014 at 10:53:41PM +0100, Rasmus Villemoes wrote: > >> if (a->reg != b->reg) >> return a->reg - b->reg; >> -if (a->dapm != b->dapm) >> -return (unsigned long)a->dapm - (unsigned long)b->dapm; >> +if (a-

Re: [PATCH] ASoC: soc-dapm: Fix comparison of pointers

2014-12-12 Thread Mark Brown
On Tue, Dec 09, 2014 at 10:53:41PM +0100, Rasmus Villemoes wrote: > if (a->reg != b->reg) > return a->reg - b->reg; > - if (a->dapm != b->dapm) > - return (unsigned long)a->dapm - (unsigned long)b->dapm; > + if (a->dapm < b->dapm) > + return -1;