All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [mkp-scsi:for-next 230/248] drivers/scsi/pm8001/pm8001_init.c:1193 pm8001_init_ccb_tag() warn: level not at start of string
Date: Fri, 09 Oct 2020 13:15:49 +0300	[thread overview]
Message-ID: <20201009101549.GD1042@kadam> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head:   1c6e20ad8016761a8735a1863561fcb1df52272b
commit: 6a0aecea4683027efda2594e24ef8a711af10f47 [230/248] scsi: pm80xx: Increase the number of outstanding I/O supported to 1024
config: powerpc64-randconfig-m031-20201008 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/scsi/pm8001/pm8001_init.c:1193 pm8001_init_ccb_tag() warn: KERN_* level not at start of string

Old smatch warnings:
drivers/scsi/pm8001/pm8001_init.c:473 pm8001_ioremap() warn: argument 6 to %llx specifier is cast from pointer
drivers/scsi/pm8001/pm8001_init.c:1202 pm8001_init_ccb_tag() warn: KERN_* level not at start of string

vim +1193 drivers/scsi/pm8001/pm8001_init.c

6a0aecea4683027 Viswas G  2020-10-05  1170  static int
6a0aecea4683027 Viswas G  2020-10-05  1171  pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost,
6a0aecea4683027 Viswas G  2020-10-05  1172  			struct pci_dev *pdev)
6a0aecea4683027 Viswas G  2020-10-05  1173  {
6a0aecea4683027 Viswas G  2020-10-05  1174  	int i = 0;
6a0aecea4683027 Viswas G  2020-10-05  1175  	u32 max_out_io, ccb_count;
6a0aecea4683027 Viswas G  2020-10-05  1176  	u32 can_queue;
6a0aecea4683027 Viswas G  2020-10-05  1177  
6a0aecea4683027 Viswas G  2020-10-05  1178  	max_out_io = pm8001_ha->main_cfg_tbl.pm80xx_tbl.max_out_io;
6a0aecea4683027 Viswas G  2020-10-05  1179  	ccb_count = min_t(int, PM8001_MAX_CCB, max_out_io);
6a0aecea4683027 Viswas G  2020-10-05  1180  
6a0aecea4683027 Viswas G  2020-10-05  1181  	/* Update to the scsi host*/
6a0aecea4683027 Viswas G  2020-10-05  1182  	can_queue = ccb_count - PM8001_RESERVE_SLOT;
6a0aecea4683027 Viswas G  2020-10-05  1183  	shost->can_queue = can_queue;
6a0aecea4683027 Viswas G  2020-10-05  1184  
6a0aecea4683027 Viswas G  2020-10-05  1185  	pm8001_ha->tags = kzalloc(ccb_count, GFP_KERNEL);
6a0aecea4683027 Viswas G  2020-10-05  1186  	if (!pm8001_ha->tags)
6a0aecea4683027 Viswas G  2020-10-05  1187  		goto err_out;
6a0aecea4683027 Viswas G  2020-10-05  1188  
6a0aecea4683027 Viswas G  2020-10-05  1189  	/* Memory region for ccb_info*/
6a0aecea4683027 Viswas G  2020-10-05  1190  	pm8001_ha->ccb_info = (struct pm8001_ccb_info *)
6a0aecea4683027 Viswas G  2020-10-05  1191  		kcalloc(ccb_count, sizeof(struct pm8001_ccb_info), GFP_KERNEL);
6a0aecea4683027 Viswas G  2020-10-05  1192  	if (!pm8001_ha->ccb_info) {
6a0aecea4683027 Viswas G  2020-10-05 @1193  		PM8001_FAIL_DBG(pm8001_ha, pm8001_printk
6a0aecea4683027 Viswas G  2020-10-05  1194  			(KERN_ERR "Unable to allocate memory for ccb\n"));
                                                                 ^^^^^^^^
pm8001_printk() is already pr_info() so it can't be KERN_ERR as well.

6a0aecea4683027 Viswas G  2020-10-05  1195  		goto err_out_noccb;
6a0aecea4683027 Viswas G  2020-10-05  1196  	}
6a0aecea4683027 Viswas G  2020-10-05  1197  	for (i = 0; i < ccb_count; i++) {
6a0aecea4683027 Viswas G  2020-10-05  1198  		pm8001_ha->ccb_info[i].buf_prd = pci_alloc_consistent(pdev,
6a0aecea4683027 Viswas G  2020-10-05  1199  				sizeof(struct pm8001_prd) * PM8001_MAX_DMA_SG,
6a0aecea4683027 Viswas G  2020-10-05  1200  				&pm8001_ha->ccb_info[i].ccb_dma_handle);
6a0aecea4683027 Viswas G  2020-10-05  1201  		if (!pm8001_ha->ccb_info[i].buf_prd) {
6a0aecea4683027 Viswas G  2020-10-05  1202  			PM8001_FAIL_DBG(pm8001_ha, pm8001_printk
6a0aecea4683027 Viswas G  2020-10-05  1203  					(KERN_ERR "pm80xx: ccb prd memory allocation error\n"));
6a0aecea4683027 Viswas G  2020-10-05  1204  			goto err_out;
6a0aecea4683027 Viswas G  2020-10-05  1205  		}
6a0aecea4683027 Viswas G  2020-10-05  1206  		pm8001_ha->ccb_info[i].task = NULL;
6a0aecea4683027 Viswas G  2020-10-05  1207  		pm8001_ha->ccb_info[i].ccb_tag = 0xffffffff;
6a0aecea4683027 Viswas G  2020-10-05  1208  		pm8001_ha->ccb_info[i].device = NULL;
6a0aecea4683027 Viswas G  2020-10-05  1209  		++pm8001_ha->tags_num;
6a0aecea4683027 Viswas G  2020-10-05  1210  	}
6a0aecea4683027 Viswas G  2020-10-05  1211  	return 0;
6a0aecea4683027 Viswas G  2020-10-05  1212  
6a0aecea4683027 Viswas G  2020-10-05  1213  err_out_noccb:
6a0aecea4683027 Viswas G  2020-10-05  1214  	kfree(pm8001_ha->devices);
6a0aecea4683027 Viswas G  2020-10-05  1215  err_out:
6a0aecea4683027 Viswas G  2020-10-05  1216  	return -ENOMEM;
6a0aecea4683027 Viswas G  2020-10-05  1217  }

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

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

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [mkp-scsi:for-next 230/248] drivers/scsi/pm8001/pm8001_init.c:1193 pm8001_init_ccb_tag() warn: level not at start of string
Date: Fri, 09 Oct 2020 13:15:49 +0300	[thread overview]
Message-ID: <20201009101549.GD1042@kadam> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head:   1c6e20ad8016761a8735a1863561fcb1df52272b
commit: 6a0aecea4683027efda2594e24ef8a711af10f47 [230/248] scsi: pm80xx: Increase the number of outstanding I/O supported to 1024
config: powerpc64-randconfig-m031-20201008 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/scsi/pm8001/pm8001_init.c:1193 pm8001_init_ccb_tag() warn: KERN_* level not at start of string

Old smatch warnings:
drivers/scsi/pm8001/pm8001_init.c:473 pm8001_ioremap() warn: argument 6 to %llx specifier is cast from pointer
drivers/scsi/pm8001/pm8001_init.c:1202 pm8001_init_ccb_tag() warn: KERN_* level not at start of string

vim +1193 drivers/scsi/pm8001/pm8001_init.c

6a0aecea4683027 Viswas G  2020-10-05  1170  static int
6a0aecea4683027 Viswas G  2020-10-05  1171  pm8001_init_ccb_tag(struct pm8001_hba_info *pm8001_ha, struct Scsi_Host *shost,
6a0aecea4683027 Viswas G  2020-10-05  1172  			struct pci_dev *pdev)
6a0aecea4683027 Viswas G  2020-10-05  1173  {
6a0aecea4683027 Viswas G  2020-10-05  1174  	int i = 0;
6a0aecea4683027 Viswas G  2020-10-05  1175  	u32 max_out_io, ccb_count;
6a0aecea4683027 Viswas G  2020-10-05  1176  	u32 can_queue;
6a0aecea4683027 Viswas G  2020-10-05  1177  
6a0aecea4683027 Viswas G  2020-10-05  1178  	max_out_io = pm8001_ha->main_cfg_tbl.pm80xx_tbl.max_out_io;
6a0aecea4683027 Viswas G  2020-10-05  1179  	ccb_count = min_t(int, PM8001_MAX_CCB, max_out_io);
6a0aecea4683027 Viswas G  2020-10-05  1180  
6a0aecea4683027 Viswas G  2020-10-05  1181  	/* Update to the scsi host*/
6a0aecea4683027 Viswas G  2020-10-05  1182  	can_queue = ccb_count - PM8001_RESERVE_SLOT;
6a0aecea4683027 Viswas G  2020-10-05  1183  	shost->can_queue = can_queue;
6a0aecea4683027 Viswas G  2020-10-05  1184  
6a0aecea4683027 Viswas G  2020-10-05  1185  	pm8001_ha->tags = kzalloc(ccb_count, GFP_KERNEL);
6a0aecea4683027 Viswas G  2020-10-05  1186  	if (!pm8001_ha->tags)
6a0aecea4683027 Viswas G  2020-10-05  1187  		goto err_out;
6a0aecea4683027 Viswas G  2020-10-05  1188  
6a0aecea4683027 Viswas G  2020-10-05  1189  	/* Memory region for ccb_info*/
6a0aecea4683027 Viswas G  2020-10-05  1190  	pm8001_ha->ccb_info = (struct pm8001_ccb_info *)
6a0aecea4683027 Viswas G  2020-10-05  1191  		kcalloc(ccb_count, sizeof(struct pm8001_ccb_info), GFP_KERNEL);
6a0aecea4683027 Viswas G  2020-10-05  1192  	if (!pm8001_ha->ccb_info) {
6a0aecea4683027 Viswas G  2020-10-05 @1193  		PM8001_FAIL_DBG(pm8001_ha, pm8001_printk
6a0aecea4683027 Viswas G  2020-10-05  1194  			(KERN_ERR "Unable to allocate memory for ccb\n"));
                                                                 ^^^^^^^^
pm8001_printk() is already pr_info() so it can't be KERN_ERR as well.

6a0aecea4683027 Viswas G  2020-10-05  1195  		goto err_out_noccb;
6a0aecea4683027 Viswas G  2020-10-05  1196  	}
6a0aecea4683027 Viswas G  2020-10-05  1197  	for (i = 0; i < ccb_count; i++) {
6a0aecea4683027 Viswas G  2020-10-05  1198  		pm8001_ha->ccb_info[i].buf_prd = pci_alloc_consistent(pdev,
6a0aecea4683027 Viswas G  2020-10-05  1199  				sizeof(struct pm8001_prd) * PM8001_MAX_DMA_SG,
6a0aecea4683027 Viswas G  2020-10-05  1200  				&pm8001_ha->ccb_info[i].ccb_dma_handle);
6a0aecea4683027 Viswas G  2020-10-05  1201  		if (!pm8001_ha->ccb_info[i].buf_prd) {
6a0aecea4683027 Viswas G  2020-10-05  1202  			PM8001_FAIL_DBG(pm8001_ha, pm8001_printk
6a0aecea4683027 Viswas G  2020-10-05  1203  					(KERN_ERR "pm80xx: ccb prd memory allocation error\n"));
6a0aecea4683027 Viswas G  2020-10-05  1204  			goto err_out;
6a0aecea4683027 Viswas G  2020-10-05  1205  		}
6a0aecea4683027 Viswas G  2020-10-05  1206  		pm8001_ha->ccb_info[i].task = NULL;
6a0aecea4683027 Viswas G  2020-10-05  1207  		pm8001_ha->ccb_info[i].ccb_tag = 0xffffffff;
6a0aecea4683027 Viswas G  2020-10-05  1208  		pm8001_ha->ccb_info[i].device = NULL;
6a0aecea4683027 Viswas G  2020-10-05  1209  		++pm8001_ha->tags_num;
6a0aecea4683027 Viswas G  2020-10-05  1210  	}
6a0aecea4683027 Viswas G  2020-10-05  1211  	return 0;
6a0aecea4683027 Viswas G  2020-10-05  1212  
6a0aecea4683027 Viswas G  2020-10-05  1213  err_out_noccb:
6a0aecea4683027 Viswas G  2020-10-05  1214  	kfree(pm8001_ha->devices);
6a0aecea4683027 Viswas G  2020-10-05  1215  err_out:
6a0aecea4683027 Viswas G  2020-10-05  1216  	return -ENOMEM;
6a0aecea4683027 Viswas G  2020-10-05  1217  }

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

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

             reply	other threads:[~2020-10-09 10:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 10:15 Dan Carpenter [this message]
2020-10-09 10:15 ` [mkp-scsi:for-next 230/248] drivers/scsi/pm8001/pm8001_init.c:1193 pm8001_init_ccb_tag() warn: level not at start of string Dan Carpenter
2020-10-09 11:41 ` Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2020-10-07 20:08 kernel test robot

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=20201009101549.GD1042@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.