Skip to content

Commit 6cae9a3

Browse files
Merge patch series "Multiple cleanup patches for the UFS driver"
Bart Van Assche <[email protected]> says: Hi Martin, This patch includes the following changes, none of which should change the functionality of the UFS host controller driver: - Improve the kernel-doc headers further. - Fix multiple W=2 compiler warnings. - Simplify ufshcd_abort_all(). - Simplify the code for creating and parsing UFS Transport Protocol (UTP) headers. Please consider this patch series for the next merge window. Thanks, Bart. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2 parents 03ce80a + 617bfaa commit 6cae9a3

18 files changed

+460
-398
lines changed

drivers/ufs/core/ufs-hwmon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ static int ufs_hwmon_write(struct device *dev, enum hwmon_sensor_types type, u32
127127
return err;
128128
}
129129

130-
static umode_t ufs_hwmon_is_visible(const void *_data, enum hwmon_sensor_types type, u32 attr,
130+
static umode_t ufs_hwmon_is_visible(const void *data,
131+
enum hwmon_sensor_types type, u32 attr,
131132
int channel)
132133
{
133134
if (type != hwmon_temp)

drivers/ufs/core/ufs-mcq.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ EXPORT_SYMBOL_GPL(ufshcd_mcq_config_mac);
105105
* @hba: per adapter instance
106106
* @req: pointer to the request to be issued
107107
*
108-
* Returns the hardware queue instance on which the request would
108+
* Return: the hardware queue instance on which the request would
109109
* be queued.
110110
*/
111111
struct ufs_hw_queue *ufshcd_mcq_req_to_hwq(struct ufs_hba *hba,
@@ -121,7 +121,7 @@ struct ufs_hw_queue *ufshcd_mcq_req_to_hwq(struct ufs_hba *hba,
121121
* ufshcd_mcq_decide_queue_depth - decide the queue depth
122122
* @hba: per adapter instance
123123
*
124-
* Returns queue-depth on success, non-zero on error
124+
* Return: queue-depth on success, non-zero on error
125125
*
126126
* MAC - Max. Active Command of the Host Controller (HC)
127127
* HC wouldn't send more than this commands to the device.
@@ -493,7 +493,7 @@ static int ufshcd_mcq_sq_start(struct ufs_hba *hba, struct ufs_hw_queue *hwq)
493493
* @hba: per adapter instance.
494494
* @task_tag: The command's task tag.
495495
*
496-
* Returns 0 for success; error code otherwise.
496+
* Return: 0 for success; error code otherwise.
497497
*/
498498
int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag)
499499
{
@@ -558,12 +558,7 @@ int ufshcd_mcq_sq_cleanup(struct ufs_hba *hba, int task_tag)
558558
*/
559559
static void ufshcd_mcq_nullify_sqe(struct utp_transfer_req_desc *utrd)
560560
{
561-
u32 dword_0;
562-
563-
dword_0 = le32_to_cpu(utrd->header.dword_0);
564-
dword_0 &= ~UPIU_COMMAND_TYPE_MASK;
565-
dword_0 |= FIELD_PREP(UPIU_COMMAND_TYPE_MASK, 0xF);
566-
utrd->header.dword_0 = cpu_to_le32(dword_0);
561+
utrd->header.command_type = 0xf;
567562
}
568563

569564
/**
@@ -575,7 +570,7 @@ static void ufshcd_mcq_nullify_sqe(struct utp_transfer_req_desc *utrd)
575570
* @hwq: Hardware Queue to be searched.
576571
* @task_tag: The command's task tag.
577572
*
578-
* Returns true if the SQE containing the command is present in the SQ
573+
* Return: true if the SQE containing the command is present in the SQ
579574
* (not fetched by the controller); returns false if the SQE is not in the SQ.
580575
*/
581576
static bool ufshcd_mcq_sqe_search(struct ufs_hba *hba,
@@ -624,7 +619,7 @@ static bool ufshcd_mcq_sqe_search(struct ufs_hba *hba,
624619
* ufshcd_mcq_abort - Abort the command in MCQ.
625620
* @cmd: The command to be aborted.
626621
*
627-
* Returns SUCCESS or FAILED error codes
622+
* Return: SUCCESS or FAILED error codes
628623
*/
629624
int ufshcd_mcq_abort(struct scsi_cmnd *cmd)
630625
{

drivers/ufs/core/ufs_bsg.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ static inline void ufs_bsg_node_release(struct device *dev)
232232
* @hba: per adapter object
233233
*
234234
* Called during initial loading of the driver, and before scsi_scan_host.
235+
*
236+
* Returns: 0 (success).
235237
*/
236238
int ufs_bsg_probe(struct ufs_hba *hba)
237239
{

drivers/ufs/core/ufshcd-crypto.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ static inline void ufshcd_prepare_lrbp_crypto(struct request *rq,
2626
}
2727

2828
static inline void
29-
ufshcd_prepare_req_desc_hdr_crypto(struct ufshcd_lrb *lrbp, u32 *dword_0,
30-
u32 *dword_1, u32 *dword_3)
29+
ufshcd_prepare_req_desc_hdr_crypto(struct ufshcd_lrb *lrbp,
30+
struct request_desc_header *h)
3131
{
32-
if (lrbp->crypto_key_slot >= 0) {
33-
*dword_0 |= UTP_REQ_DESC_CRYPTO_ENABLE_CMD;
34-
*dword_0 |= lrbp->crypto_key_slot;
35-
*dword_1 = lower_32_bits(lrbp->data_unit_num);
36-
*dword_3 = upper_32_bits(lrbp->data_unit_num);
37-
}
32+
if (lrbp->crypto_key_slot < 0)
33+
return;
34+
h->enable_crypto = 1;
35+
h->cci = lrbp->crypto_key_slot;
36+
h->dunl = cpu_to_le32(lower_32_bits(lrbp->data_unit_num));
37+
h->dunu = cpu_to_le32(upper_32_bits(lrbp->data_unit_num));
3838
}
3939

4040
bool ufshcd_crypto_enable(struct ufs_hba *hba);
@@ -51,8 +51,8 @@ static inline void ufshcd_prepare_lrbp_crypto(struct request *rq,
5151
struct ufshcd_lrb *lrbp) { }
5252

5353
static inline void
54-
ufshcd_prepare_req_desc_hdr_crypto(struct ufshcd_lrb *lrbp, u32 *dword_0,
55-
u32 *dword_1, u32 *dword_3) { }
54+
ufshcd_prepare_req_desc_hdr_crypto(struct ufshcd_lrb *lrbp,
55+
struct request_desc_header *h) { }
5656

5757
static inline bool ufshcd_crypto_enable(struct ufs_hba *hba)
5858
{

drivers/ufs/core/ufshcd-priv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd);
9393
int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,
9494
struct utp_upiu_req *req_upiu,
9595
struct utp_upiu_req *rsp_upiu,
96-
int msgcode,
96+
enum upiu_request_transaction msgcode,
9797
u8 *desc_buff, int *buff_len,
9898
enum query_opcode desc_op);
9999

@@ -294,7 +294,7 @@ extern const struct ufs_pm_lvl_states ufs_pm_lvl_states[];
294294
* ufshcd_scsi_to_upiu_lun - maps scsi LUN to UPIU LUN
295295
* @scsi_lun: scsi LUN id
296296
*
297-
* Returns UPIU LUN id
297+
* Return: UPIU LUN id
298298
*/
299299
static inline u8 ufshcd_scsi_to_upiu_lun(unsigned int scsi_lun)
300300
{

0 commit comments

Comments
 (0)