diff mbox series

[2/4] virtio-blk: don't add a new line

Message ID 20220420041053.7927-3-kch@nvidia.com (mailing list archive)
State New, archived
Headers show
Series virtio-blk: small cleanup | expand

Commit Message

Chaitanya Kulkarni April 20, 2022, 4:10 a.m. UTC
Don't split sector assignment line for REQ_OP_READ and REQ_OP_WRITE in
the virtblk_setup_cmd() which fits in one line perfectly.

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/block/virtio_blk.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Stefan Hajnoczi April 20, 2022, 3:04 p.m. UTC | #1
On Tue, Apr 19, 2022 at 09:10:51PM -0700, Chaitanya Kulkarni wrote:
> Don't split sector assignment line for REQ_OP_READ and REQ_OP_WRITE in
> the virtblk_setup_cmd() which fits in one line perfectly.
> 
> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
> ---
>  drivers/block/virtio_blk.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

There is a cost to patches: humans spend time reviewing them, CI systems
consume energy running tests, downstream maintainers deal with
backports, and git-blame(1) becomes harder to use when code changes.

What constitutes code churn is subjective. For me personally I prefer it
when patches have a clear benefit that outweighs the costs.
Nevertheless:

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Chaitanya Kulkarni April 21, 2022, 9:52 p.m. UTC | #2
On 4/20/22 08:04, Stefan Hajnoczi wrote:
> On Tue, Apr 19, 2022 at 09:10:51PM -0700, Chaitanya Kulkarni wrote:
>> Don't split sector assignment line for REQ_OP_READ and REQ_OP_WRITE in
>> the virtblk_setup_cmd() which fits in one line perfectly.
>>
>> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
>> ---
>>   drivers/block/virtio_blk.c | 6 ++----
>>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> There is a cost to patches: humans spend time reviewing them, CI systems
> consume energy running tests, downstream maintainers deal with
> backports, and git-blame(1) becomes harder to use when code changes.
> 
> What constitutes code churn is subjective. For me personally I prefer it
> when patches have a clear benefit that outweighs the costs.
> Nevertheless:
> 
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> 

maybe we can just drop it then, for naked eye it looked a bit odd
to add a new line..

-ck
diff mbox series

Patch

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index b77711e73422..d038800474c2 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -210,13 +210,11 @@  static blk_status_t virtblk_setup_cmd(struct virtio_device *vdev,
 	switch (req_op(req)) {
 	case REQ_OP_READ:
 		type = VIRTIO_BLK_T_IN;
-		vbr->out_hdr.sector = cpu_to_virtio64(vdev,
-						      blk_rq_pos(req));
+		vbr->out_hdr.sector = cpu_to_virtio64(vdev, blk_rq_pos(req));
 		break;
 	case REQ_OP_WRITE:
 		type = VIRTIO_BLK_T_OUT;
-		vbr->out_hdr.sector = cpu_to_virtio64(vdev,
-						      blk_rq_pos(req));
+		vbr->out_hdr.sector = cpu_to_virtio64(vdev, blk_rq_pos(req));
 		break;
 	case REQ_OP_FLUSH:
 		type = VIRTIO_BLK_T_FLUSH;