Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp494294ybm; Thu, 28 May 2020 08:00:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxn+nSWO1FnCSZ+/DKSms3sOCuZfzoDn41cS3ke/8xUxvr98o5TonV+loOeEo0Wbilt7nHw X-Received: by 2002:aa7:c607:: with SMTP id h7mr3645102edq.214.1590678057438; Thu, 28 May 2020 08:00:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590678057; cv=none; d=google.com; s=arc-20160816; b=gFdqsmcA6GV75Fu7DqOFdDzb7g2gTaU7Ys5Z7MYRKAdCTBPOUaFNdjZVhD45VO24PS spZdHvqN/+oGjs15NMfGCTi+JSu4NWID8/t7Eu+vM3X4wSwDl0e95xgbj2TBn6R59wXl JR8J+4ylqDZPlVMeti9U9oyPHDCM4HHMf4cRlqPAEZztE/3V5jZdK9ABCnsaqG8ytPoH REaTaHQBO/Cz1wZgiAZAR/223awgaYeR1lZSnOxH9ZHhMf8goN2GiYk8YMwgt2honF3G Jm1+N8/7/4LP9gCGPM0hB8Gh04665R1SL71PvWKx8EPjhLz3rXx4MnehfmM1d733g9qJ 72wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=H+E2Cht00Nd0DyuFWKpXcfzkYTJQqhpE9g+HMMzT2t4=; b=zrrtaJr39twCIHJ9FBxeZ+NUO5JNNsujCw7MizOEhR9NIe4LZ3vYvMF6C5buASepc5 BPWXDus+R5ck0yn8mxdBZEffORlYeudBiC1GvnYFcMp3qXANLhDAdLr/SDAdAnDcgVdd aFElKWZLYP3Xlextbxm94a7lvgtZwdktB7Rpo0Sb1OukvTgo5RJdl+GGeeJOz5nYU9eG 33Oqx6DuOCz/aDLa5ZoYxZmLBFbOFQp7OS0ImrRS8S/3w9BCAoS1gqhQw2ELcXEPD0cy HQrGDcnxnYY/FC6GEWIzxtkLgBX2ndYTSxqsijTD03gX2pr2Wr704X1ucE0KzG2XDrEf Nafg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j27si3877816eja.471.2020.05.28.08.00.33; Thu, 28 May 2020 08:00:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403876AbgE1O4l (ORCPT + 99 others); Thu, 28 May 2020 10:56:41 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38164 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403836AbgE1O4S (ORCPT ); Thu, 28 May 2020 10:56:18 -0400 Received: by mail-pg1-f194.google.com with SMTP id u5so13594117pgn.5; Thu, 28 May 2020 07:56:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=H+E2Cht00Nd0DyuFWKpXcfzkYTJQqhpE9g+HMMzT2t4=; b=AukvJJi+JSoc+LXI2gQFvoLutNSDStYEYeQ329NKyksukuA0J89bfVy6OzxnDyJalL xupgiBpxYsb9JwQNg324uYuJ8p4El1er6hriWQX/ufya5h2kV4ioQJ56DOWeDBSk0eWD 1iaRRpqj0VFkQOe2/DC45VCDBwzwQXkeglMP+oRspYroH3OVAH/ltEEbFZ1CRyDgXKyD sZjL0uFEaemxxfPE3ZzZoceTmXRfeHBI6eKhjztpDalF2V1oQvRbwHqSJ9qMqUAo3Snh a9V31hKTVmigRU46ZWt0JypulMNfw5NIAcmPWTbgWcSlPDf1xU8e9Un33gyf/aTjiNwl JDcQ== X-Gm-Message-State: AOAM533kCoJim2wOKUPzDBkQnisck14QWHJZEf9+YmNh3aX2JtL9VOgQ L6thFIABZPeCcYYbOICE712fka3M85s= X-Received: by 2002:a62:d41a:: with SMTP id a26mr3425951pfh.290.1590677776672; Thu, 28 May 2020 07:56:16 -0700 (PDT) Received: from ?IPv6:2601:647:4000:d7:40e6:aa88:9c03:e0b4? ([2601:647:4000:d7:40e6:aa88:9c03:e0b4]) by smtp.gmail.com with ESMTPSA id u45sm5816165pjb.7.2020.05.28.07.56.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 May 2020 07:56:15 -0700 (PDT) Subject: Re: [PATCH v2 1/3] scsi: ufs: remove max_t in ufs_get_device_desc To: Bean Huo , 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, tomas.winkler@intel.com, cang@codeaurora.org Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200528115616.9949-1-huobean@gmail.com> <20200528115616.9949-2-huobean@gmail.com> From: Bart Van Assche Autocrypt: addr=bvanassche@acm.org; prefer-encrypt=mutual; keydata= mQENBFSOu4oBCADcRWxVUvkkvRmmwTwIjIJvZOu6wNm+dz5AF4z0FHW2KNZL3oheO3P8UZWr LQOrCfRcK8e/sIs2Y2D3Lg/SL7qqbMehGEYcJptu6mKkywBfoYbtBkVoJ/jQsi2H0vBiiCOy fmxMHIPcYxaJdXxrOG2UO4B60Y/BzE6OrPDT44w4cZA9DH5xialliWU447Bts8TJNa3lZKS1 AvW1Zklb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T oH0F0xB3SQ8WVSXA9rrc4EBvZruWQ+5/zjVrhhfUAx12CzL4oQ9Ro2k45daYaonKTANYG22y //x8dLe2Fv1By4SKGhmzwH87uXxbTJAUxiWIi1np0z3/RDnoVyfmfbbL1DY7zf2hYXLLzsJR mSsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: <85bbc91f-7b91-46fc-acff-3bcc2288c4ae@acm.org> Date: Thu, 28 May 2020 07:56:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200528115616.9949-2-huobean@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-28 04:56, Bean Huo wrote: > 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: Bean Huo > --- > drivers/scsi/ufs/ufshcd.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index aca50ed39844..0f8c7e05df29 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -6881,8 +6881,7 @@ static int ufs_get_device_desc(struct ufs_hba *hba) > 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); > + buff_len = QUERY_DESC_MAX_SIZE + 1; > desc_buf = kmalloc(buff_len, GFP_KERNEL); > if (!desc_buf) { > err = -ENOMEM; Since the buff_len variable is not changed after its initial assignment, please remove it entirely. Thanks, Bart.