X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=oslib%2Flibmtd.c;h=5fca3a01b81d734a01c9d0dc4f8f873cdd3ba258;hb=2b03792ceb7ed00bd50db5b59486fab902295df8;hp=5c9eac2778c69a5b4bead766f70d74bdc0939705;hpb=984f30c9756b50c1507b287c71243e2c06efff16;p=fio.git diff --git a/oslib/libmtd.c b/oslib/libmtd.c index 5c9eac27..5fca3a01 100644 --- a/oslib/libmtd.c +++ b/oslib/libmtd.c @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: Artem Bityutskiy * @@ -35,6 +35,8 @@ #include #include +#include "../compiler/compiler.h" + #include #include "libmtd.h" @@ -960,7 +962,7 @@ int mtd_torture(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb) void *buf; normsg("run torture test for PEB %d", eb); - patt_count = ARRAY_SIZE(patterns); + patt_count = FIO_ARRAY_SIZE(patterns); buf = xmalloc(mtd->eb_size); @@ -1002,7 +1004,6 @@ int mtd_torture(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb) } } - err = 0; normsg("PEB %d passed torture test, do not mark it a bad", eb); out: @@ -1116,6 +1117,7 @@ static int legacy_auto_oob_layout(const struct mtd_dev_info *mtd, int fd, len = mtd->oob_size - start; memcpy(oob + start, tmp_buf + start, len); } + free(tmp_buf); return 0; } @@ -1190,7 +1192,7 @@ int mtd_write(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb, return 0; } -int do_oob_op(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, +static int do_oob_op(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, uint64_t start, uint64_t length, void *data, unsigned int cmd64, unsigned int cmd) {