Skip to contentSkip to conversation

ufs: core: change comment message to popular format

PATCH In review [email protected] 3 participants 5 messages Jul 25, 2022 – Jul 26, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ufs: core: change comment message to popular format

From: Peter Wang <[email protected]>

Some editor cannot display ‘0’ ‘1’ in correct format. Change it to '0' '1' for most editor can display.

---
 drivers/ufs/core/ufshcd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ufs/core/ufshcd.c +4 -4
index c7b337480e3e..4ffb344bcb46 100644
@@ -760,14 +760,14 @@ static inline void ufshcd_utrl_clear(struct ufs_hba *hba, u32 mask)
 	 * From the UFSHCI specification: "UTP Transfer Request List CLear
 	 * Register (UTRLCLR): This field is bit significant. Each bit
 	 * corresponds to a slot in the UTP Transfer Request List, where bit 0
-	 * corresponds to request slot 0. A bit in this field is set to ‘0’
+	 * corresponds to request slot 0. A bit in this field is set to '0'
 	 * by host software to indicate to the host controller that a transfer
 	 * request slot is cleared. The host controller
 	 * shall free up any resources associated to the request slot
-	 * immediately, and shall set the associated bit in UTRLDBR to ‘0’. The
+	 * immediately, and shall set the associated bit in UTRLDBR to '0'. The
 	 * host software indicates no change to request slots by setting the
-	 * associated bits in this field to ‘1’. Bits in this field shall only
-	 * be set ‘1’ or ‘0’ by host software when UTRLRSR is set to ‘1’."
+	 * associated bits in this field to '1'. Bits in this field shall only
+	 * be set '1' or '0' by host software when UTRLRSR is set to '1'."
 	 */
 	ufshcd_writel(hba, ~mask, REG_UTP_TRANSFER_REQ_LIST_CLEAR);
 }
Signature · 1 line
2.18.0
#1 lore raw
Quoted 4 lines · On 7/25/22 06:15, [email protected] wrote:

From: Peter Wang <[email protected]>

Some editor cannot display ‘0’ ‘1’ in correct format. Change it to '0' '1' for most editor can display.

As far as I know checkpatch accepts non-ASCII UTF-8 characters. Using this encoding is essential to spell non-English names correctly in source files. I don't think it's feasible nor desirable to eliminate all non-ASCII UTF-8 from kernel source code files. Maybe this means that it's time to switch to another editor?

Thanks,

Bart.

#2 lore raw
Quoted 9 lines · Bart Van Assche
Quoted 4 lines · On 7/25/22 06:15, [email protected] wrote:

From: Peter Wang <[email protected]>

Some editor cannot display ‘0’ ‘1’ in correct format. Change it to '0' '1' for most editor can display.

As far as I know checkpatch accepts non-ASCII UTF-8 characters. Using this encoding is essential to spell non-English names correctly in source files.

The only foreign language that's relevant in the context of this particular comment is C. Writing '0' to indicate a char value would be fine but this is not a char value.

Quoted and unquoted zeros are used inconsistently in this comment, though the patch does not address this unfortunately.

Quoted 2 lines

I don't think it's feasible nor desirable to eliminate all non-ASCII UTF-8 from kernel source code files.

That's neither here nor there -- I don't think it's feasible or desirable to eliminate all bugs from the kernel source code files. One man's bug is another man's feature e.g. bloat, choice of programming language, interpretation of license terms.

Quoted 2 lines

Maybe this means that it's time to switch to another editor?

It's not hard to find more tooling that is impacted by misplaced unicode. The security vulnerabilities stemming from the use of Unicode in source files are telling.

Unicode doesn't help here so it shouldn't have been used here IMO.

author
#3 lore raw
Quoted 24 lines · Finn Thain
Quoted 8 lines · Bart Van Assche
Quoted 4 lines · On 7/25/22 06:15, [email protected] wrote:

From: Peter Wang <[email protected]>

Some editor cannot display ‘0’ ‘1’ in correct format. Change it to '0' '1' for most editor can display.

As far as I know checkpatch accepts non-ASCII UTF-8 characters. Using this encoding is essential to spell non-English names correctly in source files.

The only foreign language that's relevant in the context of this particular comment is C. Writing '0' to indicate a char value would be fine but this is not a char value.

Quoted and unquoted zeros are used inconsistently in this comment, though the patch does not address this unfortunately.

Quoted 2 lines

I don't think it's feasible nor desirable to eliminate all non-ASCII UTF-8 from kernel source code files.

That's neither here nor there -- I don't think it's feasible or desirable to eliminate all bugs from the kernel source code files. One man's bug is another man's feature e.g. bloat, choice of programming language, interpretation of license terms.

Quoted 7 lines
Quoted 2 lines

Maybe this means that it's time to switch to another editor?

It's not hard to find more tooling that is impacted by misplaced unicode. The security vulnerabilities stemming from the use of Unicode in source files are telling.

Unicode doesn't help here so it shouldn't have been used here IMO.

Hi Finn,

Thank you for supplementary information.

Thanks.
Peter

author
#4 lore raw
In reply to Bart Van Assche
Quoted 11 lines · Bart Van Assche
Quoted 4 lines · On 7/25/22 06:15, [email protected] wrote:

From: Peter Wang <[email protected]>

Some editor cannot display ‘0’ ‘1’ in correct format. Change it to '0' '1' for most editor can display.

As far as I know checkpatch accepts non-ASCII UTF-8 characters. Using this encoding is essential to spell non-English names correctly in source files. I don't think it's feasible nor desirable to eliminate all non-ASCII UTF-8 from kernel source code files. Maybe this means that it's time to switch to another editor?

Thanks,

Bart.

Hi Bart,

Yes, I have switch another editor when I modify this file.
Non-ASCII UTF-8 characters is not forbidden to use, but in this case, '0' and '1' is not required for people to understand this comment.

Thanks.
Peter