)]}'
{
  "commit": "62593cf40b23b523b9fc9334ca61ba6c595ebb09",
  "tree": "5ba387095a630ed22b5169c2d0dea5c0f7505d41",
  "parents": [
    "f8900258906c3533b91e779e80f75ec80de816c0"
  ],
  "author": {
    "name": "Brian Norris",
    "email": "computersforpeace@gmail.com",
    "time": "Tue Sep 01 12:57:11 2015 -0700"
  },
  "committer": {
    "name": "Brian Norris",
    "email": "computersforpeace@gmail.com",
    "time": "Tue Oct 13 18:22:54 2015 -0700"
  },
  "message": "mtd: spi-nor: refactor block protection functions\n\nThis code was a bit sloppy, would produce a lot of copy-and-paste, and\ndid not always provide a sensible interface:\n\n * It didn\u0027t validate the length for LOCK and the offset for UNLOCK, so\n   we were essentially discarding half of the user-supplied data and\n   assuming what they wanted to lock/unlock\n * It didn\u0027t do very good error checking\n * It didn\u0027t make use of the fact that this operation works on\n   power-of-two dimensions\n\nSo, rewrite this to do proper bit arithmetic rather than a bunch of\nhard-coded condition tables. Now we have:\n\n * More comments on how this was derived\n * Notes on what is (and isn\u0027t) supported\n * A more exendible function, so we could add support for other\n   protection ranges\n * More accurate locking - e.g., suppose the top quadrant is locked (75%\n   to 100%); then in the following cases, case (a) will succeed but (b)\n   will not (return -EINVAL):\n     (a) user requests lock 3rd quadrant (50% to 75%)\n     (b) user requests lock 3rd quadrant, minus a few blocks (e.g., 50%\n         to 73%)\n   Case (b) *should* fail, since we\u0027d have to lock blocks that weren\u0027t\n   requested. But the old implementation didn\u0027t know the difference and\n   would lock the entire second half (50% to 100%)\n\nThis refactoring work will also help enable the addition of\nmtd_is_locked() support and potentially the support of bottom boot\nprotection (TB\u003d1).\n\nSigned-off-by: Brian Norris \u003ccomputersforpeace@gmail.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d356a1f98c42eedddb3662be90de3efa1f8c9697",
      "old_mode": 33188,
      "old_path": "drivers/mtd/spi-nor/spi-nor.c",
      "new_id": "3db0f2b0ad45ea007d59dbdbe9b84ede82ba05e2",
      "new_mode": 33188,
      "new_path": "drivers/mtd/spi-nor/spi-nor.c"
    }
  ]
}
