Re: M7101

From: Matthew Wilcox (matthew_at_wil.cx)
Date: 02/06/05

  • Next message: Jeff Garzik: "[SATA] libata-dev queue updated, status report"
    Date:	Sun, 6 Feb 2005 15:06:11 +0000
    To: Jean Delvare <khali@linux-fr.org>
    
    

    On Sun, Feb 06, 2005 at 03:26:15PM +0100, Jean Delvare wrote:
    > Maarten Deprez then converted it to the proper kernel coding-style:
    > http://marc.theaimsgroup.com/?l=linux-kernel&m=110726276414532
    >
    > I invite you to test the new patch and confirm that it works for you.
    >
    > Any chance we could get the PCI folks to review the code and push it
    > upwards if it is OK?

    Looks pretty good to me. For clarity, I'd change:

    - m7101 = pci_scan_single_device(dev->bus, 0x18);
    + m7101 = pci_scan_single_device(dev->bus, PCI_DEVFN(3, 0));

    and then test m7101 for being NULL -- if it fails, you'll get a NULL
    ptr dereference from pci_read_config_byte():

    - if (pci_read_config_byte(m7101, 0x5B, &val)) {
    + if (!m7101 || pci_read_config_byte(m7101, 0x5B, &val)) {

    I don't think you need to bother checking the subsequent write for failure:

             if (val & 0x06) {
    - if (pci_write_config_byte(m7101, 0x5B, val & ~0x06)) {
    - printk(KERN_INFO "PCI: Failed to enable M7101 SMBus Controller\n");
    - return;
    - }
    + pci_write_config_byte(m7101, 0x5B, val & ~0x06);
             }

    So conceptually, I approve, just some details need fixing.

    -- 
    "Next the statesmen will invent cheap lies, putting the blame upon 
    the nation that is attacked, and every man will be glad of those
    conscience-soothing falsities, and will diligently study them, and refuse
    to examine any refutations of them; and thus he will by and by convince 
    himself that the war is just, and will thank God for the better sleep 
    he enjoys after this process of grotesque self-deception." -- Mark Twain
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Jeff Garzik: "[SATA] libata-dev queue updated, status report"

    Relevant Pages

    • Following Up Employee Benefits
      ... I had sent you an email about your Employee Benefits Program. ... Did you get a chance to review it? ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: HARDWARE: Open-Source-Friendly Graphics Cards -- Viable?
      ... If it has any chance of being on-par or a little ... I wouldn't buy a card that wouldn't have the three aforementioned features. ... a blurry fast one. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: bad page state under possibly oom situation
      ... But now you're reproducing it again, ... Could you run the rename14 test on whatever kernel suits you, ... There's then a tiny chance that rmap will try ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Linux 2.4.28-pre4
      ... > and if substantial amount of users will benefit from it. ... I would appreciate a review of the driver very much. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.5-aa1
      ... > intradiff for review, plus it merges some nice lowlatency improvement ... access the net server game browser in ET to play online! ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)