Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp500831ybm; Thu, 28 May 2020 08:06:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUnHuIw7qCsrS8buyAuIurhe3prpLbOPwko+sEOhOUqKS5oBP1gPWrfCo9Y/cPLWSr/sHz X-Received: by 2002:a50:fd83:: with SMTP id o3mr3478464edt.329.1590678402098; Thu, 28 May 2020 08:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590678402; cv=none; d=google.com; s=arc-20160816; b=aAhczXSaHd6SH7kkdWogKheH2+MqjADx0XObcC/Y90Wqq8jYlRiKlg4ErtgKovM3Qp p8QPFGEoOvjquvtuSn764XKDWblc00GG+WXKXgIvKL9P467FBMy4n53zhzHP8iZvEu1o F+2zIF0rO37cmdPTMi2FmTl7fPcCYIayYfJXbCUxUkcHPIuS2o6lv91jVPO6YE+twZLq XcL2BiQCKbDGgQv/b2XzAUL4PTkKzohtDSlpqGrbmJGPS0CwwtovUVQiq4okVBmd/kjn CpyXWnFL7j/eYKzkN0ycbUzZk7YWq9dp9/eINOt8bsx8RmBFHPtLmwG8AD5NZeD0f35f HhBQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=pbNGWADWmH1o8ITeUzV43LxllSVUiopM5tVSH/bNMRg=; b=pWLKwtkQ2h+uln6RdK9IRvVdtBF8kzl1QyWx0IRZwWLOSb+d7zhEmqSsZzkAMGh3dP gwfT70Ua75fJ99jgRRvotend3pvWCbsf0Z03zBggiScF9kMTCGzXsOJVSy9WEBI3spMC KopFk5Xolt1UAT0JniFIyicJfbErObsVXBz3auND4vlCwTwt7MEN9DR9lrmiXOWSJhhi z455FsuO9Bs9V1T/wAMbohxr1xwPtmv+m/2QA8fyO7El8GPz/BPoh3SzBRamn6ke0F/y i//60s0dM2LxAuidcS7GzzuDFpXYhvybZCjynYlETPM4/+heX7rQv3LFX/w4bF22ODYR 07zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SJNdWEva; 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 cb1si1183982ejb.42.2020.05.28.08.06.18; Thu, 28 May 2020 08:06:42 -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=SJNdWEva; 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 S2404128AbgE1PEe (ORCPT + 99 others); Thu, 28 May 2020 11:04:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404087AbgE1PEb (ORCPT ); Thu, 28 May 2020 11:04:31 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9524AC08C5C6; Thu, 28 May 2020 08:04:30 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id f5so3549740wmh.2; Thu, 28 May 2020 08:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=pbNGWADWmH1o8ITeUzV43LxllSVUiopM5tVSH/bNMRg=; b=SJNdWEvaGf6UTpJrouuPKlz9AH0H1iZIiMfvjxZpnPCMWSJlNcDSULrTvaUSkQNXwy Oju3hYuWRZv61ZCE/vLBEamB1sdZcYIA9QjrFlz3rqt0gLeh34cGUAaeqRAJlljO6HGk IId3QflGNPUsDMit8cAd3mB+Eas2ol893rFTuDI3ubFA6HCu5UsrW1IO1AyUgfAoD7bl YqLEpaYq5G5XcKoAIqAPVp92Ssd4OU7lMnQYkydXhhZuT1G+qqq02K5p2jWUa2ADj0+h LmdnkgTeCUgSDMTp93mG661A0/GrrL4cs1RT7IfXdBKzY/hDLbQdPCsB9jzTEAr7wZQ8 vwiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=pbNGWADWmH1o8ITeUzV43LxllSVUiopM5tVSH/bNMRg=; b=Qr7Kiuk6wmOvYjBf27a3up5VP+jdjPOFZUFvj3wZKFy0lXQFT77e2ioHiCXhzqTRbA E/jVF14TqQtg7Ko3gL608vkMfBQouDgEstDvDeJudZSnXcmNgE/Ld05Sq1hM5zBDVPzy kWoqIghNPG/4fC/6Azqq5afESjp2Rgeh3BL3/Ny4crw6sDSTwY4sYIPWE9UtxmPbtpWQ 2JaDezDxNnDj9zXGj6xsdD3rqVJ10urq27rHMF1F7KKC34kUhjQbkFgHR4XtCqLBZV5L qYXyURYky9V78mL3hTmxSHC5HUTSq1WufnI4t00gAJG340PcPzA4jOYLmRbrLf0oOKG4 qcUQ== X-Gm-Message-State: AOAM532f7BfD9xXx0nYX8KI00A2l1QCHoP564QwAdBE2wYHhHUZAM8uE O5tu4Op465GyAl88Mou/gzU= X-Received: by 2002:a1c:dc02:: with SMTP id t2mr3794313wmg.8.1590678269375; Thu, 28 May 2020 08:04:29 -0700 (PDT) Received: from ubuntu-laptop.micron.com ([165.225.203.62]) by smtp.googlemail.com with ESMTPSA id v2sm6291880wrn.21.2020.05.28.08.04.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 May 2020 08:04:28 -0700 (PDT) Message-ID: <82e8faa7d6a0c5f04832519740230f9f520347cb.camel@gmail.com> Subject: Re: [PATCH v2 1/3] scsi: ufs: remove max_t in ufs_get_device_desc From: Bean Huo To: Bart Van Assche , 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 Date: Thu, 28 May 2020 17:04:17 +0200 In-Reply-To: <85bbc91f-7b91-46fc-acff-3bcc2288c4ae@acm.org> References: <20200528115616.9949-1-huobean@gmail.com> <20200528115616.9949-2-huobean@gmail.com> <85bbc91f-7b91-46fc-acff-3bcc2288c4ae@acm.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-05-28 at 07:56 -0700, Bart Van Assche wrote: > > - 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. hi, Bart Thanks. do you mean like this: buff_len = hba->desc_size[id]? Bean