)]}'
{
  "commit": "b42ba4ea4322357fcbfcb0e6e613d79ede84de64",
  "tree": "98e14b763d94726fa9827e1db7d71d68d977991c",
  "parents": [
    "b69c95e718ba83fac6d5d725c4a79c4da808ab67"
  ],
  "author": {
    "name": "Peter Maydell",
    "email": "peter.maydell@linaro.org",
    "time": "Tue Jul 23 16:14:54 2024 +0100"
  },
  "committer": {
    "name": "Peter Maydell",
    "email": "peter.maydell@linaro.org",
    "time": "Mon Jul 29 16:58:14 2024 +0100"
  },
  "message": "target/xtensa: Make use of \u0027segment\u0027 in pptlb helper less confusing\n\nCoverity gets confused about the use of the \u0027segment\u0027 variable in the\npptlb helper function: it thinks that we can take a code path where\nwe first initialize it:\n  unsigned segment \u003d XTENSA_MPU_PROBE_B;  // 0x40000000\nand then use that value as a shift count:\n  } else if (nhits \u003d\u003d 1 \u0026\u0026 (env-\u003esregs[MPUENB] \u0026 (1u \u003c\u003c segment))) {\n\nIn fact this isn\u0027t possible, beacuse xtensa_mpu_lookup() is passed\n\u0027\u0026segment\u0027, and it uses that as an output value, which it will always\nset if it returns nonzero.  But the way the code is currently written\nis confusing to a human reader as well as to Coverity.\n\nInstead of initializing \u0027segment\u0027 at the top of the function with a\nvalue that\u0027s only used in the \"nhits \u003d\u003d 0\" code path, use the\nconstant value directly in that code path, and don\u0027t initialize\nsegment.  This matches the way we use xtensa_mpu_lookup() in its\nother callsites in get_physical_addr_mpu().\n\nResolves: Coverity CID 1547589\n\nSigned-off-by: Peter Maydell \u003cpeter.maydell@linaro.org\u003e\nAcked-by: Max Filippov \u003cjcmvbkbc@gmail.com\u003e\nMessage-id: 20240723151454.1396826-1-peter.maydell@linaro.org\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "997b21d3890f56babb60fbe266ec1849f4df20c8",
      "old_mode": 33188,
      "old_path": "target/xtensa/mmu_helper.c",
      "new_id": "29b84d5dbf66e0a21e6e3424f76130d4f80dc3d1",
      "new_mode": 33188,
      "new_path": "target/xtensa/mmu_helper.c"
    }
  ]
}
