[PATCH 07/13] drm/via: Remove unecessary NULL check

David Herrmann dh.herrmann at gmail.com
Mon Apr 7 08:51:28 PDT 2014


Hi

On Sat, Apr 5, 2014 at 11:44 AM, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> The context_dtor callback is only called once we've successfully loaded
> the driver, which means dev->dev_private is set up. The check is hence
> pointless.
>
> Also dev->dev_private is deref already above, so compilers are free
> to elide it anyway.

Are you sure compilers can assume "*ptr" implies "ptr != NULL"? I
doubt that and depending on CONFIG_DEFAULT_MMAP_MIN_ADDR I think you
can even build user-space that can successfully mmap(MAP_FIXED) at
address 0. Anyhow, I guess no-one cares besides me, so patch looks
good :)

Thanks
David


More information about the dri-devel mailing list