linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Roderick Colenbrander <roderick.colenbrander@sony.com>
Cc: kbuild-all@lists.01.org, linux-input@vger.kernel.org,
	"Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
	"Barnabás Pőcze" <pobrn@protonmail.com>
Subject: [hid:for-5.12/playstation 3/13] drivers/hid/hid-playstation.c:170:6: warning: variable 'ret' set but not used
Date: Fri, 12 Feb 2021 06:09:41 +0800	[thread overview]
Message-ID: <202102120637.AeNlAKcu-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-5.12/playstation
head:   1f902f8636e499c32f0b55e1ce150082829ef033
commit: d30bca44809eb1d2937e59d3d09694f40613070d [3/13] HID: playstation: add DualSense battery support.
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.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/hid/hid.git/commit/?id=d30bca44809eb1d2937e59d3d09694f40613070d
        git remote add hid https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git
        git fetch --no-tags hid for-5.12/playstation
        git checkout d30bca44809eb1d2937e59d3d09694f40613070d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

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/hid/hid-playstation.c: In function 'ps_battery_get_property':
>> drivers/hid/hid-playstation.c:170:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     170 |  int ret;
         |      ^~~


vim +/ret +170 drivers/hid/hid-playstation.c

   161	
   162	static int ps_battery_get_property(struct power_supply *psy,
   163			enum power_supply_property psp,
   164			union power_supply_propval *val)
   165	{
   166		struct ps_device *dev = power_supply_get_drvdata(psy);
   167		uint8_t battery_capacity;
   168		int battery_status;
   169		unsigned long flags;
 > 170		int ret;
   171	
   172		spin_lock_irqsave(&dev->lock, flags);
   173		battery_capacity = dev->battery_capacity;
   174		battery_status = dev->battery_status;
   175		spin_unlock_irqrestore(&dev->lock, flags);
   176	
   177		switch (psp) {
   178		case POWER_SUPPLY_PROP_STATUS:
   179			val->intval = battery_status;
   180			break;
   181		case POWER_SUPPLY_PROP_PRESENT:
   182			val->intval = 1;
   183			break;
   184		case POWER_SUPPLY_PROP_CAPACITY:
   185			val->intval = battery_capacity;
   186			break;
   187		case POWER_SUPPLY_PROP_SCOPE:
   188			val->intval = POWER_SUPPLY_SCOPE_DEVICE;
   189			break;
   190		default:
   191			ret = -EINVAL;
   192			break;
   193		}
   194	
   195		return 0;
   196	}
   197	

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

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

                 reply	other threads:[~2021-02-11 22:11 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=202102120637.AeNlAKcu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-input@vger.kernel.org \
    --cc=pobrn@protonmail.com \
    --cc=roderick.colenbrander@sony.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;
as well as URLs for NNTP newsgroup(s).