Re: [PATCH] qlge: refactor qlge_change_rx_buffers() in qlge_main.c

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

 



Hi, Adam!

Looks like you have missed all maintainers in your CC list :) Please, use ./script/get_mainainer.pl to get list of people who are responsible for reviewing your code

On 12/28/21 16:57, Adam Kandur wrote:
Greetings. As I understand, qlge_change_rx_buffers() waits 4 times for
an outstanding reset to complete. And if it cannot, reports about
timeout. I assume this can be written using for loop instead of while,
wich looks nicer for me. Hope my guess was right.


Commit message should only explain why you do this change. You can leave your unrelated thoughts/questions below ---, since this part won't be visible in gitlog

Signed-off-by: Adam Kandur <sys.arch.adam@xxxxxxxxx>
---

<--- here

  drivers/staging/qlge/qlge_main.c | 15 ++++++---------
  1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index 9873bb2a9ee4..f36e43a85038 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -4012,19 +4012,16 @@ static int qlge_change_rx_buffers(struct qlge_adapter *qdev)
/* Wait for an outstanding reset to complete. */
  	if (!test_bit(QL_ADAPTER_UP, &qdev->flags)) {

Aren't there 5 checks actually? It seems unlikely that this bit will be set after 3-4 instructions


-		int i = 4;
-
-		while (--i && !test_bit(QL_ADAPTER_UP, &qdev->flags)) {
+		for (int i = 4; !test_bit(QL_ADAPTER_UP, &qdev->flags); i--) {

Have you compiled this patch? Compiler should have warn you about mixed declaration and code.



With regards,
Pavel Skripkin




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux