mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Bean Huo <huobean@gmail.com>,
	alim.akhtar@samsung.com, avri.altman@wdc.com,
	asutoshd@codeaurora.org, jejb@linux.ibm.com,
	martin.petersen@oracle.com, stanley.chu@mediatek.com,
	beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com,
	cang@codeaurora.org
Cc: kbuild-all@lists.01.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] scsi: ufs: cleanup ufs initialization path
Date: Thu, 28 May 2020 08:47:50 +0800	[thread overview]
Message-ID: <202005280809.KKIi3fMd%lkp@intel.com> (raw)
In-Reply-To: <20200527162559.1752-1-huobean@gmail.com>

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

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@intel.com>

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@lists.01.org

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

      reply	other threads:[~2020-05-28  3:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 16:25 Bean Huo
2020-05-28  0:47 ` kbuild 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=202005280809.KKIi3fMd%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=huobean@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    --cc=tomas.winkler@intel.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

all inboxes | Powered by JetHome®