linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Mikhail Zaslonko <zaslonko@linux.ibm.com>
Subject: drivers/char/ipmi/ipmi_watchdog.c:1251:2: warning: 'strcpy' source argument is the same as destination
Date: Sat, 14 Jun 2025 07:20:50 +0800	[thread overview]
Message-ID: <202506140756.EFXXvIP4-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   18531f4d1c8c47c4796289dbbc1ab657ffa063d2
commit: de6b4f99010ad22f0242f1fc0f75c0752a56e9bb s390/string: Remove strcpy() implementation
date:   6 weeks ago
config: s390-randconfig-002-20250614 (https://download.01.org/0day-ci/archive/20250614/202506140756.EFXXvIP4-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250614/202506140756.EFXXvIP4-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506140756.EFXXvIP4-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/char/ipmi/ipmi_watchdog.c: In function 'ipmi_wdog_init':
>> drivers/char/ipmi/ipmi_watchdog.c:1251:2: warning: 'strcpy' source argument is the same as destination [-Wrestrict]
    1251 |  strcpy(preop, inval);
         |  ^~~~~~~~~~~~~~~~~~~~
   drivers/char/ipmi/ipmi_watchdog.c:1231:2: warning: 'strcpy' source argument is the same as destination [-Wrestrict]
    1231 |  strcpy(preaction, inval);
         |  ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/char/ipmi/ipmi_watchdog.c:1207:2: warning: 'strcpy' source argument is the same as destination [-Wrestrict]
    1207 |  strcpy(action, inval);
         |  ^~~~~~~~~~~~~~~~~~~~~


vim +/strcpy +1251 drivers/char/ipmi/ipmi_watchdog.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  1234  
cc4673eecdcc4a Corey Minyard  2005-11-07  1235  static int preop_op(const char *inval, char *outval)
cc4673eecdcc4a Corey Minyard  2005-11-07  1236  {
cc4673eecdcc4a Corey Minyard  2005-11-07  1237  	if (outval)
cc4673eecdcc4a Corey Minyard  2005-11-07  1238  		strcpy(outval, preop);
cc4673eecdcc4a Corey Minyard  2005-11-07  1239  
cc4673eecdcc4a Corey Minyard  2005-11-07  1240  	if (!inval)
cc4673eecdcc4a Corey Minyard  2005-11-07  1241  		return 0;
cc4673eecdcc4a Corey Minyard  2005-11-07  1242  
cc4673eecdcc4a Corey Minyard  2005-11-07  1243  	if (strcmp(inval, "preop_none") == 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16  1244  		preop_val = WDOG_PREOP_NONE;
cc4673eecdcc4a Corey Minyard  2005-11-07  1245  	else if (strcmp(inval, "preop_panic") == 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16  1246  		preop_val = WDOG_PREOP_PANIC;
cc4673eecdcc4a Corey Minyard  2005-11-07  1247  	else if (strcmp(inval, "preop_give_data") == 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16  1248  		preop_val = WDOG_PREOP_GIVE_DATA;
cc4673eecdcc4a Corey Minyard  2005-11-07  1249  	else
cc4673eecdcc4a Corey Minyard  2005-11-07  1250  		return -EINVAL;
cc4673eecdcc4a Corey Minyard  2005-11-07 @1251  	strcpy(preop, inval);
cc4673eecdcc4a Corey Minyard  2005-11-07  1252  	return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  1253  }
^1da177e4c3f41 Linus Torvalds 2005-04-16  1254  

:::::: The code at line 1251 was first introduced by commit
:::::: cc4673eecdcc4a918e4d8796295d798b5e98d602 [PATCH] ipmi: watchdog parms in sysfs

:::::: TO: Corey Minyard <minyard@acm.org>
:::::: CC: Linus Torvalds <torvalds@g5.osdl.org>

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

                 reply	other threads:[~2025-06-13 23:21 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=202506140756.EFXXvIP4-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=zaslonko@linux.ibm.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).