Implicit is the assumption that NULL is always 0, which isn't actually
a specification, merely a convention of the compiler that NULL is
actually something like:

#define NULL (void *) 0

While unusual for a compiler to declare NULL to be something other
than 0, it would be legal C, depending on the processor architecture.
I'd definitely favour the more explicit ptr == NULL since you are then
articulating that you are checking against a NULL pointer, rather than
doing an implicit cast to an integer before then inverting the
implicit comparison against 0.