diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2011-10-18 05:41:35 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2011-10-18 11:33:44 -0400 |
commit | 7748dd6eab8e13f974d4664395e76afffacda04b (patch) | |
tree | d649a1ef6e9219c7d6d3a5a690555c439e28160a /fs/cifs/file.c | |
parent | a5ff376966c079bd2f078524eff11b0c63cc2507 (diff) |
CIFS: cleanup min_t() cast in cifs_read()
Smatch complains that the cast to "int" in min_t() changes very large
values of current_read_size into negative values and so min_t()
could return the wrong value. I removed the const as well, as that
doesn't do anything here.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 7f84ece116d0..852d1f39adae 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1904,13 +1904,13 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
1904 | for (total_read = 0, current_offset = read_data; | 1904 | for (total_read = 0, current_offset = read_data; |
1905 | read_size > total_read; | 1905 | read_size > total_read; |
1906 | total_read += bytes_read, current_offset += bytes_read) { | 1906 | total_read += bytes_read, current_offset += bytes_read) { |
1907 | current_read_size = min_t(const int, read_size - total_read, | 1907 | current_read_size = min_t(uint, read_size - total_read, |
1908 | cifs_sb->rsize); | 1908 | cifs_sb->rsize); |
1909 | /* For windows me and 9x we do not want to request more | 1909 | /* For windows me and 9x we do not want to request more |
1910 | than it negotiated since it will refuse the read then */ | 1910 | than it negotiated since it will refuse the read then */ |
1911 | if ((pTcon->ses) && | 1911 | if ((pTcon->ses) && |
1912 | !(pTcon->ses->capabilities & CAP_LARGE_FILES)) { | 1912 | !(pTcon->ses->capabilities & CAP_LARGE_FILES)) { |
1913 | current_read_size = min_t(const int, current_read_size, | 1913 | current_read_size = min_t(uint, current_read_size, |
1914 | CIFSMaxBufSize); | 1914 | CIFSMaxBufSize); |
1915 | } | 1915 | } |
1916 | rc = -EAGAIN; | 1916 | rc = -EAGAIN; |