[PATCH v2 11/20] staging: mt7621-pci: show N_FTS status using a loop

Sergio Paracuellos sergio.paracuellos at gmail.com
Tue Aug 14 11:50:05 UTC 2018


On Tue, Aug 14, 2018 at 12:46 PM, Dan Carpenter
<dan.carpenter at oracle.com> wrote:
> On Sun, Aug 12, 2018 at 08:45:56PM +0200, Sergio Paracuellos wrote:
>> diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
>> index ec1d822..f499c108 100644
>> --- a/drivers/staging/mt7621-pci/pci-mt7621.c
>> +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
>> @@ -568,14 +568,11 @@ static int mt7621_pci_probe(struct platform_device *pdev)
>>               bypass_pipe_rst(pcie);
>>       set_phy_for_ssc(pcie);
>>
>> -     val = read_config(pcie, 0, 0x70c);
>> -     printk("Port 0 N_FTS = %x\n", (unsigned int)val);
>> -
>> -     val = read_config(pcie, 1, 0x70c);
>> -     printk("Port 1 N_FTS = %x\n", (unsigned int)val);
>> -
>> -     val = read_config(pcie, 2, 0x70c);
>> -     printk("Port 2 N_FTS = %x\n", (unsigned int)val);
>> +     list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
>> +             u32 slot = port->slot;
>> +             val = read_config(pcie, slot, 0x70c);
>> +             dev_info(dev, "Port %d N_FTS = %x\n", (unsigned int)val, slot);
>> +     }
>
> We don't need to use the _safe version, unless it's doing something
> truely devious that I can't see.

Yes Dan, you are right (copy paste can kill you :-)), but this code is
included after in PATCH 14 in previous list_for_each_entry_safe
after the pcie phy refactor so I think is ok to not change anything here.

>
> regards,
> dan carpenter
>

Best regards,
    Sergio Paracuellos


More information about the devel mailing list