X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Fyaffs_error.c;h=bc892f719614419cc711ce59e138182aa9d4a3cc;hp=dfdb798b77ed1c43ea7c5ef8da15700e552cba80;hb=HEAD;hpb=d7388fb75a13610d14d0afc397f826bd44c972e1 diff --git a/direct/yaffs_error.c b/direct/yaffs_error.c index dfdb798..bc892f7 100644 --- a/direct/yaffs_error.c +++ b/direct/yaffs_error.c @@ -1,8 +1,7 @@ /* * YAFFS: Yet another FFS. A NAND-flash specific file system. * - * Copyright (C) 2002-2011 Aleph One Ltd. - * for Toby Churchill Ltd and Brightstar Engineering + * Copyright (C) 2002-2018 Aleph One Ltd. * * Created by Timothy Manning * @@ -14,8 +13,8 @@ #include "yaffsfs.h" struct error_entry { - int code; - char * text; + int code; + const char *text; }; static const struct error_entry error_list[] = { @@ -31,7 +30,7 @@ static const struct error_entry error_list[] = { { ERANGE , "ERANGE"}, { ENODATA, "ENODATA"}, { ENOTEMPTY, "ENOTEMPTY"}, - { ENAMETOOLONG,"ENAMETOOLONG"}, + { ENAMETOOLONG, "ENAMETOOLONG"}, { ENOMEM , "ENOMEM"}, { EEXIST , "EEXIST"}, { ENOTDIR , "ENOTDIR"}, @@ -42,15 +41,15 @@ static const struct error_entry error_list[] = { { 0, NULL } }; -const char * yaffs_error_to_str(int err) +const char *yaffs_error_to_str(int err) { const struct error_entry *e = error_list; - if (err < 0) + if (err < 0) err = -err; - while(e->code && e->text){ - if(err == e->code) + while (e->code && e->text) { + if (err == e->code) return e->text; e++; }