Re: [PATCH 09/34] drm: kselftest for drm_mm_insert_node()

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

 



On Wed, Dec 14, 2016 at 02:26:36PM +0200, Joonas Lahtinen wrote:
> On ma, 2016-12-12 at 11:53 +0000, Chris Wilson wrote:
> > Exercise drm_mm_insert_node(), check that we can't overfill a range and
> > that the lists are correct after reserving/removing.
> > 
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> 
> <SNIP>
> 
> > +static int __igt_insert(int count, u64 size)
> > +{
> 
> <SNIP>
> 
> > +	for (n = 0; n < count; n++) {
> > +		int err;
> > +
> > +		node = &nodes[n];
> > +		err = drm_mm_insert_node(&mm, node, size, 0,
> > +					 DRM_MM_SEARCH_DEFAULT);
> > +		if (err) {
> > +			pr_err("insert failed, step %d, start %llu\n",
> > +			       n, nodes[n].start);
> > +			ret = err;
> > +			goto out;
> > +		}
> > +
> > +		if (!drm_mm_node_allocated(node)) {
> > +			pr_err("inserted node not allocated! step %d, start %llu\n",
> > +			       n, node->start);
> > +			goto out;
> > +		}
> > +	}
> > +
> > +	/* Repeated use should then fail */
> > +	if (1) {
> 
> Why if (1)? What are you not telling me.

That I was too lazy to write a function and dislike bare '{' just to
instantiate a new local so use if(1) as an excuse to start a new block.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux