Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pci fixbug #13657

Merged
merged 8 commits into from
Sep 27, 2024
Merged

Pci fixbug #13657

merged 8 commits into from
Sep 27, 2024

Conversation

lipengfei28
Copy link
Contributor

@lipengfei28 lipengfei28 commented Sep 27, 2024

Summary

1.pci.c: fix warning when CONFIG_PCI_ASSIGN_ALL_BUSES=n
2.pci.c: fix pci 32bit warning
3.toolchain/ghs: Fix ?? "trigraphs not allowed" warnings
4.pci_qemu_test.c: fix compiler warning
5.change all devfn type to unsigned int
6.one pci device should only associate with one driver

Impact

Testing

@github-actions github-actions bot added Area: PCI Size: S The size of the change in this PR is small labels Sep 27, 2024
@nuttxpr
Copy link

nuttxpr commented Sep 27, 2024

[Experimental Bot, please feedback here]

NuttX PR Requirements Review

This PR appears incomplete. Here's a breakdown based on the provided information:

Summary:

  • Insufficient: While it lists files changed and hints at fixes, it lacks clear explanations of:
    • Necessity: Why are these warnings problematic? What issues did they cause?
    • Functionality: Which code parts are affected (beyond file names)?
    • Mechanism: How do the changes address the warnings? Code examples would help.
  • Missing: Issue/PR references are absent. Were these changes prompted by existing reports?

Impact:

  • Entirely Missing: This section is crucial. The PR needs to address ALL impact points, even if the answer is "NO" with justification.
    • For example, a warning fix might seem like no user impact, but could subtly change build behavior if flags were modified.

Testing:

  • Insufficient: Simply stating "changes are verified" is not enough.
  • Missing:
    • Specifics: What build hosts and targets were used? Vague terms aren't helpful.
    • Logs: "your testing logs here" is unhelpful placeholder text. Provide ACTUAL logs demonstrating the issue before and the fix after.

Conclusion:

This PR needs significant work to meet NuttX standards. Focus on clarity, completeness, and providing concrete evidence of both the problem and the solution.

CV-Bowen and others added 8 commits September 27, 2024 14:23
pci/pci.c:415:34: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
  415 |       FAR struct pci_resource_s *res;
      |                                  ^~~
pci/pci.c: In function ‘pci_scan_bus’:
pci/pci.c:663:32: warning: unused variable ‘ctrl’ [-Wunused-variable]
  663 |   FAR struct pci_controller_s *ctrl = bus->ctrl;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
pci/pci.c:863:66: warning: right shift count >= width of type [-Wshift-count-overflow]
  863 |       pci_write_config_dword(dev, msi + PCI_MSI_ADDRESS_HI, (mar >> 32));

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 263: warning apache#1695-D:
          trigraphs not allowed
  #define  PCI_PM_CTRL_DATA_SEL_MASK        0x1e00  /* Data select (??) */
                                                                    ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 264: warning apache#1695-D:
          trigraphs not allowed
  #define  PCI_PM_CTRL_DATA_SCALE_MASK      0x6000  /* Data scale (??) */
                                                                   ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 266: warning apache#1695-D:
          trigraphs not allowed
  #define PCI_PM_PPB_EXTENSIONS             6       /* PPB support extensions (??) */
                                                                               ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 267: warning apache#1695-D:
          trigraphs not allowed
  #define  PCI_PM_PPB_B2_B3                 0x40    /* Stop clock when in D3hot (??) */
                                                                                 ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 268: warning apache#1695-D:
          trigraphs not allowed
  #define  PCI_PM_BPCC_ENABLE               0x80    /* Bus power/clock control enable (??) */
                                                                                       ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 269: warning apache#1695-D:
          trigraphs not allowed
  #define PCI_PM_DATA_REGISTER              7       /* (??) */

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
pci/pci_qemu_test.c:218:6: warning: ‘ops’ may be used uninitialized [-Wmaybe-uninitialized]
  218 |   ops->write(dev->bus, &hdr->test, num, sizeof(num));
      |   ~~~^~~~~~~
pci/pci_qemu_test.c: In function ‘pci_qemu_test_probe’:
pci/pci_qemu_test.c:286:41: note: ‘ops’ was declared here
  286 |   FAR const struct pci_qemu_test_ops_s *ops;
      |

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
pci/pci.c:1128:15: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
 1128 |       pciinfo("Limit MME to %x, num to %d\n", mmc, num);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                               |
      |                                               uint32_t {aka long unsigned int}
pci/pci.c:1128:30: note: format string is defined here
 1128 |       pciinfo("Limit MME to %x, num to %d\n", mmc, num);
      |                             ~^
      |                              |
      |                              unsigned int
      |                             %lx

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Now all the type of devfn in pci framework are unsigned int

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit e706805 into apache:master Sep 27, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: PCI Size: S The size of the change in this PR is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants