Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp443954ybm; Thu, 28 May 2020 06:52:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlQfx+jRC4y2h41tpZpPBLhl+Q5/f4rL2eqhS4h+V8GV9d5mjRDo8i7myY2mqYvCkhqgxC X-Received: by 2002:a17:906:b7cd:: with SMTP id fy13mr3237131ejb.133.1590673938126; Thu, 28 May 2020 06:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590673938; cv=none; d=google.com; s=arc-20160816; b=GfbVORXNxe9MKN5BJPx863NXyEp8U7pfmaYbGwu0/G1YNWVBsU2XuE+KesA3ak5k5A mygAPdoG2rRaVcMckZFDR8W4tY6zFaYTYhl+EFgWSA7EZIhmseGCzv/Ql082P6keVEbY bmns2tO+hI/FUrzg28dhBr1PpHNNFf3xT6+v//SgpU4YptjRL6hCgsGe8B0vgYs7acbI GFGpOzA+7ZxL2GKqrNtE5LfP7xa+fZ8bbaxKq2Q9vlJXKXFVhtNvkzOJQWeresJmh06D TGUfxE4UR5tQE6jTwVm7ZvXoAlKTvl0URZVJSyujULQcPsAu7D6s2E63VnttAnBpsATI z5Qg== 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=59q2X1dLv7LPdt/5T9ul9rltygoE3RH2ulsqgC35EVc=; b=ZXJUwWELmqwPSMvo167+LlQHot8nV2OXNf0ESPLbssRgPin/xKECFcExYdRJFI8jUx eKqRspzH58rUsPR6srJ/Xao70biPOKjPWXnenetW3hocX3U+DuLWgHuNCAyGZHibfAaA 7pqsZZvypGihwOYuUYBG7TfLGD7FsYk8fbQPfhONUs4V7GfpND0yvU8XqmdC26MxEPfe idRE5kgL/ftJi+rSEG087aTtDwoeopv2PzW0TqXDy7Nw1eSyx62sO8ze7TjwozWDa5Kp SPQG0KVCaykPi2qE1+wvljEqPDUiou6KCXZGrPYsD6gQNuW840VEuWNrtxJpFLdzELRV NLZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lgozBsJ8; 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 x13si3977933ejb.364.2020.05.28.06.51.54; Thu, 28 May 2020 06:52:18 -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=lgozBsJ8; 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 S2390573AbgE1Nrz (ORCPT + 99 others); Thu, 28 May 2020 09:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390486AbgE1Nrt (ORCPT ); Thu, 28 May 2020 09:47:49 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42407C05BD1E; Thu, 28 May 2020 06:47:49 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id r15so3221730wmh.5; Thu, 28 May 2020 06:47:49 -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=59q2X1dLv7LPdt/5T9ul9rltygoE3RH2ulsqgC35EVc=; b=lgozBsJ8tJHeBiS/JAatgliagvgIkF+FzYXDS93183YNcN2cJ9rOl4GltXhIpHgBCs ll7ovbzZGz/MS22oBYPswPs8bNi+StQNyL9pkeuDv6avjBlI3OCCCRx7VVI+riKW0Kds F68RTb4A1LkKVN2QMYjLSAtwvOFBmcp/Gb3WytBo4Hm1Gfa1Xr12II5ky/Ncoaf5+H92 52DXlmtRZyYf+nIwM2bsnP/Oa+pJIbHi5S3l/OAiKiLexVzk37jrFpVGGzc2VljuxPGv 4d3o7WRVx0tdItFvB2Ksv+Yg58R5giz9gD+sn7eId8ik+rTQS9mMX9jT8jSYUgwNfTgA 3Oqw== 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=59q2X1dLv7LPdt/5T9ul9rltygoE3RH2ulsqgC35EVc=; b=UZ8bKHvu+lf0vKqeO/2yzdBZFCh43brqPpcHQhIn1t6DPb6p3TOUpmTgycPJJAf938 Bu6pWick0qcAnPt4jGVlOzzdAcVvQqVY5adbaEPqv7C8nkzkXEYEM104zQqYBNmMSPjJ Z2l7rK6VIUHGQtzXbSMInpeP2IHM1E/QOChSI+116J7qz/nyDfjHgW2Y5YE5mDP2+ZCe pnYM58xksB50mX0rhZhFol4Oh0oTDlhg18g/xfVw0cNyngVI911yr3nrmbVCFH/fK548 EIN87VAfvrLCh2baxOU5f2CB+q1ObZnEgoK0RUl0htheKl3TSsqd/v07EhyNTtD4swXf 6v5w== X-Gm-Message-State: AOAM5303lCJOZc9nGZGgMQXMgdPkF3NvITjDvHDdWfEVO683/dgyu84O OmWGfSDkreddmekH7tslXb4= X-Received: by 2002:a1c:44c3:: with SMTP id r186mr3432227wma.67.1590673667877; Thu, 28 May 2020 06:47:47 -0700 (PDT) Received: from ubuntu-laptop.micron.com ([165.225.203.62]) by smtp.googlemail.com with ESMTPSA id q128sm6146821wma.38.2020.05.28.06.47.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 May 2020 06:47:47 -0700 (PDT) Message-ID: <9a317a138c61c7937b655dbd73ffcb40985d61c8.camel@gmail.com> Subject: Re: [PATCH v2 1/3] scsi: ufs: remove max_t in ufs_get_device_desc From: Bean Huo To: Avri Altman , "alim.akhtar@samsung.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" Date: Thu, 28 May 2020 15:47:36 +0200 In-Reply-To: References: <20200528115616.9949-1-huobean@gmail.com> <20200528115616.9949-2-huobean@gmail.com> 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 13:41 +0000, Avri Altman wrote: > > +++ 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; > > So why the +1? > Originally it was used for the '\0' terminator, which is not needed > anymore. you are correct, now not need +1, I will change it. thanks, Bean