All of lore.kernel.org
 help / color / mirror / Atom feed
* [freescale-fslc:pr/621 3164/20208] drivers/firmware/imx/imx-scu.c:228:43: warning: cast from pointer to integer of different size
@ 2023-02-04 21:03 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-02-04 21:03 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: oe-kbuild-all

Hi Peng,

FYI, the error/warning still remains.

tree:   https://github.com/Freescale/linux-fslc pr/621
head:   b9ae52e89c61eed5d446a9693d8bf0f55a5323e7
commit: d0d51c6537d06c23e9fceeb69b5e2f8275caadd7 [3164/20208] LF-202-1 firmware: imx: scu: use hvc for dom0
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20230205/202302050530.CsQmb5IC-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/Freescale/linux-fslc/commit/d0d51c6537d06c23e9fceeb69b5e2f8275caadd7
        git remote add freescale-fslc https://github.com/Freescale/linux-fslc
        git fetch --no-tags freescale-fslc pr/621
        git checkout d0d51c6537d06c23e9fceeb69b5e2f8275caadd7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/firmware/imx/ drivers/net/ethernet/freescale/fman/ drivers/pwm/ drivers/staging/ drivers/tty/serial/ net/ sound/soc/sof/intel/

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

All warnings (new ones prefixed by >>):

   In file included from drivers/firmware/imx/imx-scu.c:10:
   drivers/firmware/imx/imx-scu.c: In function 'imx_scu_call_rpc':
>> drivers/firmware/imx/imx-scu.c:228:43: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     228 |                 arm_smccc_hvc(FSL_HVC_SC, (uint64_t)msg, !have_resp, 0, 0, 0,
         |                                           ^
   include/linux/arm-smccc.h:360:44: note: in definition of macro 'arm_smccc_hvc'
     360 | #define arm_smccc_hvc(...) __arm_smccc_hvc(__VA_ARGS__, NULL)
         |                                            ^~~~~~~~~~~


vim +228 drivers/firmware/imx/imx-scu.c

   203	
   204	/*
   205	 * RPC command/response
   206	 */
   207	int imx_scu_call_rpc(struct imx_sc_ipc *sc_ipc, void *msg, bool have_resp)
   208	{
   209		uint8_t saved_svc, saved_func;
   210		struct imx_sc_rpc_msg *hdr;
   211		struct arm_smccc_res res;
   212		int ret;
   213	
   214		if (WARN_ON(!sc_ipc || !msg))
   215			return -EINVAL;
   216	
   217		mutex_lock(&sc_ipc->lock);
   218		reinit_completion(&sc_ipc->done);
   219	
   220		if (have_resp) {
   221			sc_ipc->msg = msg;
   222			saved_svc = ((struct imx_sc_rpc_msg *)msg)->svc;
   223			saved_func = ((struct imx_sc_rpc_msg *)msg)->func;
   224		}
   225		sc_ipc->count = 0;
   226		sc_ipc->rx_size = 0;
   227		if (xen_initial_domain()) {
 > 228			arm_smccc_hvc(FSL_HVC_SC, (uint64_t)msg, !have_resp, 0, 0, 0,
   229				      0, 0, &res);
   230			if (res.a0)
   231				printk("Error FSL_HVC_SC %ld\n", res.a0);
   232	
   233			ret = res.a0;
   234	
   235		} else {
   236			ret = imx_scu_ipc_write(sc_ipc, msg);
   237			if (ret < 0) {
   238				dev_err(sc_ipc->dev, "RPC send msg failed: %d\n", ret);
   239				goto out;
   240			}
   241	
   242			if (have_resp) {
   243				if (!wait_for_completion_timeout(&sc_ipc->done,
   244								 MAX_RX_TIMEOUT)) {
   245					dev_err(sc_ipc->dev, "RPC send msg timeout\n");
   246					mutex_unlock(&sc_ipc->lock);
   247					return -ETIMEDOUT;
   248				}
   249	
   250				/* response status is stored in hdr->func field */
   251				hdr = msg;
   252				ret = hdr->func;
   253	
   254				/*
   255				 * Some special SCU firmware APIs do NOT have return value
   256				 * in hdr->func, but they do have response data, those special
   257				 * APIs are defined as void function in SCU firmware, so they
   258				 * should be treated as return success always.
   259				 */
   260				if ((saved_svc == IMX_SC_RPC_SVC_MISC) &&
   261					(saved_func == IMX_SC_MISC_FUNC_UNIQUE_ID ||
   262					 saved_func == IMX_SC_MISC_FUNC_GET_BUTTON_STATUS))
   263					ret = 0;
   264			}
   265		}
   266	
   267	out:
   268		sc_ipc->msg = NULL;
   269		mutex_unlock(&sc_ipc->lock);
   270	
   271		dev_dbg(sc_ipc->dev, "RPC SVC done\n");
   272	
   273		return imx_sc_to_linux_errno(ret);
   274	}
   275	EXPORT_SYMBOL(imx_scu_call_rpc);
   276	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

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

only message in thread, other threads:[~2023-02-04 21:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04 21:03 [freescale-fslc:pr/621 3164/20208] drivers/firmware/imx/imx-scu.c:228:43: warning: cast from pointer to integer of different size kernel test robot

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.