)]}'
{
  "commit": "9cb2c2726e9ae212ccaeecd3eaadcd8d49ac7400",
  "tree": "fb551cce7de62fc65c38beef7b014bb405362f61",
  "parents": [
    "ef9d9b8fb696850a95cd59ba2cd67991b6f722b3"
  ],
  "author": {
    "name": "Julia Lawall",
    "email": "julia@diku.dk",
    "time": "Sun Oct 24 18:16:58 2010 +0200"
  },
  "committer": {
    "name": "Jean Delvare",
    "email": "khali@endymion.delvare",
    "time": "Sun Oct 24 18:16:58 2010 +0200"
  },
  "message": "i2c-amd8111: Add proper error handling\n\nThe functions the functions amd_ec_wait_write and amd_ec_wait_read have an\nunsigned return type, but return a negative constant to indicate an error\ncondition.\n\nA sematic match that finds this problem is as follows:\n(http://coccinelle.lip6.fr/)\n\n// \u003csmpl\u003e\n@exists@\nidentifier f;\nconstant C;\n@@\n\n unsigned f(...)\n { \u003c+...\n*  return -C;\n ...+\u003e }\n// \u003c/smpl\u003e\n\nFixing amd_ec_wait_write and amd_ec_wait_read leads to the need to adjust\nthe return type of the functions amd_ec_write and amd_ec_read, which are\nthe only functions that call amd_ec_wait_write and amd_ec_wait_read.\namd_ec_write and amd_ec_read, in turn, are only called from within the\nfunction amd8111_access, which already returns a signed typed value.  Each\nof the calls to amd_ec_write and amd_ec_read are updated using the\nfollowing semantic patch:\n\n// \u003csmpl\u003e\n@@\n@@\n\n+ status \u003d amd_ec_write\n- amd_ec_write\n  (...);\n+ if (status) return status;\n\n@@\n@@\n\n+ status \u003d amd_ec_read\n- amd_ec_read\n  (...);\n+ if (status) return status;\n// \u003c/smpl\u003e\n\nThe patch also adds the declaration of the status variable.\n\nSigned-off-by: Julia Lawall \u003cjulia@diku.dk\u003e\nSigned-off-by: Jean Delvare \u003ckhali@linux-fr.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "af1e5e254b7b4193afde1b75e3ca98f3cd37ad6f",
      "old_mode": 33188,
      "old_path": "drivers/i2c/busses/i2c-amd8111.c",
      "new_id": "6b6a6b1d70252539f6be0c0da874281d624d817e",
      "new_mode": 33188,
      "new_path": "drivers/i2c/busses/i2c-amd8111.c"
    }
  ]
}
