linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	David Gow <davidgow@google.com>
Subject: [linux-next:master 5739/6619] lib/kunit/kunit-test.c:565:25: warning: cast from 'void (*)(const void *)' to 'kunit_action_t *' (aka 'void (*)(void *)') converts to incompatible function type
Date: Wed, 20 Sep 2023 23:46:31 +0800	[thread overview]
Message-ID: <202309202345.yPRVHW8Q-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   926f75c8a5ab70567eb4c2d82fbc96963313e564
commit: 05e2006ce493cb6fb5e5b4b8317f82754dfa2b1e [5739/6619] kunit: Use string_stream for test log
config: hexagon-buildonly-randconfig-r002-20221027 (https://download.01.org/0day-ci/archive/20230920/202309202345.yPRVHW8Q-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230920/202309202345.yPRVHW8Q-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/202309202345.yPRVHW8Q-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/kunit/kunit-test.c:565:25: warning: cast from 'void (*)(const void *)' to 'kunit_action_t *' (aka 'void (*)(void *)') converts to incompatible function type [-Wcast-function-type-strict]
           kunit_add_action(test, (kunit_action_t *)kfree, full_log);
                                  ^~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +565 lib/kunit/kunit-test.c

   545	
   546	static void kunit_log_test(struct kunit *test)
   547	{
   548		struct kunit_suite suite;
   549	#ifdef CONFIG_KUNIT_DEBUGFS
   550		char *full_log;
   551	#endif
   552		suite.log = kunit_alloc_string_stream(test, GFP_KERNEL);
   553		KUNIT_ASSERT_NOT_ERR_OR_NULL(test, suite.log);
   554		string_stream_set_append_newlines(suite.log, true);
   555	
   556		kunit_log(KERN_INFO, test, "put this in log.");
   557		kunit_log(KERN_INFO, test, "this too.");
   558		kunit_log(KERN_INFO, &suite, "add to suite log.");
   559		kunit_log(KERN_INFO, &suite, "along with this.");
   560	
   561	#ifdef CONFIG_KUNIT_DEBUGFS
   562		KUNIT_EXPECT_TRUE(test, test->log->append_newlines);
   563	
   564		full_log = string_stream_get_string(test->log);
 > 565		kunit_add_action(test, (kunit_action_t *)kfree, full_log);
   566		KUNIT_EXPECT_NOT_ERR_OR_NULL(test,
   567					     strstr(full_log, "put this in log."));
   568		KUNIT_EXPECT_NOT_ERR_OR_NULL(test,
   569					     strstr(full_log, "this too."));
   570	
   571		full_log = string_stream_get_string(suite.log);
   572		kunit_add_action(test, kfree_wrapper, full_log);
   573		KUNIT_EXPECT_NOT_ERR_OR_NULL(test,
   574					     strstr(full_log, "add to suite log."));
   575		KUNIT_EXPECT_NOT_ERR_OR_NULL(test,
   576					     strstr(full_log, "along with this."));
   577	#else
   578		KUNIT_EXPECT_NULL(test, test->log);
   579	#endif
   580	}
   581	

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


                 reply	other threads:[~2023-09-20 15:47 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=202309202345.yPRVHW8Q-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=davidgow@google.com \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rf@opensource.cirrus.com \
    --cc=skhan@linuxfoundation.org \
    /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