Re: [PATCH v2 2/4] staging: media: atomisp: inline macros for checking the bo/bodev pointer
From: Andy Shevchenko
Date: Wed Aug 12 2026 - 03:56:49 EST
On Wed, Aug 12, 2026 at 10:49:17AM +0300, Andy Shevchenko wrote:
> On Thu, Jul 23, 2026 at 09:51:19PM +0300, Nikolay Kulikov wrote:
...
> > struct hmm_buffer_object *hmm_bo_alloc(struct hmm_bo_device *bdev,
> > unsigned int pgnr)
> > {
> > struct hmm_buffer_object *bo, *new_bo;
> > - struct rb_root *root = &bdev->free_rbtree;
> > + struct rb_root *root;
> > +
> > + if (!bdev) {
> > + dev_err(atomisp_dev, "NULL hmm_bo_device.\n");
> > + return NULL;
> > + }
> >
> > - check_bodev_null_return(bdev, NULL);
> > + root = &bdev->free_rbtree;
> > var_equal_return(hmm_bo_device_inited(bdev), 0, NULL,
> > "hmm_bo_device not inited yet.\n");
>
> While at it, also replace here var_equal_return() with appropriate C code.
Ah, it's done in the last patch!
--
With Best Regards,
Andy Shevchenko