Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp350434ybg; Wed, 3 Jun 2020 02:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWan2RVfOXtBv7tJOzif1b3p97SLm6ms0vErkYUGi2nZTyb3+B5CaB181JgwEHUXqGTnNR X-Received: by 2002:a17:906:6890:: with SMTP id n16mr17036234ejr.553.1591176307028; Wed, 03 Jun 2020 02:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591176307; cv=none; d=google.com; s=arc-20160816; b=ssrHOyfNfKhGCTY93ZRJ9TxQVcINXylTCHlx9DXdmRA5v6CbIav82rJ7kFieuBgvx9 +EwQ9ftXiC571wKjFqc7C/vIu0UoGvs8CgCiL+bltsupWt37LMVlVNr2ppTe0BSAVadc BNW5GW3+7DylhvEF6WfCYF9w5Ke+Rb6RiMuAekWbKND68qVASQWQANHGAhjAEY5+I674 NlIbCz7FB6z+8PzS35gkQ3gECwLkmbiljUnQGkuUWBrVUhjfjOAUkOl6rVeCeNOJ2zzM JQx2LMNLK4Q94OYVFvT8AqGuZtVUnL3wMZhWihTESLfLt2CYJViNWVwigdLui9BPA5jF mZkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=cB2Kq623XQ22+n48/sVsupZYgeDKXkx1f2JvNrAS7Eg=; b=WVUDTpA6YTMySyY6ufZeiIv/Fd0rgSECvwf7PGdWIeL4Zha+z9ChA9PrdyPd2LqJ6w hWybjwekUQOj/dHq0RAFusbrS0UXcAu0am6LnHnZr72iKCA06yp6T22YExSCpVcLsu6Y KMJUrAqJBQtQGseRgILVGW9ETEYV0pGBOpfOnlLtT1yTkImzg2AxZeN3gCBVaD9H+nH1 BZZkSJeUz6RZwoRCK03z8Aw5hl1wvfNZwKDNmD2R6skrdyTh23okFDe39zDKWVSiFQ8V /aNxuNmksZQRNxi4vNnhnkyb2jrgTn+8TWjdEoz81LiONkEHVo1lmPCDXSd8f3w23XaF o+tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Cg4iNhJR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x38si841709ede.433.2020.06.03.02.24.44; Wed, 03 Jun 2020 02:25:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Cg4iNhJR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbgFCJUX (ORCPT + 99 others); Wed, 3 Jun 2020 05:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbgFCJUR (ORCPT ); Wed, 3 Jun 2020 05:20:17 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 265C0C05BD43; Wed, 3 Jun 2020 02:20:17 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id x93so1115238ede.9; Wed, 03 Jun 2020 02:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cB2Kq623XQ22+n48/sVsupZYgeDKXkx1f2JvNrAS7Eg=; b=Cg4iNhJRn5TfwR+U6is/i/hkAI1C9vOZvH39O2kJGvC1+kcpOFWBoj02RZ/8YCizw4 TN4Du8QJBJI6OUxnRcqzguDlxAiP2/KLM+BEfrGuH9lodFpEJfOgGuFoDNXS79AFBz3x BSsx6G3o7UvIqUq6xWxHdBiWiemDcWfl6cIGF9cbZ+GTKMi12BzXwKqcEi6HcBKxQ0zv pxy2EWZTHcX0B82yUMVYkGAtDjECsP16RgEYII6rnhKDRvCVIk+Gf8BMCLbVKMdWjqQe TfSe3HOGF7SZHSRFfLJPR8Uk3oUhqjIqbBm7Lp4TXfH2nDfijmXfByJaWPWg0Tf5Dxhl Ksqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cB2Kq623XQ22+n48/sVsupZYgeDKXkx1f2JvNrAS7Eg=; b=XsJliFSpgFNdkXhVOMaDoJvqsZi4OA665ECiLJ635kfRJ2/LyzgIHBq08cvMnVfOL5 7mqI+TmhAXXO6/sl5WBqnrJvhzveskuWmaMKjIiuCcx1jDm1sxhlds0wb/IhReWv+V4J W1E4Ig3wJCa/HBTUuuRz6IdC5HwAYH4UrkydP+1IW/OUgGwb2FzuWcap73/CAivjq+ck ldog925ncIn2RQb/wKku9yCW6171KCMGnOOCG7XOVoaWh2sg2KX5lJ5dDrnH29GrKRI+ FHkV2D3ZCKhVGhGd3EFmu0pRNkz3DSaqy6O5hPJPMnF59Z/lJ/4vvfspalGfwpXtqQX0 Xhdg== X-Gm-Message-State: AOAM530rHIpVSg+wpfTiJ+bJG06E42cwAlCiy+VxIT3z13X7qO1J8//I 2dzuqaq3at8Xemd5gWQlZOk= X-Received: by 2002:a50:ac84:: with SMTP id x4mr31446589edc.124.1591176015916; Wed, 03 Jun 2020 02:20:15 -0700 (PDT) Received: from localhost.localdomain ([2a01:598:d00c:464c:92b:aecc:3637:dc7c]) by smtp.gmail.com with ESMTPSA id 64sm865636eda.85.2020.06.03.02.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 02:20:15 -0700 (PDT) From: Bean Huo To: 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: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, beanhuo@outlook.com Subject: [RESENT PATCH v5 1/5] scsi: ufs: remove max_t in ufs_get_device_desc Date: Wed, 3 Jun 2020 11:19:55 +0200 Message-Id: <20200603091959.27618-2-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200603091959.27618-1-huobean@gmail.com> References: <20200603091959.27618-1-huobean@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo For the UFS device, the maximum descriptor size is 255, max_t called in ufs_get_device_desc() is useless. Signed-off-by: Bart van Assche Signed-off-by: Bean Huo Acked-by: Avri Altman Reviewed-by: Stanley Chu --- drivers/scsi/ufs/ufshcd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index ad4fc829cbb2..2cf077ab9dfd 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6903,14 +6903,11 @@ static void ufs_fixup_device_setup(struct ufs_hba *hba) static int ufs_get_device_desc(struct ufs_hba *hba) { int err; - size_t buff_len; u8 model_index; u8 *desc_buf; struct ufs_dev_info *dev_info = &hba->dev_info; - buff_len = max_t(size_t, hba->desc_size.dev_desc, - QUERY_DESC_MAX_SIZE + 1); - desc_buf = kmalloc(buff_len, GFP_KERNEL); + desc_buf = kmalloc(QUERY_DESC_MAX_SIZE, GFP_KERNEL); if (!desc_buf) { err = -ENOMEM; goto out; -- 2.17.1