linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vmwgfx: remove redundant ret variable
@ 2022-01-12  8:24 cgel.zte
  2022-01-12 18:01 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-01-12  8:24 UTC (permalink / raw)
  To: linux-graphics-maintainer
  Cc: zackr, airlied, daniel, dri-devel, linux-kernel, Minghao Chi,
	Zeal Robot, CGEL ZTE

From: Minghao Chi <chi.minghao@zte.com.cn>

Return value from vmw_gem_object_create_with_handle() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
index 31aecc46624b..91b03f1dbbf0 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
@@ -778,18 +778,14 @@ int vmw_dumb_create(struct drm_file *file_priv,
 {
 	struct vmw_private *dev_priv = vmw_priv(dev);
 	struct vmw_buffer_object *vbo;
-	int ret;
 
 	args->pitch = args->width * ((args->bpp + 7) / 8);
 	args->size = ALIGN(args->pitch * args->height, PAGE_SIZE);
 
-	ret = vmw_gem_object_create_with_handle(dev_priv, file_priv,
+	return vmw_gem_object_create_with_handle(dev_priv, file_priv,
 						args->size, &args->handle,
 						&vbo);
 
-	return ret;
-}
-
 /**
  * vmw_bo_swap_notify - swapout notify callback.
  *
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/vmwgfx: remove redundant ret variable
  2022-01-12  8:24 [PATCH] drm/vmwgfx: remove redundant ret variable cgel.zte
@ 2022-01-12 18:01 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-01-12 18:01 UTC (permalink / raw)
  To: cgel.zte, linux-graphics-maintainer
  Cc: kbuild-all, airlied, CGEL ZTE, Zeal Robot, linux-kernel,
	Minghao Chi, dri-devel

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on next-20220112]
[cannot apply to v5.16]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/cgel-zte-gmail-com/drm-vmwgfx-remove-redundant-ret-variable/20220112-162527
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220113/202201130145.eexFh3na-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/3542ac844ea28aaa8528f5deb3ee52d1690f1f8a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review cgel-zte-gmail-com/drm-vmwgfx-remove-redundant-ret-variable/20220112-162527
        git checkout 3542ac844ea28aaa8528f5deb3ee52d1690f1f8a
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/vmwgfx/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/vmwgfx/vmwgfx_bo.c: In function 'vmw_dumb_create':
>> drivers/gpu/drm/vmwgfx/vmwgfx_bo.c:794:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     794 | void vmw_bo_swap_notify(struct ttm_buffer_object *bo)
         | ^~~~
   drivers/gpu/drm/vmwgfx/vmwgfx_bo.c:860:1: error: expected declaration or statement at end of input
     860 | }
         | ^
   At top level:
   drivers/gpu/drm/vmwgfx/vmwgfx_bo.c:853:6: warning: 'vmw_bo_is_vmw_bo' defined but not used [-Wunused-function]
     853 | bool vmw_bo_is_vmw_bo(struct ttm_buffer_object *bo)
         |      ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/vmwgfx/vmwgfx_bo.c:815:6: warning: 'vmw_bo_move_notify' defined but not used [-Wunused-function]
     815 | void vmw_bo_move_notify(struct ttm_buffer_object *bo,
         |      ^~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/vmwgfx/vmwgfx_bo.c:794:6: warning: 'vmw_bo_swap_notify' defined but not used [-Wunused-function]
     794 | void vmw_bo_swap_notify(struct ttm_buffer_object *bo)
         |      ^~~~~~~~~~~~~~~~~~


vim +794 drivers/gpu/drm/vmwgfx/vmwgfx_bo.c

e9431ea5076a91 Thomas Hellstrom 2018-06-19  761  
e9431ea5076a91 Thomas Hellstrom 2018-06-19  762  
e9431ea5076a91 Thomas Hellstrom 2018-06-19  763  /**
e9431ea5076a91 Thomas Hellstrom 2018-06-19  764   * vmw_dumb_create - Create a dumb kms buffer
e9431ea5076a91 Thomas Hellstrom 2018-06-19  765   *
e9431ea5076a91 Thomas Hellstrom 2018-06-19  766   * @file_priv: Pointer to a struct drm_file identifying the caller.
e9431ea5076a91 Thomas Hellstrom 2018-06-19  767   * @dev: Pointer to the drm device.
e9431ea5076a91 Thomas Hellstrom 2018-06-19  768   * @args: Pointer to a struct drm_mode_create_dumb structure
e9431ea5076a91 Thomas Hellstrom 2018-06-19  769   * Return: Zero on success, negative error code on failure.
e9431ea5076a91 Thomas Hellstrom 2018-06-19  770   *
e9431ea5076a91 Thomas Hellstrom 2018-06-19  771   * This is a driver callback for the core drm create_dumb functionality.
e9431ea5076a91 Thomas Hellstrom 2018-06-19  772   * Note that this is very similar to the vmw_bo_alloc ioctl, except
e9431ea5076a91 Thomas Hellstrom 2018-06-19  773   * that the arguments have a different format.
e9431ea5076a91 Thomas Hellstrom 2018-06-19  774   */
e9431ea5076a91 Thomas Hellstrom 2018-06-19  775  int vmw_dumb_create(struct drm_file *file_priv,
e9431ea5076a91 Thomas Hellstrom 2018-06-19  776  		    struct drm_device *dev,
e9431ea5076a91 Thomas Hellstrom 2018-06-19  777  		    struct drm_mode_create_dumb *args)
e9431ea5076a91 Thomas Hellstrom 2018-06-19  778  {
e9431ea5076a91 Thomas Hellstrom 2018-06-19  779  	struct vmw_private *dev_priv = vmw_priv(dev);
e9431ea5076a91 Thomas Hellstrom 2018-06-19  780  	struct vmw_buffer_object *vbo;
e9431ea5076a91 Thomas Hellstrom 2018-06-19  781  
e9431ea5076a91 Thomas Hellstrom 2018-06-19  782  	args->pitch = args->width * ((args->bpp + 7) / 8);
8afa13a0583f94 Zack Rusin       2021-12-06  783  	args->size = ALIGN(args->pitch * args->height, PAGE_SIZE);
e9431ea5076a91 Thomas Hellstrom 2018-06-19  784  
3542ac844ea28a Minghao Chi      2022-01-12  785  	return vmw_gem_object_create_with_handle(dev_priv, file_priv,
8afa13a0583f94 Zack Rusin       2021-12-06  786  						args->size, &args->handle,
8afa13a0583f94 Zack Rusin       2021-12-06  787  						&vbo);
e9431ea5076a91 Thomas Hellstrom 2018-06-19  788  
e9431ea5076a91 Thomas Hellstrom 2018-06-19  789  /**
e9431ea5076a91 Thomas Hellstrom 2018-06-19  790   * vmw_bo_swap_notify - swapout notify callback.
e9431ea5076a91 Thomas Hellstrom 2018-06-19  791   *
e9431ea5076a91 Thomas Hellstrom 2018-06-19  792   * @bo: The buffer object to be swapped out.
e9431ea5076a91 Thomas Hellstrom 2018-06-19  793   */
e9431ea5076a91 Thomas Hellstrom 2018-06-19 @794  void vmw_bo_swap_notify(struct ttm_buffer_object *bo)
e9431ea5076a91 Thomas Hellstrom 2018-06-19  795  {
e9431ea5076a91 Thomas Hellstrom 2018-06-19  796  	/* Is @bo embedded in a struct vmw_buffer_object? */
8afa13a0583f94 Zack Rusin       2021-12-06  797  	if (vmw_bo_is_vmw_bo(bo))
e9431ea5076a91 Thomas Hellstrom 2018-06-19  798  		return;
e9431ea5076a91 Thomas Hellstrom 2018-06-19  799  
e9431ea5076a91 Thomas Hellstrom 2018-06-19  800  	/* Kill any cached kernel maps before swapout */
e9431ea5076a91 Thomas Hellstrom 2018-06-19  801  	vmw_bo_unmap(vmw_buffer_object(bo));
e9431ea5076a91 Thomas Hellstrom 2018-06-19  802  }
e9431ea5076a91 Thomas Hellstrom 2018-06-19  803  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-12 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12  8:24 [PATCH] drm/vmwgfx: remove redundant ret variable cgel.zte
2022-01-12 18:01 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).