mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Manisha Chinthapally <manisha.chinthapally@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [mchinth:sep_socwatch_linux_5_16 1/1] drivers/platform/x86/sepdk/sep/ipt.c:325:5: warning: cast from pointer to integer of different size
Date: Thu, 3 Feb 2022 13:02:33 +0800	[thread overview]
Message-ID: <202202031233.Btxr10ZR-lkp@intel.com> (raw)

tree:   https://github.com/mchinth/linux sep_socwatch_linux_5_16
head:   4cbfca15a262729ae8557758b49226fe4769f582
commit: 4cbfca15a262729ae8557758b49226fe4769f582 [1/1] Platform/x86 Updated SEP/SOCPERF drivers to latest version
config: i386-randconfig-a003-20220131 (https://download.01.org/0day-ci/archive/20220203/202202031233.Btxr10ZR-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/mchinth/linux/commit/4cbfca15a262729ae8557758b49226fe4769f582
        git remote add mchinth https://github.com/mchinth/linux
        git fetch --no-tags mchinth sep_socwatch_linux_5_16
        git checkout 4cbfca15a262729ae8557758b49226fe4769f582
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/platform/x86/sepdk/sep/

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 >>):

   In file included from drivers/platform/x86/sepdk/inc/master.h:43,
                    from drivers/platform/x86/sepdk/sep/ipt.c:25:
   drivers/platform/x86/sepdk/sep/ipt.c: In function 'ipt_Allocate_Buffers':
>> drivers/platform/x86/sepdk/sep/ipt.c:325:5: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     325 |     (U64)(ipt_node_on_cpu(i).outbuf_virt_address) +
         |     ^
   drivers/platform/x86/sepdk/inc/linuxos.h:66:50: note: in definition of macro 'VIRT_TO_PHYS_ADDR'
      66 | #define VIRT_TO_PHYS_ADDR(va) ((U64)virt_to_phys(va))
         |                                                  ^~
>> drivers/platform/x86/sepdk/sep/ipt.c:323:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     323 |     .outbuf_phys_address[j] = VIRT_TO_PHYS_ADDR((
         |                                                 ^
   drivers/platform/x86/sepdk/inc/linuxos.h:66:50: note: in definition of macro 'VIRT_TO_PHYS_ADDR'
      66 | #define VIRT_TO_PHYS_ADDR(va) ((U64)virt_to_phys(va))
         |                                                  ^~
   drivers/platform/x86/sepdk/sep/ipt.c: In function 'IPT_TOPA_Flush':
   drivers/platform/x86/sepdk/sep/ipt.c:465:6: warning: variable 'data_size' set but not used [-Wunused-but-set-variable]
     465 |  U64 data_size = 0;
         |      ^~~~~~~~~


vim +325 drivers/platform/x86/sepdk/sep/ipt.c

   270	
   271	/*
   272	 * Initialize the IPT micro dispatch tables
   273	 */
   274	IPT_DISPATCH_NODE gen2_ipt = { .init = ipt_Initialize,
   275				       .fini = ipt_Finalize,
   276				       .enable = ipt_Enable,
   277				       .disable = ipt_Disable,
   278				       .flush = ipt_Flush };
   279	
   280	/* ------------------------------------------------------------------------- */
   281	/*!
   282	 * @fn          OS_STATUS ipt_Allocate_Buffers (VOID)
   283	 *
   284	 * @brief       Allocate memory and set up MSRs in preparation for IPT
   285	 *
   286	 * @param       NONE
   287	 *
   288	 * @return      OS_STATUS status
   289	 *
   290	 */
   291	static OS_STATUS ipt_Allocate_Buffers(VOID)
   292	{
   293		S32 i;
   294		U32 j;
   295	
   296		SEP_DRV_LOG_TRACE_IN("");
   297	
   298		for (i = 0; i < GLOBAL_STATE_num_cpus(driver_state); i++) {
   299			ipt_node_on_cpu(i).topa_virt_address =
   300				CONTROL_Allocate_Memory_Aligned((size_t)IPT_BUF_SIZE,
   301								TRUE);
   302			if (!(ipt_node_on_cpu(i).topa_virt_address)) {
   303				SEP_DRV_LOG_ERROR_TRACE_OUT(
   304					"IPT buffer allocation failed!");
   305				return OS_NO_MEM;
   306			}
   307			ipt_node_on_cpu(i).topa_phys_address =
   308				VIRT_TO_PHYS_ADDR(ipt_node_on_cpu(i).topa_virt_address);
   309			ipt_node_on_cpu(i).outbuf_virt_address =
   310				CONTROL_Allocate_Memory_Aligned(
   311					(size_t)IPT_BUF_SIZE * ipt_buffer_num, TRUE);
   312			if (!(ipt_node_on_cpu(i).outbuf_virt_address)) {
   313				SEP_DRV_LOG_ERROR_TRACE_OUT(
   314					"IPT buffer allocation failed!");
   315				return OS_NO_MEM;
   316			}
   317			SEP_DRV_LOG_TRACE("cpu%d topa_va=%llx, topa_pa=%llx", i,
   318					  ipt_node_on_cpu(i).topa_virt_address,
   319					  ipt_node_on_cpu(i).topa_phys_address);
   320	
   321			for (j = 0; j < ipt_buffer_num; j++) {
   322				ipt_node_on_cpu(i)
 > 323					.outbuf_phys_address[j] = VIRT_TO_PHYS_ADDR((
   324					PVOID)(
 > 325					(U64)(ipt_node_on_cpu(i).outbuf_virt_address) +
   326					j * IPT_BUF_SIZE));
   327				((U64 *)ipt_node_on_cpu(i).topa_virt_address)[j] =
   328					ipt_node_on_cpu(i).outbuf_phys_address[j];
   329				SEP_DRV_LOG_TRACE(
   330					"cpu%d buffer%d outbuf_pa=%llx", i, j,
   331					ipt_node_on_cpu(i).outbuf_phys_address[j]);
   332			}
   333		}
   334	
   335		SEP_DRV_LOG_TRACE_OUT("");
   336		return OS_SUCCESS;
   337	}
   338	

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

                 reply	other threads:[~2022-02-03  5:02 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=202202031233.Btxr10ZR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manisha.chinthapally@intel.com \
    /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

all inboxes | Powered by JetHome®