Skip to content

Commit

Permalink
drm: Reduce scope of 'state' variable
Browse files Browse the repository at this point in the history
Smaller scope reduces visibility of variable and makes usage of
uninitialized variable less possible.

Changes in v2:
	- separate declaration and initialization
Changes in v3:
	- add missing signed-off-by tag

Signed-off-by: Dawid Kurek <dawikur@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170615174556.GA8872@gmail.com
  • Loading branch information
Dawid Kurek authored and Sean Paul committed Jun 15, 2017
1 parent ae9d042 commit ac7c748
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ struct drm_atomic_state *
drm_atomic_state_alloc(struct drm_device *dev)
{
struct drm_mode_config *config = &dev->mode_config;
struct drm_atomic_state *state;

if (!config->funcs->atomic_state_alloc) {
struct drm_atomic_state *state;

state = kzalloc(sizeof(*state), GFP_KERNEL);
if (!state)
return NULL;
Expand Down

0 comments on commit ac7c748

Please sign in to comment.