[PATCH] D112050: [clang] NFC: return void in an alternative expression after call to void function.

zhouyizhou via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 20 07:29:03 PDT 2021


zhouyizhou added a comment.

I create this patch because I am also a Linux hobbyist,  in Linux kernel, return statement in a void function is always standalone. For example in kernel/event/core.c:

static void
perf_event_exit_event(struct perf_event *child_event,

  struct perf_event_context *child_ctx,
  struct task_struct *child)

{

  ...
  if (!parent_event) {
          perf_event_wakeup(child_event);
          return;
  }
  ...

}

In above code, return statement is standalone. It was rarely seen statement like "return perf_event_wakeup(child_event);" in Linux kernel.

Thanks
Zhouyi


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112050/new/

https://reviews.llvm.org/D112050



More information about the cfe-commits mailing list