Re: [PATCH v1] scsi: ufs: cleanup ufs initialization path

From: kbuild test robot
Date: Wed May 27 2020 - 23:19:31 EST


Hi Bean,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on next-20200526]
[cannot apply to mkp-scsi/for-next v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Bean-Huo/scsi-ufs-cleanup-ufs-initialization-path/20200528-003043
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: i386-randconfig-a003-20200527 (attached as .config)
compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/linux/list.h:9:0,
from include/linux/async.h:12,
from drivers/scsi/ufs/ufshcd.c:40:
drivers/scsi/ufs/ufshcd.c: In function 'ufs_get_device_desc':
include/linux/kernel.h:942:63: warning: comparison is always false due to limited range of data type [-Wtype-limits]
#define max_t(type, x, y) __careful_cmp((type)(x), (type)(y), >)
^
include/linux/kernel.h:858:30: note: in definition of macro '__cmp'
#define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
^
include/linux/kernel.h:942:27: note: in expansion of macro '__careful_cmp'
#define max_t(type, x, y) __careful_cmp((type)(x), (type)(y), >)
^
>> drivers/scsi/ufs/ufshcd.c:6834:13: note: in expansion of macro 'max_t'
buff_len = max_t(size_t, hba->desc_size[QUERY_DESC_IDN_DEVICE],
^

vim +/max_t +6834 drivers/scsi/ufs/ufshcd.c

6825
6826 static int ufs_get_device_desc(struct ufs_hba *hba)
6827 {
6828 int err;
6829 size_t buff_len;
6830 u8 model_index;
6831 u8 *desc_buf;
6832 struct ufs_dev_info *dev_info = &hba->dev_info;
6833
> 6834 buff_len = max_t(size_t, hba->desc_size[QUERY_DESC_IDN_DEVICE],
6835 QUERY_DESC_MAX_SIZE + 1);
6836 desc_buf = kmalloc(buff_len, GFP_KERNEL);
6837 if (!desc_buf) {
6838 err = -ENOMEM;
6839 goto out;
6840 }
6841
6842 err = ufshcd_read_desc_param(hba, QUERY_DESC_IDN_DEVICE, 0, 0, desc_buf,
6843 hba->desc_size[QUERY_DESC_IDN_DEVICE]);
6844 if (err) {
6845 dev_err(hba->dev, "%s: Failed reading Device Desc. err = %d\n",
6846 __func__, err);
6847 goto out;
6848 }
6849
6850 /*
6851 * getting vendor (manufacturerID) and Bank Index in big endian
6852 * format
6853 */
6854 dev_info->wmanufacturerid = desc_buf[DEVICE_DESC_PARAM_MANF_ID] << 8 |
6855 desc_buf[DEVICE_DESC_PARAM_MANF_ID + 1];
6856
6857 /* getting Specification Version in big endian format */
6858 dev_info->wspecversion = desc_buf[DEVICE_DESC_PARAM_SPEC_VER] << 8 |
6859 desc_buf[DEVICE_DESC_PARAM_SPEC_VER + 1];
6860
6861 model_index = desc_buf[DEVICE_DESC_PARAM_PRDCT_NAME];
6862
6863 err = ufshcd_read_string_desc(hba, model_index,
6864 &dev_info->model, SD_ASCII_STD);
6865 if (err < 0) {
6866 dev_err(hba->dev, "%s: Failed reading Product Name. err = %d\n",
6867 __func__, err);
6868 goto out;
6869 }
6870
6871 ufs_fixup_device_setup(hba);
6872
6873 /*
6874 * Probe WB only for UFS-3.1 devices or UFS devices with quirk
6875 * UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES enabled
6876 */
6877 if (dev_info->wspecversion >= 0x310 ||
6878 (hba->dev_quirks & UFS_DEVICE_QUIRK_SUPPORT_EXTENDED_FEATURES))
6879 ufshcd_wb_probe(hba, desc_buf);
6880
6881 /*
6882 * ufshcd_read_string_desc returns size of the string
6883 * reset the error value
6884 */
6885 err = 0;
6886
6887 out:
6888 kfree(desc_buf);
6889 return err;
6890 }
6891

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

Attachment: .config.gz
Description: application/gzip