Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp546658ybm; Thu, 28 May 2020 09:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxToL9F4Pd0Q0zVWRmEI4hoaeLYL4q58WMcg966xa6Ygt3AiBe+ig+RisFVQGdTOH/7YVdo X-Received: by 2002:aa7:d2d0:: with SMTP id k16mr3823601edr.272.1590682004011; Thu, 28 May 2020 09:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590682004; cv=none; d=google.com; s=arc-20160816; b=LHxluqs6rM1VODSC5BA0gwLAZrc6Wf7yK+8jP7QPR1rTCW1EeEueYoag0dgS7lS3ux 5ujXxr53VisPBe2YmQRSZVcxeFs7/dFHabzD754rKyvV7oJZxAI3Tt1veWZ9GzIm0KEj lWZgqOTDJtwsfvGTiOKtK1VCdwgBoInuCmTJCFrLj2ckq7vHjZNBG+yTR9wu32dQS7mw KmuoA01CzmPeiTO8ks/YvZPutsWZWPXh6GejjDV0oXB53un9+ZiHd5KsmyPeHbCb1sJ7 32BJj/sF3+AFmGbdJvi1T+c7FVfxeyhSXZ8QcYBFOpNK5GJYcps8vefjejPzslDFJJiV E/pQ== 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=NYbB8W/sK5Tdd5BWIln6OVmuCc5eV8VaAbys7to+vVI=; b=IN2cojMHZ5upM2WYQz4sY6VawmkbU17KBIA48+SqQgtZP0YMpWIDyEd2bwLQ4n9dTf XJ4bwVdUqjTxS5/nxsh+b/qHcYfmKAytAA/v3q/Sab/e6KVT8tpLN0BkDExU2eAoWTYX TytSXi6GJjgOPm7KVCDMTBH0naR4n7kUYAWGBQm3r+IzEvl8N4lqZGlp/6GUHzp523Hr i88DzaUnAz04iFfOSJJ++BGlR8GdxlY15LdbU0O2XGulIXG9HklMiIzumYZTD8s4JgFF 31HH4BB6l9o9A6GtIZfuHcQ4xU2wD3WxcO+Vl5yfZupI7FS69Z+n0+L5atCvCjPfiVzS 99qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G+8THdO2; 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 ch28si3709365edb.90.2020.05.28.09.06.20; Thu, 28 May 2020 09:06:43 -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=G+8THdO2; 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 S2404834AbgE1QEH (ORCPT + 99 others); Thu, 28 May 2020 12:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404688AbgE1QEF (ORCPT ); Thu, 28 May 2020 12:04:05 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C63C08C5C6; Thu, 28 May 2020 09:04:05 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id n5so3846149wmd.0; Thu, 28 May 2020 09:04:05 -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=NYbB8W/sK5Tdd5BWIln6OVmuCc5eV8VaAbys7to+vVI=; b=G+8THdO2rsiizTUxp1RVKC1ojHNIsKa+XMTeB1jsw0ZZFO/JZvSjnoUz+HktWlNNbO wxvf7hiXp+S7sa/sJ+hRNU5hXGPFXBIRnQzZ5+sc7FpYgNrCux32RxyLzcXNm0do9L+r YfIwJKYv2iz9qFdcZt6P8QXqZ5alQjosBH1KAwcBFFUTdlGXduNarwx9zm3J6ePw/gXz fqpi5bqjMo7N/VGynABlW9dboVFH6U2pfjDpQ+r3fhScroFoanZp+XepdzJuD0MLZBjJ +whbTbCv0gqB67y4z2JRZtAZFL0E9T68JNGNQQ2SXQ9n8UlEEvvWyFuQXCwddo81jj+p Zl4g== 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=NYbB8W/sK5Tdd5BWIln6OVmuCc5eV8VaAbys7to+vVI=; b=lK51XxGsPybSZhQxJH/fi7uVj/AmGM/GrP+o61mm/sCQYPMV+ZQdoNRDiCFQBKGsy8 /fldaL2X6XxaZ2jGSwWIEsEk+a4RsH3GCOhPrfrkmKih2F8vEcxTf7/f7uri4grF4EVS MlIc2vp4hyB6gk87GcyV4uzaWKlZRaehpIky2rifhNmI2PjOxQ4rZMoEwTLMWaEY94ny kXU42AMeGciUZKUtzYJx9DXyFknikwD6mQw+TZXt8lvhOC2124DYez93pXtbtNfwt7wf hcspwe0ZocCjOe2T8RgMCYF8nAUB/XAZgDmMPRHqDMijg1QNmbW28t5wqN9Z2SaulT9F nT5w== X-Gm-Message-State: AOAM532AKao7fD1B1ll6zlJnT7nDzhUbb/1IH2LoU+CTNYP20PaUSLMm 7rqnb7G2HXKSeGAzQhyNsFvDlLpdY70= X-Received: by 2002:a1c:3c08:: with SMTP id j8mr4012429wma.158.1590681844011; Thu, 28 May 2020 09:04:04 -0700 (PDT) Received: from ubuntu-laptop.micron.com ([165.225.203.62]) by smtp.googlemail.com with ESMTPSA id y66sm6577290wmy.24.2020.05.28.09.04.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 May 2020 09:04:03 -0700 (PDT) Message-ID: Subject: Re: [PATCH v2 3/3] scsi: ufs: cleanup ufs initialization path 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 18:03:52 +0200 In-Reply-To: References: <20200528115616.9949-1-huobean@gmail.com> <20200528115616.9949-4-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 14:58 +0000, Avri Altman wrote: > Hi, > > > From: Bean Huo > > > > At UFS initialization stage, to get the length of the descriptor, > > ufshcd_read_desc_length() being called 6 times. > > May I suggest one more clarifying sentence to your commit log: > "Instead, we will capture the descriptor size the first time we'll > read it." > > > This patch is to > > delete unnecessary reduntant code, remove ufshcd_read_desc_length() > > typo: redundant fixed. > > > and boost UFS initialization. > > > > Signed-off-by: Bean Huo > > + if (desc_id >= QUERY_DESC_IDN_MAX) { > > *desc_len = 0; > > return -EINVAL; > > } > > if (desc_id == QUERY_DESC_IDN_RFU_0 || desc_id == > QUERY_DESC_IDN_RFU_1) > *desc_len = 0; > else > > + > > + *desc_len = hba->desc_size[desc_id]; > > return 0; > > } > > EXPORT_SYMBOL(ufshcd_map_desc_id_to_length); > > > > +static void ufshcd_update_desc_length(struct ufs_hba *hba, > > + enum desc_idn desc_id, int > > desc_len) > > desc_len is at most 255 so maybe u8? > Avri thanks, it will be changed in next version. Bean