lkml.org 
[lkml]   [2018]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: FAT: Operating on broken FAT FS causes the write syscall to return negative number not equal to -1
On Sun, Jul 15, 2018 at 11:20:06PM +0900, OGAWA Hirofumi wrote:
> +static inline bool fat_valid_entry(struct msdos_sb_info *sbi, int entry)
> +{
> + if (entry < FAT_START_ENT || sbi->max_cluster <= entry)
> + return false;
> + return true;
> +}

Pet peeve: if (...) return false; return true; instead of return !....;

In this case,
return entry >= FAT_START_ENT && entry < sb->max_cluster;
\
 
 \ /
  Last update: 2018-07-15 22:07    [W:0.123 / U:1.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site