On 18 May 2016 at 02:14, Jan Viktorin <viktorin at rehivetech.com> wrote: > On Fri, 13 May 2016 09:22:23 +0800 > Jianbo Liu <jianbo.liu at linaro.org> wrote: > >> On 6 May 2016 at 21:47, Jan Viktorin <viktorin at rehivetech.com> wrote: >> > Generalize the PCI-specific pci_unbind_kernel_driver. It is now divided >> > into >> > two parts. First, determination of the path and string identification of >> > the >> > device to be unbound. Second, the actual unbind operation which is generic. >> > - if ((n < 0) || (n >= (int)sizeof(buf))) { >> > + if ((n < 0) || (n >= (int)sizeof(devid))) { >> >> Is it better to move "(n >= (int)sizeof(devid))" before snprintf and >> it has different reason from "n < 0"? > > I don't understant this comment. I cannot move the check for _n_ before > the snprintf as it is its return value... Can you provide an example of > your idea? > > Do you mean to split the condition to if (n < 0) and else if (n >= ...)? > No, I thought the correct output of devid is a fixed-size string, and need to check the buf length before snprintf. but it seems unnessaray. Sorry :(
- [dpdk-dev] [RFC 4/7] eal/linuxapp: support SoC infra in lin... Jan Viktorin
- [dpdk-dev] [RFC 5/7] eal: init SoC infra on rte_eal_init Jan Viktorin
- [dpdk-dev] [RFC 6/7] eal/soc: make SoC infra testable on an... Jan Viktorin
- [dpdk-dev] [RFC 7/7] app/test: add SoC infra probe/detach t... Jan Viktorin
- [dpdk-dev] [PATCH v1 00/28] Support non-PCI devices Jan Viktorin
- [dpdk-dev] [PATCH v1 01/28] eal: make enum rte_kernel_... Jan Viktorin
- [dpdk-dev] [PATCH v1 02/28] eal: extract function eal_... Jan Viktorin
- [dpdk-dev] [PATCH v1 03/28] eal/linux: extract functio... Jan Viktorin
- [dpdk-dev] [PATCH v1 03/28] eal/linux: extract fun... Jianbo Liu
- [dpdk-dev] [PATCH v1 03/28] eal/linux: extract... Jan Viktorin
- [dpdk-dev] [PATCH v1 03/28] eal/linux: ext... Jianbo Liu
- [dpdk-dev] [PATCH v1 04/28] eal/linux: extract functio... Jan Viktorin
- [dpdk-dev] [PATCH v1 05/28] eal: remove pci_ prefix fr... Jan Viktorin
- [dpdk-dev] [PATCH v1 06/28] eal/soc: introduce very es... Jan Viktorin
- [dpdk-dev] [PATCH v1 07/28] eal/soc: add rte_eal_soc_r... Jan Viktorin
- [dpdk-dev] [PATCH v1 07/28] eal/soc: add rte_eal_s... Shreyansh Jain
- [dpdk-dev] [PATCH v1 07/28] eal/soc: add rte_e... Jan Viktorin
- [dpdk-dev] [PATCH v1 07/28] eal/soc: add rte_e... Shreyansh Jain
- [dpdk-dev] [PATCH v1 07/28] eal/soc: add r... Jan Viktorin
- [dpdk-dev] [PATCH v1 08/28] eal/soc: implement SoC dev... Jan Viktorin
- [dpdk-dev] [PATCH v1 09/28] eal: introduce --no-soc op... Jan Viktorin