)]}'
{
  "commit": "10fbd36e362a0f367e34a7cd876a81295d8fc5ca",
  "tree": "c2329812b2494863752c4aef017d4dddd2bea115",
  "parents": [
    "e1df8b0a1bb2ac8254616d6075e40f9ca447fa29"
  ],
  "author": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Wed May 27 15:32:15 2015 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Sat Sep 12 12:03:30 2015 -0700"
  },
  "message": "blk: rq_data_dir() should not return a boolean\n\nrq_data_dir() returns either READ or WRITE (0 \u003d\u003d READ, 1 \u003d\u003d WRITE), not\na boolean value.\n\nNow, admittedly the \"!\u003d 0\" doesn\u0027t really change the value (0 stays as\nzero, 1 stays as one), but it\u0027s not only redundant, it confuses gcc, and\ncauses gcc to warn about the construct\n\n    switch (rq_data_dir(req)) {\n        case READ:\n            ...\n        case WRITE:\n            ...\n\nthat we have in a few drivers.\n\nNow, the gcc warning is silly and stupid (it seems to warn not about the\nswitch value having a different type from the case statements, but about\n_any_ boolean switch value), but in this case the code itself is silly\nand stupid too, so let\u0027s just change it, and get rid of warnings like\nthis:\n\n  drivers/block/hd.c: In function ‘hd_request’:\n  drivers/block/hd.c:630:11: warning: switch condition has boolean value [-Wswitch-bool]\n     switch (rq_data_dir(req)) {\n\nThe odd \u0027!\u003d 0\u0027 came in when \"cmd_flags\" got turned into a \"u64\" in\ncommit 5953316dbf90 (\"block: make rq-\u003ecmd_flags be 64-bit\") and is\npresumably because the old code (that just did a logical \u0027and\u0027 with 1)\nwould then end up making the type of rq_data_dir() be u64 too.\n\nBut if we want to retain the old regular integer type, let\u0027s just cast\nthe result to \u0027int\u0027 rather than use that rather odd \u0027!\u003d 0\u0027.\n\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "708923b9b623a345b01edcdce63e59e92a2a7f84",
      "old_mode": 33188,
      "old_path": "include/linux/blkdev.h",
      "new_id": "38a5ff772a37fbbd841a1152d9f613bb1ffde84c",
      "new_mode": 33188,
      "new_path": "include/linux/blkdev.h"
    }
  ]
}
