mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Marc Bonnici <marc.bonnici@arm.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Sudeep Holla <sudeep.holla@arm.com>
Subject: [sudeep-holla:for-next/ffa 1/1] drivers/firmware/arm_ffa/driver.c:404:17: warning: suggest explicit braces to avoid ambiguous 'else'
Date: Wed, 27 Apr 2022 02:35:50 +0800	[thread overview]
Message-ID: <202204270258.eWC4oaGl-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git for-next/ffa
head:   f924bccb73cadccf18a97c3c6a4e8c12120c3cdc
commit: f924bccb73cadccf18a97c3c6a4e8c12120c3cdc [1/1] firmware: arm_ffa: Fix handling of fragmented memory descriptors
config: arm64-randconfig-r023-20220425 (https://download.01.org/0day-ci/archive/20220427/202204270258.eWC4oaGl-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 11.3.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://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/commit/?id=f924bccb73cadccf18a97c3c6a4e8c12120c3cdc
        git remote add sudeep-holla https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git
        git fetch --no-tags sudeep-holla for-next/ffa
        git checkout f924bccb73cadccf18a97c3c6a4e8c12120c3cdc
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/firmware/arm_ffa/

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/firmware/arm_ffa/driver.c: In function 'ffa_mem_first_frag':
>> drivers/firmware/arm_ffa/driver.c:404:17: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
     404 |         else if (ret.a0 == FFA_MEM_FRAG_RX)
         |                 ^
   drivers/firmware/arm_ffa/driver.c:401:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
     401 |         if (ret.a0 == FFA_SUCCESS)
         |            ^


vim +/else +404 drivers/firmware/arm_ffa/driver.c

   381	
   382	static int ffa_mem_first_frag(u32 func_id, phys_addr_t buf, u32 buf_sz,
   383				      u32 frag_len, u32 len, u64 *handle)
   384	{
   385		ffa_value_t ret;
   386	
   387		invoke_ffa_fn((ffa_value_t){
   388			      .a0 = func_id, .a1 = len, .a2 = frag_len,
   389			      .a3 = buf, .a4 = buf_sz,
   390			      }, &ret);
   391	
   392		while (ret.a0 == FFA_MEM_OP_PAUSE)
   393			invoke_ffa_fn((ffa_value_t){
   394				      .a0 = FFA_MEM_OP_RESUME,
   395				      .a1 = ret.a1, .a2 = ret.a2,
   396				      }, &ret);
   397	
   398		if (ret.a0 == FFA_ERROR)
   399			return ffa_to_linux_errno((int)ret.a2);
   400	
   401		if (ret.a0 == FFA_SUCCESS)
   402			if (handle)
   403				*handle = PACK_HANDLE(ret.a2, ret.a3);
 > 404		else if (ret.a0 == FFA_MEM_FRAG_RX)
   405			if (handle)
   406				*handle = PACK_HANDLE(ret.a1, ret.a2);
   407		else
   408			return -EOPNOTSUPP;
   409	
   410		return frag_len;
   411	}
   412	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-04-26 18:36 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=202204270258.eWC4oaGl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.bonnici@arm.com \
    --cc=sudeep.holla@arm.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

Powered by JetHome