CHECK: Macro argument 'name' may be better as '(name)' to avoid precedence issues #712: FILE: drivers/ptp/ptp_cipu.c:634: +#define REG_ATTR_RO(name) \ +static ssize_t reg_##name##_show(struct device *dev, \ + struct device_attribute *attr, char *buf) \ +{ \ + struct ptp_cipu_ctx *ctx = pci_get_drvdata(to_pci_dev(dev)); \ + struct ptp_cipu_regs *regs = &ctx->regs; \ + return sysfs_emit(buf, "0x%x\n", regs->name); \ +} \ +static DEVICE_ATTR_RO(reg_##name) CHECK: Macro argument 'events' may be better as '(events)' to avoid precedence issues #735: FILE: drivers/ptp/ptp_cipu.c:657: +#define STATS_ATTR_RO(name, events, index) \ +static ssize_t name##_show(struct device *dev, \ + struct device_attribute *attr, char *buf) \ +{ \ + struct ptp_cipu_ctx *ctx = pci_get_drvdata(to_pci_dev(dev)); \ + struct ptp_cipu_stats *stats; \ + u64 sum = 0; \ + int cpu; \ + for_each_possible_cpu(cpu) { \ + stats = per_cpu_ptr(ctx->stats, cpu); \ + sum += stats->events[index]; \ + } \ + return sysfs_emit(buf, "0x%llx\n", sum); \ +} \ +static DEVICE_ATTR_RO(name) total: 0 errors, 0 warnings, 2 checks, 981 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Commit f37185bdd393 ("ptp: add Alibaba CIPU PTP clock driver") has style problems, please review. NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT BAD_REPORTED_BY_LINK CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. total: 0 errors, 0 warnings, 2 checks, 981 lines checked