On Thu, Jun 04, 2020 at 09:48:49AM -0400, Jim Quinlan wrote:
> > > +     r = devm_kcalloc(dev, 1, sizeof(struct dma_pfn_offset_region),
> > > +                      GFP_KERNEL);
> >
> > Use:    r = devm_kzalloc(dev, sizeof(*r), GFP_KERNEL);
> Will fix.
> 
> >
> >
> > > +     if (!r)
> > > +             return -ENOMEM;
> > > +
> > > +     r->uniform_offset = true;
> > > +     r->pfn_offset = pfn_offset;
> > > +
> > > +     return 0;
> > > +}
> >
> > This function doesn't seem to do anything useful.  Is part of it
> > missing?
> No, the uniform pfn offset is a special case.

Sorry, I wasn't clear.  We're talking about different things.  The code
does:

        r = devm_kzalloc(dev, sizeof(*r), GFP_KERNEL);
        if (!r)
                return -ENOMEM;

        r->uniform_offset = true;
        r->pfn_offset = pfn_offset;

        return 0;

The code allocates "r" and then doesn't save it anywhere so there is
no point.

regards,
dan carpenter

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to