From patchwork Tue Oct 29 23:07:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11218729 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84495139A for ; Tue, 29 Oct 2019 23:07:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B80A20862 for ; Tue, 29 Oct 2019 23:07:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726084AbfJ2XHT (ORCPT ); Tue, 29 Oct 2019 19:07:19 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:35975 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbfJ2XHT (ORCPT ); Tue, 29 Oct 2019 19:07:19 -0400 Received: by mail-pg1-f194.google.com with SMTP id j22so142624pgh.3 for ; Tue, 29 Oct 2019 16:07:18 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NvdJ0J3EFSq0dGCh9Kl/4cuq+hGjdyFm+8JtozGH+b4=; b=eMefxGBUNykU/3jF024/Xm2ZG+0SOi8X75ipgtNMLdKhluwK7ZeDAmP/hG23loJX5L bpYvDO8rOtahpcRdN+EpxdPzxKzjTfIkgFehZLF8+dzqC2CLcUjWpgvx0ZUg4F80xI6r ppoua0Saeq7HTt9vN3kryMly2MDJfBkZGobaP9Y0ejYmJkDueco9Xpw3L9G2t5DSSfO1 lf6u7XV+uUsPkObXm2N7cj23Iuf4xGatI1rRamC01KXikMDVV1jfrX1d5ecHkNaWz2I8 2HJSkxc3sGMWPMJoiPz0ImfRx8NlexvjdtkRDLhYW1124Oon9IG8T+DChgKepH94dOVL H44A== X-Gm-Message-State: APjAAAXHyX7HIIBhCxp7p3OXcfqgF1VBlr1ssGo20629vSef/SsWXvo/ t0Lvg55RZgp2Ndu9kf8tP9o= X-Google-Smtp-Source: APXvYqxOzF1tlvde/gRkdG/gGvpvndWmZL0BhXCAgdIQPWC3HVI4vj/3U/RfJBBiKLoqdO822EM6TQ== X-Received: by 2002:a17:90a:9293:: with SMTP id n19mr9778596pjo.67.1572390438259; Tue, 29 Oct 2019 16:07:18 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id z21sm170500pfa.119.2019.10.29.16.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 16:07:17 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Yaniv Gardi , Subhash Jadavani , Stanley Chu , Avri Altman , Tomas Winkler Subject: [PATCH 1/3] ufs: Fix kernel-doc warnings Date: Tue, 29 Oct 2019 16:07:08 -0700 Message-Id: <20191029230710.211926-2-bvanassche@acm.org> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog In-Reply-To: <20191029230710.211926-1-bvanassche@acm.org> References: <20191029230710.211926-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Fix the following three kernel-doc warnings: drivers/scsi/ufs/ufs_bsg.c:165: warning: Function parameter or member 'hba' not described in 'ufs_bsg_remove' drivers/scsi/ufs/ufshcd.c:5789: warning: Function parameter or member 'cmd_type' not described in 'ufshcd_issue_devman_upiu_cmd' drivers/scsi/ufs/ufshcd.c:5789: warning: Excess function parameter 'msgcode' description in 'ufshcd_issue_devman_upiu_cmd' Cc: Yaniv Gardi Cc: Subhash Jadavani Cc: Stanley Chu Cc: Avri Altman Cc: Tomas Winkler Signed-off-by: Bart Van Assche Reviewed-by: Avri Altman --- drivers/scsi/ufs/ufs_bsg.c | 1 + drivers/scsi/ufs/ufshcd.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs_bsg.c b/drivers/scsi/ufs/ufs_bsg.c index a9344eb4e047..3a2e68f1ad42 100644 --- a/drivers/scsi/ufs/ufs_bsg.c +++ b/drivers/scsi/ufs/ufs_bsg.c @@ -158,6 +158,7 @@ static int ufs_bsg_request(struct bsg_job *job) /** * ufs_bsg_remove - detach and remove the added ufs-bsg node + * @hba: per adapter object * * Should be called when unloading the driver. */ diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index c28c144d9b4a..7ced77c8cc4d 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5768,9 +5768,9 @@ static int ufshcd_issue_tm_cmd(struct ufs_hba *hba, int lun_id, int task_id, * @hba: per-adapter instance * @req_upiu: upiu request * @rsp_upiu: upiu reply - * @msgcode: message code, one of UPIU Transaction Codes Initiator to Target * @desc_buff: pointer to descriptor buffer, NULL if NA * @buff_len: descriptor size, 0 if NA + * @cmd_type: specifies the type (NOP, Query...) * @desc_op: descriptor operation * * Those type of requests uses UTP Transfer Request Descriptor - utrd. From patchwork Tue Oct 29 23:07:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11218731 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5D7C13B1 for ; Tue, 29 Oct 2019 23:07:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD1112086A for ; Tue, 29 Oct 2019 23:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726217AbfJ2XHV (ORCPT ); Tue, 29 Oct 2019 19:07:21 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:35978 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbfJ2XHV (ORCPT ); Tue, 29 Oct 2019 19:07:21 -0400 Received: by mail-pg1-f195.google.com with SMTP id j22so142658pgh.3 for ; Tue, 29 Oct 2019 16:07:19 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=LnV0hNXe1rBYMW94ufpo75neVX/K7K//wWXTb9puerY=; b=JDyFs5LE2IfDZ0kzq5y+Tx2iS4E4mQibsmn6S0gY05E6RO3339Cp/9eXuHgEP8XJwI lL/OvC3ar4b+jXBfjofZEgzeKVfOwxoHq5oBipwvHTnw20cshdS2w+BQnqCJmChxPbMS qVucLhrg5GDoIkM8ULg9nUB694YaMQjMnAGswXlWtEPJa8wjwLOdWG3dNNkUGgGuuYN8 lUG+PB1fCI3AC/OnbFWVyR2bzbuTRV5IR4zzKW3sh1ByOy2N0BU0JTfJ9TBZjfScmWkB C/Pc237G0pqLJiuliKzy65bvg5anjdmr1gLRrJcTdgOO9PRUXwOMzfJAQbp32ZLC1w6Z gRdw== X-Gm-Message-State: APjAAAUgpaOiENrRz7reIa8QSdytj4gRAfULpw2G+tlNAFznNkiQykae /GpvrLD3Wa2QWEOgfSBpp80= X-Google-Smtp-Source: APXvYqxjzVbGtw0xikV1UhYW1oqZ5MM90Pf2PI+CUdchc+GSuv7vPZ4GWcjLwGz1i/5X6N3yCQo6vA== X-Received: by 2002:a17:90a:730a:: with SMTP id m10mr10014872pjk.78.1572390439514; Tue, 29 Oct 2019 16:07:19 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id z21sm170500pfa.119.2019.10.29.16.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 16:07:18 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Yaniv Gardi , Subhash Jadavani , Stanley Chu , Avri Altman , Tomas Winkler Subject: [PATCH 2/3] ufs: Use enum dev_cmd_type where appropriate Date: Tue, 29 Oct 2019 16:07:09 -0700 Message-Id: <20191029230710.211926-3-bvanassche@acm.org> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog In-Reply-To: <20191029230710.211926-1-bvanassche@acm.org> References: <20191029230710.211926-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Declare all variables that hold dev_cmd_type values as an enum instead of as an int. Cc: Yaniv Gardi Cc: Subhash Jadavani Cc: Stanley Chu Cc: Avri Altman Cc: Tomas Winkler Signed-off-by: Bart Van Assche Reviewed-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 7ced77c8cc4d..180033b4b515 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5784,7 +5784,7 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba, struct utp_upiu_req *req_upiu, struct utp_upiu_req *rsp_upiu, u8 *desc_buff, int *buff_len, - int cmd_type, + enum dev_cmd_type cmd_type, enum query_opcode desc_op) { struct ufshcd_lrb *lrbp; @@ -5899,7 +5899,7 @@ int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba, enum query_opcode desc_op) { int err; - int cmd_type = DEV_CMD_TYPE_QUERY; + enum dev_cmd_type cmd_type = DEV_CMD_TYPE_QUERY; struct utp_task_req_desc treq = { { 0 }, }; int ocs_value; u8 tm_f = be32_to_cpu(req_upiu->header.dword_1) >> 16 & MASK_TM_FUNC; From patchwork Tue Oct 29 23:07:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11218733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D01D15AB for ; Tue, 29 Oct 2019 23:07:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 541E220862 for ; Tue, 29 Oct 2019 23:07:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726234AbfJ2XHV (ORCPT ); Tue, 29 Oct 2019 19:07:21 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:35352 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726091AbfJ2XHV (ORCPT ); Tue, 29 Oct 2019 19:07:21 -0400 Received: by mail-pf1-f193.google.com with SMTP id d13so176742pfq.2 for ; Tue, 29 Oct 2019 16:07:21 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=qI0vB1ht784SEbdQ8xMLIrR45Ab8C5O3nNjvAnIo0gE=; b=rdTSg+7a7P5iZCfEXyLrtHaqX1cWbxQ+I4UPlBV24r6OpUrWu4qdSZdogF/I8QPRit t3eEg4Z/BlTbJkOkT6cKTbok5cAp2mC49gd8FMIbvvQ2/LmUjY6sgV+QBVjz/4PI5nQz 7qoQXkeAxGA0/0elaSskBv4WmEsiI/5N6/+XWm9NISbW/swv4N+c26PFm63FwB42ntXW OFKAuqoTx9Cu8Ebm6tmQoCVuKDzZX9Cjqu5eyWU8feNWQ3rAE4dmyTdQ2/gwW0q3RopN h1C3MYQzYI2xMTw/3aAsn5yvWKJ9dnZkWM1M3bhAwzHvUkfyMPIdT4vAGNoR2wQ2U10g S+Cw== X-Gm-Message-State: APjAAAVz5EJwEpWap2t4lpNivAf2bBVWMqXjmzqwSL8gi4Yn0d4hRO3g ME/CfBiPGthcL4lQdTmKtMU= X-Google-Smtp-Source: APXvYqwm3tmEbKSYGTR3Fdwmm56u3qbA3a1PAXUmyamMHdxNYUEpCSvpg7UEc2hAnz2KejCxTE8KDw== X-Received: by 2002:a17:90a:d3c7:: with SMTP id d7mr9666525pjw.22.1572390440798; Tue, 29 Oct 2019 16:07:20 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id z21sm170500pfa.119.2019.10.29.16.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 16:07:20 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Yaniv Gardi , Subhash Jadavani , Stanley Chu , Avri Altman , Tomas Winkler Subject: [PATCH 3/3] ufs: Remove .setup_xfer_req() Date: Tue, 29 Oct 2019 16:07:10 -0700 Message-Id: <20191029230710.211926-4-bvanassche@acm.org> X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog In-Reply-To: <20191029230710.211926-1-bvanassche@acm.org> References: <20191029230710.211926-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Since the function ufshcd_vops_setup_xfer_req() is the only user of the setup_xfer_req function pointer and since that function pointer is always zero, remove both this function and the function pointer. This patch does not change any functionality. Cc: Yaniv Gardi Cc: Subhash Jadavani Cc: Stanley Chu Cc: Avri Altman Cc: Tomas Winkler Signed-off-by: Bart Van Assche Reviewed-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 2 -- drivers/scsi/ufs/ufshcd.h | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 180033b4b515..9fc05a535624 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -2487,7 +2487,6 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) /* issue command to the controller */ spin_lock_irqsave(hba->host->host_lock, flags); - ufshcd_vops_setup_xfer_req(hba, tag, (lrbp->cmd ? true : false)); ufshcd_send_command(hba, tag); out_unlock: spin_unlock_irqrestore(hba->host->host_lock, flags); @@ -2704,7 +2703,6 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba, /* Make sure descriptors are ready before ringing the doorbell */ wmb(); spin_lock_irqsave(hba->host->host_lock, flags); - ufshcd_vops_setup_xfer_req(hba, tag, (lrbp->cmd ? true : false)); ufshcd_send_command(hba, tag); spin_unlock_irqrestore(hba->host->host_lock, flags); diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index e0fe247c719e..e3593cce23c1 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -288,8 +288,6 @@ struct ufs_pwr_mode_info { * @pwr_change_notify: called before and after a power mode change * is carried out to allow vendor spesific capabilities * to be set. - * @setup_xfer_req: called before any transfer request is issued - * to set some things * @setup_task_mgmt: called before any task management request is issued * to set some things * @hibern8_notify: called around hibern8 enter/exit @@ -318,7 +316,6 @@ struct ufs_hba_variant_ops { enum ufs_notify_change_status status, struct ufs_pa_layer_attr *, struct ufs_pa_layer_attr *); - void (*setup_xfer_req)(struct ufs_hba *, int, bool); void (*setup_task_mgmt)(struct ufs_hba *, int, u8); void (*hibern8_notify)(struct ufs_hba *, enum uic_cmd_dme, enum ufs_notify_change_status); @@ -1031,13 +1028,6 @@ static inline int ufshcd_vops_pwr_change_notify(struct ufs_hba *hba, return -ENOTSUPP; } -static inline void ufshcd_vops_setup_xfer_req(struct ufs_hba *hba, int tag, - bool is_scsi_cmd) -{ - if (hba->vops && hba->vops->setup_xfer_req) - return hba->vops->setup_xfer_req(hba, tag, is_scsi_cmd); -} - static inline void ufshcd_vops_setup_task_mgmt(struct ufs_hba *hba, int tag, u8 tm_function) {