All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] drm/amdgpu: page retire over debugfs mechanism
@ 2021-04-13  9:44 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-04-13  9:44 UTC (permalink / raw)
  To: john.clements; +Cc: amd-gfx

Hello John Clements,

The patch cbb8f989d5a0: "drm/amdgpu: page retire over debugfs
mechanism" from Apr 9, 2021, leads to the following static checker
warning:

	drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:377 amdgpu_ras_debugfs_ctrl_write()
	info: return a literal instead of 'ret'

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
   366          ret = amdgpu_ras_debugfs_ctrl_parse_data(f, buf, size, pos, &data);
   367          if (ret)
   368                  return -EINVAL;
   369  
   370          if (data.op == 3)
   371          {
                ^
Please use scripts/checkpatch.pl...  :(  Bonus points for replacing the
magic number 3 with a define?

   372                  ret = amdgpu_reserve_page_direct(adev, data.inject.address);
   373  
   374                  if (ret)
   375                          return size;
   376                  else
   377                          return ret;

This static checker warning is disguised as a style warning, but it's
really to detect code like this where the if statements are reversed as
appears to be the case here.

		ret = amdgpu_reserve_page_direct(adev, data.inject.address);
		if (ret)
			return ret;

		return size;

   378          }
   379  
   380          if (!amdgpu_ras_is_supported(adev, data.head.block))
   381                  return -EINVAL;

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-13  9:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-13  9:44 [bug report] drm/amdgpu: page retire over debugfs mechanism Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.