Re: [PATCH] scsi: target: iscsi: Use int type to store negative value
From: Martin K. Petersen
Date: Tue Sep 16 2025 - 22:27:34 EST
On Tue, 02 Sep 2025 20:50:14 +0800, Qianfeng Rong wrote:
> Change the 'ret' variable in iscsit_tmr_task_reassign() from u64 to int,
> as it needs to store either negative value or zero returned by
> iscsit_find_cmd_for_recovery().
>
> Storing the negative error codes in unsigned type, or performing equality
> comparisons (e.g., ret == -2), doesn't cause an issue at runtime [1] but
> can be confusing. Additionally, assigning negative error codes to unsigned
> type may trigger a GCC warning when the -Wsign-conversion flag is enabled.
>
> [...]
Applied to 6.18/scsi-queue, thanks!
[1/1] scsi: target: iscsi: Use int type to store negative value
https://git.kernel.org/mkp/scsi/c/b0aca7ae8285
--
Martin K. Petersen