Re: [PATCH v2] scsi: Bypass certain SCSI commands on disks with "use_192_bytes_for_3f" attribute

From: Bart Van Assche
Date: Fri Feb 07 2025 - 12:51:31 EST


On 2/7/25 1:17 AM, WangYuli wrote:
+ /* Bofore we queue this comman, check attribute use_192_bytes_for_3f */

Please replace this source code comment with a comment that explains why the code below is necessary. The above comment duplicates the code below
rather than explaining something that cannot be derived from the code
easily. Additionally, there are spelling errors in the above comment.

+ if (cmd->cmnd[0] == MODE_SENSE && sdev->use_192_bytes_for_3f == 1 &&

Please remove "== 1" because this part is redundant when using a single
bit in a boolean "and" expression.

+ cmd->result = (DID_ABORT << 16);

Please remove the superfluous parentheses from the above statement.

Thanks,

Bart.