Re: [dpdk-dev] [PATCH] bus/pci: nvme on Windows requires class id and bus
From: Thomas Monjalon <hidden>
Date: 2021-01-26 22:41:29
From: Thomas Monjalon <hidden>
Date: 2021-01-26 22:41:29
26/01/2021 19:18, Nick Connolly:
Hi Tal, Thanks for the comments.quoted
quoted
+ /* Try and find PCI class ID */ + for (cp = buf; !(cp[0] == 0 && cp[1] == 0); cp++)How about for (cp = buf; cp[0] || cp[1]; cp++)That would be my preferred idiom, but the DPDK coding style (1.9.1) says 'do not use ! for tests unless it is a boolean' (but somewhat confusingly does so in a section on NULL pointers). I interpreted it as a general prohibition on conditionals without an explicit operator (except for booleans). I'd love to be corrected here!
That's true. Comparisons should be explicit.