public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
	Satish Kharat <satishkh@cisco.com>,
	Sesidhar Baddela <sebaddel@cisco.com>,
	Karan Tilak Kumar <kartilak@cisco.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Thorsten Blum <thorsten.blum@linux.dev>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] scsi: fnic: Use vzalloc() instead of vmalloc() and memset(0)
Date: Wed, 9 Oct 2024 12:38:08 +0800	[thread overview]
Message-ID: <202410091405.LkpEl2OX-lkp@intel.com> (raw)
In-Reply-To: <20241008095152.1831-2-thorsten.blum@linux.dev>

Hi Thorsten,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jejb-scsi/for-next]
[also build test WARNING on mkp-scsi/for-next linus/master v6.12-rc2 next-20241008]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Thorsten-Blum/scsi-fnic-Use-vzalloc-instead-of-vmalloc-and-memset-0/20241008-175453
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
patch link:    https://lore.kernel.org/r/20241008095152.1831-2-thorsten.blum%40linux.dev
patch subject: [PATCH v2] scsi: fnic: Use vzalloc() instead of vmalloc() and memset(0)
config: i386-randconfig-003-20241009 (https://download.01.org/0day-ci/archive/20241009/202410091405.LkpEl2OX-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241009/202410091405.LkpEl2OX-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/202410091405.LkpEl2OX-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/scsi/fnic/fnic_trace.c: In function 'fnic_fc_trace_init':
>> drivers/scsi/fnic/fnic_trace.c:559:34: warning: assignment to 'long unsigned int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
     559 |         fnic_fc_ctlr_trace_buf_p =
         |                                  ^


vim +559 drivers/scsi/fnic/fnic_trace.c

abb14148c0f850 Hiral Shah         2014-04-18  537  
abb14148c0f850 Hiral Shah         2014-04-18  538  /*
abb14148c0f850 Hiral Shah         2014-04-18  539   * fnic_fc_ctlr_trace_buf_init -
abb14148c0f850 Hiral Shah         2014-04-18  540   * Initialize trace buffer to log fnic control frames
abb14148c0f850 Hiral Shah         2014-04-18  541   * Description:
abb14148c0f850 Hiral Shah         2014-04-18  542   * Initialize trace buffer data structure by allocating
abb14148c0f850 Hiral Shah         2014-04-18  543   * required memory for trace data as well as for Indexes.
abb14148c0f850 Hiral Shah         2014-04-18  544   * Frame size is 256 bytes and
abb14148c0f850 Hiral Shah         2014-04-18  545   * memory is allocated for 1024 entries of 256 bytes.
abb14148c0f850 Hiral Shah         2014-04-18  546   * Page_offset(Index) is set to the address of trace entry
abb14148c0f850 Hiral Shah         2014-04-18  547   * and page_offset is initialized by adding frame size
abb14148c0f850 Hiral Shah         2014-04-18  548   * to the previous page_offset entry.
abb14148c0f850 Hiral Shah         2014-04-18  549   */
abb14148c0f850 Hiral Shah         2014-04-18  550  
abb14148c0f850 Hiral Shah         2014-04-18  551  int fnic_fc_trace_init(void)
abb14148c0f850 Hiral Shah         2014-04-18  552  {
abb14148c0f850 Hiral Shah         2014-04-18  553  	unsigned long fc_trace_buf_head;
abb14148c0f850 Hiral Shah         2014-04-18  554  	int err = 0;
abb14148c0f850 Hiral Shah         2014-04-18  555  	int i;
abb14148c0f850 Hiral Shah         2014-04-18  556  
abb14148c0f850 Hiral Shah         2014-04-18  557  	fc_trace_max_entries = (fnic_fc_trace_max_pages * PAGE_SIZE)/
abb14148c0f850 Hiral Shah         2014-04-18  558  				FC_TRC_SIZE_BYTES;
42bc47b35320e0 Kees Cook          2018-06-12 @559  	fnic_fc_ctlr_trace_buf_p =
c9ff42f1a76c7b Thorsten Blum      2024-10-08  560  		vzalloc(array_size(PAGE_SIZE, fnic_fc_trace_max_pages));
abb14148c0f850 Hiral Shah         2014-04-18  561  	if (!fnic_fc_ctlr_trace_buf_p) {
abb14148c0f850 Hiral Shah         2014-04-18  562  		pr_err("fnic: Failed to allocate memory for "
abb14148c0f850 Hiral Shah         2014-04-18  563  		       "FC Control Trace Buf\n");
abb14148c0f850 Hiral Shah         2014-04-18  564  		err = -ENOMEM;
abb14148c0f850 Hiral Shah         2014-04-18  565  		goto err_fnic_fc_ctlr_trace_buf_init;
abb14148c0f850 Hiral Shah         2014-04-18  566  	}
abb14148c0f850 Hiral Shah         2014-04-18  567  
abb14148c0f850 Hiral Shah         2014-04-18  568  	/* Allocate memory for page offset */
42bc47b35320e0 Kees Cook          2018-06-12  569  	fc_trace_entries.page_offset =
c9ff42f1a76c7b Thorsten Blum      2024-10-08  570  		vzalloc(array_size(fc_trace_max_entries,
42bc47b35320e0 Kees Cook          2018-06-12  571  				   sizeof(unsigned long)));
abb14148c0f850 Hiral Shah         2014-04-18  572  	if (!fc_trace_entries.page_offset) {
abb14148c0f850 Hiral Shah         2014-04-18  573  		pr_err("fnic:Failed to allocate memory for page_offset\n");
abb14148c0f850 Hiral Shah         2014-04-18  574  		if (fnic_fc_ctlr_trace_buf_p) {
abb14148c0f850 Hiral Shah         2014-04-18  575  			pr_err("fnic: Freeing FC Control Trace Buf\n");
abb14148c0f850 Hiral Shah         2014-04-18  576  			vfree((void *)fnic_fc_ctlr_trace_buf_p);
abb14148c0f850 Hiral Shah         2014-04-18  577  			fnic_fc_ctlr_trace_buf_p = 0;
abb14148c0f850 Hiral Shah         2014-04-18  578  		}
abb14148c0f850 Hiral Shah         2014-04-18  579  		err = -ENOMEM;
abb14148c0f850 Hiral Shah         2014-04-18  580  		goto err_fnic_fc_ctlr_trace_buf_init;
abb14148c0f850 Hiral Shah         2014-04-18  581  	}
abb14148c0f850 Hiral Shah         2014-04-18  582  
abb14148c0f850 Hiral Shah         2014-04-18  583  	fc_trace_entries.rd_idx = fc_trace_entries.wr_idx = 0;
abb14148c0f850 Hiral Shah         2014-04-18  584  	fc_trace_buf_head = fnic_fc_ctlr_trace_buf_p;
abb14148c0f850 Hiral Shah         2014-04-18  585  
abb14148c0f850 Hiral Shah         2014-04-18  586  	/*
abb14148c0f850 Hiral Shah         2014-04-18  587  	* Set up fc_trace_entries.page_offset field with memory location
abb14148c0f850 Hiral Shah         2014-04-18  588  	* for every trace entry
abb14148c0f850 Hiral Shah         2014-04-18  589  	*/
abb14148c0f850 Hiral Shah         2014-04-18  590  	for (i = 0; i < fc_trace_max_entries; i++) {
abb14148c0f850 Hiral Shah         2014-04-18  591  		fc_trace_entries.page_offset[i] = fc_trace_buf_head;
abb14148c0f850 Hiral Shah         2014-04-18  592  		fc_trace_buf_head += FC_TRC_SIZE_BYTES;
abb14148c0f850 Hiral Shah         2014-04-18  593  	}
1dbaa379a41934 Greg Kroah-Hartman 2019-01-22  594  	fnic_fc_trace_debugfs_init();
abb14148c0f850 Hiral Shah         2014-04-18  595  	pr_info("fnic: Successfully Initialized FC_CTLR Trace Buffer\n");
abb14148c0f850 Hiral Shah         2014-04-18  596  	return err;
abb14148c0f850 Hiral Shah         2014-04-18  597  
abb14148c0f850 Hiral Shah         2014-04-18  598  err_fnic_fc_ctlr_trace_buf_init:
abb14148c0f850 Hiral Shah         2014-04-18  599  	return err;
abb14148c0f850 Hiral Shah         2014-04-18  600  }
abb14148c0f850 Hiral Shah         2014-04-18  601  

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

      parent reply	other threads:[~2024-10-09  4:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  9:51 [PATCH v2] scsi: fnic: Use vzalloc() instead of vmalloc() and memset(0) Thorsten Blum
2024-10-08 10:25 ` Johannes Thumshirn
2024-10-08 11:02   ` Thorsten Blum
2024-10-09  4:17 ` kernel test robot
2024-10-09  4:38 ` kernel test robot [this message]

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=202410091405.LkpEl2OX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=kartilak@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.com \
    --cc=thorsten.blum@linux.dev \
    /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