Re: [PATCH] parisc: Fix data TLB miss in sba_unmap_sg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-01-27 1:58 a.m., Helge Deller wrote:
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index e60690d38d67..374b9199878d 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -1047,7 +1047,7 @@ sba_unmap_sg(struct device *dev, struct scatterlist
*sglist, int nents, spin_unlock_irqrestore(&ioc->res_lock, flags);
  #endif

-	while (sg_dma_len(sglist) && nents--) {
+	while (nents && sg_dma_len(sglist)) {

What about:

	for (; nents && sg_dma_len(sglist); nents--) {
The way how Dave wrote it is more clean, IMHO.
I'm going to leave the change to sba_iommu.c as proposed.  While i'm sure the suggested
for statement would be fine, I looked at how gcc handled the while loop.  It is quite subtle.
Except for an initial test and decrement, the iteration of nents is replaced by a calculation
of the the final value for sglist.

Regarding the newline, the file has several places where newlines precede #ifdef statements.
I think the current style is okay and checkpatch.pl doesn't object to that format.

I think whitespace changes should usually be in separate patches.

Dave

--
John David Anglin  dave.anglin@xxxxxxxx




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux