drm: Zero out DRM object memory upon cleanup

Drivers where the DRM objects have a lifetime that extends beyond that
of the DRM device need to zero out the DRM object memory to void stale
data such as properties. The DRM core code expects to operate on newly
allocated and zeroed out objects and will behave unexpectedly, such as
add duplicate properties, otherwise.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm/tegra: Remove redundant zeroing out of memory

The DRM core now zeroes out the memory associated with CRTC, encoder and
connector objects upon cleanup, so there's no need to explicitly do that
in drivers anymore.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm: Miscellaneous checkpatch whitespace cleanups

A couple of whitespace changes required to silent various errors and
warnings flagged by checkpatch.

checkpatch requires that the opening brace be on the same line as a
variable declaration. Furthermore an empty line is required after a
block of variable declarations. Trailing whitespace as well as using
spaces before tabs is considered an error or warning, respectively.
Finally, the closing parenthesis of an if condition and the opening
brace of the conditional block should be separated by a space.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm: Prefer kcalloc() over kzalloc() with multiply

Fixes a couple of checkpatch warnings regarding the use of kzalloc()
with a multiplication. kcalloc() is the preferred API.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm: Prefer kmalloc_array() over kmalloc() with multiply

Fixes a couple of checkpatch warnings regarding the use of kmalloc()
with a multiplication. kmalloc_array() is the preferred API.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm: Do not assign in if condition

checkpatch requires the assignment and the check to be separate
statements.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm: Remove unneeded braces for single statement blocks

Single statement blocks don't need to be enclosed in a pair of braces.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm: Remove useless else block

All prior conditional blocks return from the function, so the else block
can be at the top level of the function.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm: Prefer sizeof(type) over sizeof type

sizeof(type) is the variant used most commonly and required by
checkpatch.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drm/cache: Implement drm_clflush_*() for ARM

Add implementations for drm_clflush_*() on ARM by borrowing code from
the DMA mapping API implementation. Unfortunately ARM doesn't export an
API to flush caches on a page by page basis, so this replicates most of
the code.

Signed-off-by: Thierry Reding <treding@nvidia.com>
WIP