On 11.01.2021 22:36, Ryan Libby wrote: > On Mon, Jan 11, 2021 at 11:22 AM Jessica Clarke <jrt...@freebsd.org> wrote: >> >> On 11 Jan 2021, at 19:14, Vladimir Kondratyev <vladi...@kondratyev.su> wrote: >>> On 11.01.2021 21:03, John Baldwin wrote: >>>> On 1/10/21 9:54 PM, Ryan Libby wrote: >>>>> The branch main has been updated by rlibby: >>>>> >>>>> URL: >>>>> https://cgit.FreeBSD.org/src/commit/?id=16079c7233be8bd6c88e3421a70c7ca87cfea370 >>>>> >>>>> commit 16079c7233be8bd6c88e3421a70c7ca87cfea370 >>>>> Author: Ryan Libby <rli...@freebsd.org> >>>>> AuthorDate: 2021-01-11 05:53:15 +0000 >>>>> Commit: Ryan Libby <rli...@freebsd.org> >>>>> CommitDate: 2021-01-11 05:53:15 +0000 >>>>> >>>>> hid: quiet -Wswitch >>>>> >>>>> Gcc builds complained that not all switch cases are handled. Add >>>>> default cases to appease gcc. >>>>> >>>>> Reviewed by: hselasky (previous version), wulf >>>>> Sponsored by: Dell EMC Isilon >>>>> Differential Revision: https://reviews.freebsd.org/D28082 >>>> >>>> If these cases are never reachable, then I think '__assert_unreachable()' >>>> is preferred to a plain break. >>>> >>> These cases are reachable. They are NOP steps of state machine. >> >> How many states are there? It might be better to document that using an >> explicit set of case labels that just immediately break (and then >> -Wswitch will help you in future in case you ever forget to update one >> of the switch statements). Where possible -Wswitch is best fixed, not >> silenced with default, though there are times when the latter is >> preferable. >> >> Jess >> > > There are currently two other enum values, and four total. > > I agree with your and John's points in general. In this case, this was > specifically discussed in review and reviewers requested use of default. > From my perspective, if that's what maintainers prefer after having > considered the options, use of default is acceptable. >
Skipping of this 2 steps requires addition of extra flags just to avoid calling of NOP routine once at device_probe() and once at device_detach(). I see no reason to add such a micro-optimization at cost of simplicity. _______________________________________________ dev-commits-src-main@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"