WARNING: braces {} are not necessary for single statement blocks #139: FILE: src/sgsn/gprs_gmm.c:2568: + if (mmctx) { + return !mmctx->attach_rau.foreign; + } WARNING: braces {} are not necessary for single statement blocks #166: FILE: src/sgsn/gprs_gmm.c:2597: + if (!mme) { + return -EINVAL; + } WARNING: else is not generally useful after a break or return #196: FILE: src/sgsn/gprs_gmm.c:2627: + return -1; + } else { ERROR: need consistent spacing around '|' (ctx:VxW) (or typedef missing in osmo-ci/lint/checkpatch/typedefs_osmo.txt?) #273: FILE: src/sgsn/gprs_rau_fsm.c:365: + .in_event_mask = S(GMM_RAU_E_UE_RAU_REQUEST) | S(GMM_RAU_E_GGSN_UPD_RESP) | S(GMM_RAU_E_VLR_RAU_REJECT) | S(GMM_RAU_E_VLR_TERM_SUCCESS)| S(GMM_RAU_E_VLR_TERM_FAIL), ^ WARNING: braces {} are not necessary for single statement blocks #398: FILE: src/sgsn/sgsn_libgtp.c:190: + if (!ggsn->gsn) { + ggsn->gsn = sgsn->gsn; + } ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects #459: FILE: src/sgsn/sgsn_libgtp.c:913: +#define CHECK_SPACE_ERR(bytes) \ + if (ptr - buf + (bytes) > size) { \ + LOGP(DGPRS, LOGL_ERROR, "Ran out of space encoding mm ctx: %lu, %lu\n", (ptr - buf), (unsigned long) bytes); \ + return -1; \ + } ERROR: Macros with multiple statements should be enclosed in a do - while loop #464: FILE: src/sgsn/sgsn_libgtp.c:918: +#define MEMCPY_CHK(dst, src, len) \ + CHECK_SPACE_ERR((len)) \ + memcpy((dst), (uint8_t *)(src), (len)); \ + (dst) += (len); WARNING: macros should not use a trailing semicolon #464: FILE: src/sgsn/sgsn_libgtp.c:918: +#define MEMCPY_CHK(dst, src, len) \ + CHECK_SPACE_ERR((len)) \ + memcpy((dst), (uint8_t *)(src), (len)); \ + (dst) += (len); WARNING: 'transfered' may be misspelled - perhaps 'transferred'? #631: FILE: src/sgsn/sgsn_libgtp.c:1085: + LOGMMCTXP(LOGL_INFO, mmctx, "Ctx will be transfered to another SGSN/MME\n"); ^^^^^^^^^^ WARNING: braces {} are not necessary for single statement blocks #671: FILE: src/sgsn/sgsn_libgtp.c:1125: + if (buf_len <= 0) { + return gtp_sgsn_context_resp_error(gsn, local_ref, GTPCAUSE_SYS_FAIL); + } WARNING: please, no space before tabs #685: FILE: src/sgsn/sgsn_libgtp.c:1139: +^I^I// ^Ibreak;$ ERROR: Instead of strncpy()/strcpy(), use osmo_strlcpy() or OSMO_STRLCPY_ARRAY() #924: FILE: src/sgsn/sgsn_libgtp.c:1378: + strncpy(mmctx->imsi, imsi_str, sizeof(mmctx->imsi)); WARNING: braces {} are not necessary for single statement blocks #934: FILE: src/sgsn/sgsn_libgtp.c:1388: + if (rc) { + LOGMMCTXP(LOGL_ERROR, mmctx, "SGSN Context resp: Mandatory MM context parsing failed. Ignoring, try to use RAU information\n"); + } total: 4 errors, 9 warnings, 936 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. Your patch has style problems, please review. NOTE: Ignored message types: ASSIGN_IN_IF AVOID_EXTERNS BLOCK_COMMENT_STYLE COMPLEX_MACRO CONSTANT_COMPARISON DEEP_INDENTATION EMBEDDED_FILENAME EMBEDDED_FUNCTION_NAME EXECUTE_PERMISSIONS FILE_PATH_CHANGES GLOBAL_INITIALISERS IF_0 INITIALISED_STATIC LINE_CONTINUATIONS LINE_SPACING LONG_LINE LONG_LINE_COMMENT LONG_LINE_STRING MACRO_WITH_FLOW_CONTROL MISSING_SPACE PREFER_DEFINED_ATTRIBUTE_MACRO PREFER_FALLTHROUGH REPEATED_WORD SPDX_LICENSE_TAG SPLIT_STRING STRING_FRAGMENTS SYMBOLIC_PERMS TRACING_LOGGING TRAILING_STATEMENTS UNNECESSARY_BREAK UNNECESSARY_INT UNSPECIFIED_INT VOLATILE NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.