Powered by Linux
Re: Adding PCI hotplug safe checking to smatch — Semantic Matching Tool

Re: Adding PCI hotplug safe checking to smatch

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

 



On Tue, 28 Jan 2014 03:32:47 +0300
Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:

> The infinite loop check seems to work pretty well.

This is pretty neat.  A question about the warnings out of the ixgb
driver.  For example:

drivers/net/ethernet/intel/ixgb/ixgb_hw.c:777 ixgb_read_phy_reg() warn: this loop depends on readl() succeeding

 767         for (i = 0; i < 10; i++)
 768         {
 769                 udelay(10);
 770 
 771                 command = IXGB_READ_REG(hw, MSCA);
 772 
 773                 if ((command & IXGB_MSCA_MDI_COMMAND) == 0)
 774                         break;
 775         }
 776 
 777         ASSERT((command & IXGB_MSCA_MDI_COMMAND) == 0);

is smatch warning about the for loops or the ASSERT macro?

These particular for(0..9) loops can't loop infinitely.  Maybe the
ASSERT is implemented as a "do {} while(0)" that is triggering the
warning?

Aside from that, the warnings look legitimate.  How old the drivers are
and how well they handle hotplug in general is of course another
matter :)

Regards,

-- Joe
--
To unsubscribe from this list: send the line "unsubscribe smatch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux