dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Omer Shpigelman <oshpigelman@habana.ai>
Cc: kbuild-all@01.org, dri-devel@lists.freedesktop.org
Subject: [gabbayo:habanalabs-next 23/24] drivers/misc//habanalabs/habanalabs_ioctl.c:149:29: warning: cast to pointer from integer of different size
Date: Tue, 2 Apr 2019 17:36:33 +0800	[thread overview]
Message-ID: <201904021723.K4aOmGsD%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3273 bytes --]

tree:   git://people.freedesktop.org/~gabbayo/linux habanalabs-next
head:   aaebb2539ebbebac78f31df2d6ea9f463a27cb8c
commit: 0778d45ef52dd3b9bc92765de7e7f97a80224a06 [23/24] habanalabs: add new IOCTL for debug, tracing and profiling
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 0778d45ef52dd3b9bc92765de7e7f97a80224a06
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=mips 

All warnings (new ones prefixed by >>):

   drivers/misc//habanalabs/habanalabs_ioctl.c: In function 'debug_coresight':
>> drivers/misc//habanalabs/habanalabs_ioctl.c:149:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      if (copy_from_user(input, (void __user *)args->input_ptr,
                                ^
   drivers/misc//habanalabs/habanalabs_ioctl.c:179:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      if (copy_to_user((void __user *)args->output_ptr, output,
                       ^

vim +149 drivers/misc//habanalabs/habanalabs_ioctl.c

   127	
   128	static int debug_coresight(struct hl_device *hdev, struct hl_debug_args *args)
   129	{
   130		struct hl_debug_params *params;
   131		void *input = NULL, *output = NULL;
   132		int rc;
   133	
   134		params = kzalloc(sizeof(*params), GFP_KERNEL);
   135		if (!params)
   136			return -ENOMEM;
   137	
   138		params->reg_idx = args->reg_idx;
   139		params->enable = args->enable;
   140		params->op = args->op;
   141	
   142		if (args->input_ptr && args->input_size) {
   143			input = kzalloc(args->input_size, GFP_KERNEL);
   144			if (!input) {
   145				rc = -ENOMEM;
   146				goto out;
   147			}
   148	
 > 149			if (copy_from_user(input, (void __user *)args->input_ptr,
   150					args->input_size)) {
   151				dev_err(hdev->dev,
   152					"copy from user failed in debug ioctl\n");
   153				rc = -EFAULT;
   154				goto out;
   155			}
   156	
   157			params->input = input;
   158		}
   159	
   160		if (args->output_ptr && args->output_size) {
   161			output = kzalloc(args->output_size, GFP_KERNEL);
   162			if (!output) {
   163				rc = -ENOMEM;
   164				goto out;
   165			}
   166	
   167			params->output = output;
   168			params->output_size = args->output_size;
   169		}
   170	
   171		rc = hdev->asic_funcs->debug_coresight(hdev, params);
   172		if (rc) {
   173			dev_err(hdev->dev,
   174				"debug coresight operation failed %d\n", rc);
   175			goto out;
   176		}
   177	
   178		if (output) {
   179			if (copy_to_user((void __user *)args->output_ptr, output,
   180					args->output_size)) {
   181				dev_err(hdev->dev,
   182					"copy to user failed in debug ioctl\n");
   183				rc = -EFAULT;
   184				goto out;
   185			}
   186		}
   187	
   188	out:
   189		kfree(params);
   190		kfree(output);
   191		kfree(input);
   192	
   193		return rc;
   194	}
   195	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 59282 bytes --]

[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

                 reply	other threads:[~2019-04-02  9:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201904021723.K4aOmGsD%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kbuild-all@01.org \
    --cc=oshpigelman@habana.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).