)]}'
{
  "commit": "588ef9d411339012fc3c94bfad8911e9d0a517a2",
  "tree": "a484309fcbb000c01867f36514dde2a8ccefd7bb",
  "parents": [
    "ecdda9e03d73d2cc1c82c00cccc02f087741b6a5"
  ],
  "author": {
    "name": "Stefan Hajnoczi",
    "email": "stefanha@redhat.com",
    "time": "Mon Mar 23 15:29:23 2015 +0000"
  },
  "committer": {
    "name": "Kevin Wolf",
    "email": "kwolf@redhat.com",
    "time": "Tue Apr 28 15:36:08 2015 +0200"
  },
  "message": "bt-sdp: fix broken uuids power-of-2 calculation\n\nThe binary search in sdp_uuid_match() only works when the number of\nelements to search is a power of two.\n\n  lo \u003d record-\u003euuid;\n  hi \u003d record-\u003euuids;\n  while (hi \u003e\u003e\u003d 1)\n      if (lo[hi] \u003c\u003d val)\n          lo +\u003d hi;\n\n  return *lo \u003d\u003d val;\n\nI noticed that the record-\u003euuids calculation in\nsdp_service_record_build() was suspect:\n\n  record-\u003euuids \u003d 1 \u003c\u003c ffs(record-\u003euuids - 1);\n\nUnlike most ffs(val) - 1 users, the expression is ffs(val - 1)!\n\nActually ffs() is the wrong function to use for power-of-2.  Use\npow2ceil() to achieve the correct effect.  Now the record-\u003euuid[] array\nis sized correctly and the binary search in sdp_uuid_match() should\nwork.\n\nI\u0027m not sure how to run/test this code.\n\nCc: Andrzej Zaborowski \u003cbalrog@zabor.org\u003e\nCc: qemu-stable@nongnu.org\nSigned-off-by: Stefan Hajnoczi \u003cstefanha@redhat.com\u003e\nMessage-id: 1427124571-28598-2-git-send-email-stefanha@redhat.com\nSigned-off-by: Kevin Wolf \u003ckwolf@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "218e075df75f6593c85d53dcf30877b608914b9d",
      "old_mode": 33188,
      "old_path": "hw/bt/sdp.c",
      "new_id": "c90374795257f383a40d343b0ae5a1912c3364ec",
      "new_mode": 33188,
      "new_path": "hw/bt/sdp.c"
    }
  ]
}
