Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp2089462ybm; Sun, 31 May 2020 08:14:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBWznFb0aTyViVLLaBjAtwQ5fGXrHePkHN15J30T/ICNPW3qoxGrqCu6tofT0kKb+Qtzsj X-Received: by 2002:a50:9e21:: with SMTP id z30mr16835500ede.347.1590938089537; Sun, 31 May 2020 08:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590938089; cv=none; d=google.com; s=arc-20160816; b=zZee1zVSprfcE9gznUpJMpHxPAbDbLu7CwsN74xhXQqpRjltf5BMtqBHWLdmGu+Wp3 GqWr7AWOthl8DK2CIsndMjQ6u1GRMEukEOJ4LJkgvE2Bhug0RzfrV4jZf8BBrKnVkBSd rdWAR/gJfnuKzj1rY+V7WlnKulNcyooEUzTffUolSiAezNV8GwuTSG62V6FnRoRE2sRn gYXaIVLccxIrXVLyqSzxIb/QVbZE+5qAhGA3WcDqMMPVM8O9YVfPSb2Lwnp9nVcaJEv0 MnZlTB7uJG7snN3agSGhV2N1IAiwd62mej/ynDQWOdJ8cV4EmM7eONz30EIjl/QXvzmi tsOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=cSx9zeRQDNEgHX3X5I2ozAXJomME/x9VxcUo23d79NA=; b=qsx/lf8goZ0tzD6oo3R0eRRx248wQ1YkZSYRCkWAWOgj9IfTEGCdGQpJ29Yw3l1N+t w1valatZIKZqhrt+zYhLjcT6WcopQu1LjGY3oWWaKOtiLdzw4zxsqX/7F+XWXTA4SxaG 8kUz0jdk71ISmDOgXbyxHgq8rf9YUTV+YVMdORbOcX9JbwbUFgUevBqh2GS5CaTeifAG SqznWTDUP4ahy8jYfvLXl26MBVkAmlF7QD/DxYV2TsbLVGW0bn6Dg7Xce1KLvr0iUhU9 cZ3CCjn+NV+Sz+/PboThuZYU7g4bEfRzHD7a0qv3zUE4GlVod1NMtfFjYmV2MrE1ytH8 DI0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=P7izPgsB; 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 e12si9860808edc.122.2020.05.31.08.14.25; Sun, 31 May 2020 08:14:49 -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=P7izPgsB; 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 S1728173AbgEaPIp (ORCPT + 99 others); Sun, 31 May 2020 11:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbgEaPIp (ORCPT ); Sun, 31 May 2020 11:08:45 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B211BC061A0E; Sun, 31 May 2020 08:08:44 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id g9so5338454edw.10; Sun, 31 May 2020 08:08:44 -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; bh=cSx9zeRQDNEgHX3X5I2ozAXJomME/x9VxcUo23d79NA=; b=P7izPgsBaNvXpJvZqn/UcLhIRav5PZZbRGgyZdrhc5GWsUyyJXNQZP16UhzbcCL4HZ DhMImo8g27E/edm5gqQmo33KG1oh/cZ4cOT7cKwKjXlPdxZf8AWG3AqOArRK1Y6L8RLJ MX8Fs7TgtpdWjsfTZRDGEdGhGjnGcIE0lvRaR0RKZ3zsCimikhFVXTCAoiR4k4v87vqR zbGx3yR6gpw6nYMrZS2y5ZKcnKllYxYyu5Iz1zeN4BCciH+kNIyU0Bx/j+ibdV2mSSHX vrhoGcNUO/X080C8XQrBM27sqSSEz+lrUmvEV44TIMcqk3B8ST3qGvMi+CcUGITE5Cj2 GXcQ== 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; bh=cSx9zeRQDNEgHX3X5I2ozAXJomME/x9VxcUo23d79NA=; b=YS1qFPPOB+HV2AfgnyzfltVwc9lGNgasv79YDBiRXI3OjyIgXywD9+YO4peZ06ZCim xggrHerGkDh7gLYLDZO9WGczuPHvH/udPyTdWzrqqwVgfQ9Uw25VNc1k4pUAxF6K7so9 umaQjXdzEZqSYunpAOZpziuZ/F9iUxha84E/SuelPcWPbVfGn9IHfervkg9cbEGLrWDU lJt9eeODKOib1Fo8gJ5roYbNoUopU7bcDfor6fUGPk8bZnvrlgMIwmGCPTXg5MuE97Y6 6JqgmU98HfVvElGfkhne90Dq7W2q/b75I4lcIWrihReuyhIWp4aYO/ZIHu4wLIj5/WHK IAGw== X-Gm-Message-State: AOAM531sz+gyTqiadZw95WFBZRglhu7aHmZAE4OBjsD/UhfCA5T6+h+b VUjL4t1ljjkO/QNE3sz2R88= X-Received: by 2002:a05:6402:c99:: with SMTP id cm25mr17106007edb.2.1590937723328; Sun, 31 May 2020 08:08:43 -0700 (PDT) Received: from localhost.localdomain (ip5f5bfcfd.dynamic.kabel-deutschland.de. [95.91.252.253]) by smtp.gmail.com with ESMTPSA id a62sm9564928edf.38.2020.05.31.08.08.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 08:08:42 -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 Subject: [PATCH v4 0/5] scsi: ufs: cleanup ufs initialization Date: Sun, 31 May 2020 17:08:26 +0200 Message-Id: <20200531150831.9946-1-huobean@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bean Huo Cleanup UFS descriptor length initialization, and delete some unnecessary code. Changelog: v3 - v4: 1. add desc_id >= QUERY_DESC_IDN_MAX check in patch 4/5 (Avri Altman) 2. update buff_len to hold the true descriptor size in 4/5 (Avri Altman) 3. add new patch 3/5 v2 - v3: 1. Fix typo in the commit message (Avri Altman & Bart van Assche) 2. Delete ufshcd_init_desc_sizes() in patch 3/4 (Stanley Chu) 3. Remove max_t() and buff_len in patch 1/4 (Bart van Assche) 4. Add patch 4/4 to compatable with 3.1 UFS unit descriptor length v1 - v2: 1. split patch 2. fix one compiling WARNING (Reported-by: kbuild test robot ) Bean Huo (5): scsi: ufs: remove max_t in ufs_get_device_desc scsi: ufs: delete ufshcd_read_desc() scsi: ufs: fix potential access NULL pointer while memcpy scsi: ufs: cleanup ufs initialization path scsi: ufs: add compatibility with 3.1 UFS unit descriptor length drivers/scsi/ufs/ufs.h | 11 +- drivers/scsi/ufs/ufs_bsg.c | 5 +- drivers/scsi/ufs/ufshcd.c | 205 +++++++++---------------------------- drivers/scsi/ufs/ufshcd.h | 16 +-- 4 files changed, 53 insertions(+), 184 deletions(-) -- 2.17.1