[PATCH] nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()

Varun Prakash varun at chelsio.com
Mon Jul 31 11:30:33 PDT 2023


>> 
>> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c 
>> index 868aa4de2e4c..05163751f2e5 100644
>> --- a/drivers/nvme/target/tcp.c
>> +++ b/drivers/nvme/target/tcp.c
>> @@ -348,8 +348,8 @@ static void nvmet_tcp_build_pdu_iovec(struct nvmet_tcp_cmd *cmd)
>>   	while (length) {
>>   		u32 iov_len = min_t(u32, length, sg->length - sg_offset);
>>   
>> -		bvec_set_page(iov, sg_page(sg), sg->length,
>> -				sg->offset + sg_offset);
>> +		bvec_set_page(iov, sg_page(sg), iov_len,
>> +			      sg->offset + sg_offset);
>
>The second line alignment modification is unneeded.

checkpatch.pl was reporting following CHECK warning so I fixed the alignment.

CHECK: Alignment should match open parenthesis
#27: FILE: drivers/nvme/target/tcp.c:352:
+               bvec_set_page(iov, sg_page(sg), iov_len,
                                sg->offset + sg_offset);



More information about the Linux-nvme mailing list