[PATCH v3 5/6] UBI: add ioctl for max_beb_per1024
Artem Bityutskiy
dedekind1 at gmail.com
Tue Aug 21 15:34:54 EDT 2012
On Mon, 2012-08-20 at 18:00 +0200, Richard Genoud wrote:
> This patch provides the possibility to adjust the "maximum expected number of
> bad blocks per 1024 blocks" (max_beb_per1024) for each mtd device from
> UBI_IOCATT ioctl.
Thanks, pushed to linux-ubi.git with minor amendments.
> struct ubi_attach_req {
> __s32 ubi_num;
> __s32 mtd_num;
> __s32 vid_hdr_offset;
> - __s8 padding[12];
> + __u16 max_beb_per1024;
> + __s8 padding[10];
> };
I've made that to be _s16, for consistency. AFAIR, the reasons I used
signed types all over the place (unless the really needed an unsigned
type) are:
1. Easy to write functions with return a positive resulting value of
something (e.g., pnum) in case of success and a negative error code in
case of failure.
2. Easy to check for sane value by just comparing to 0.
But these are not very strong arguments, and I read somewhere that some
CPUs handle unsigned integers a bit faster, not sure what architectures
was that about.
Thanks!
--
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120821/4254987f/attachment.sig>
More information about the linux-mtd
mailing list