@@ -171,29 +171,29 @@ static void gluebi_put_device(struct mtd_info *mtd)
171
171
static int gluebi_read (struct mtd_info * mtd , loff_t from , size_t len ,
172
172
size_t * retlen , unsigned char * buf )
173
173
{
174
- int err = 0 , lnum , offs , total_read ;
174
+ int err = 0 , lnum , offs , bytes_left ;
175
175
struct gluebi_device * gluebi ;
176
176
177
177
gluebi = container_of (mtd , struct gluebi_device , mtd );
178
178
lnum = div_u64_rem (from , mtd -> erasesize , & offs );
179
- total_read = len ;
180
- while (total_read ) {
179
+ bytes_left = len ;
180
+ while (bytes_left ) {
181
181
size_t to_read = mtd -> erasesize - offs ;
182
182
183
- if (to_read > total_read )
184
- to_read = total_read ;
183
+ if (to_read > bytes_left )
184
+ to_read = bytes_left ;
185
185
186
186
err = ubi_read (gluebi -> desc , lnum , buf , offs , to_read );
187
187
if (err )
188
188
break ;
189
189
190
190
lnum += 1 ;
191
191
offs = 0 ;
192
- total_read -= to_read ;
192
+ bytes_left -= to_read ;
193
193
buf += to_read ;
194
194
}
195
195
196
- * retlen = len - total_read ;
196
+ * retlen = len - bytes_left ;
197
197
return err ;
198
198
}
199
199
@@ -211,7 +211,7 @@ static int gluebi_read(struct mtd_info *mtd, loff_t from, size_t len,
211
211
static int gluebi_write (struct mtd_info * mtd , loff_t to , size_t len ,
212
212
size_t * retlen , const u_char * buf )
213
213
{
214
- int err = 0 , lnum , offs , total_written ;
214
+ int err = 0 , lnum , offs , bytes_left ;
215
215
struct gluebi_device * gluebi ;
216
216
217
217
gluebi = container_of (mtd , struct gluebi_device , mtd );
@@ -220,24 +220,24 @@ static int gluebi_write(struct mtd_info *mtd, loff_t to, size_t len,
220
220
if (len % mtd -> writesize || offs % mtd -> writesize )
221
221
return - EINVAL ;
222
222
223
- total_written = len ;
224
- while (total_written ) {
223
+ bytes_left = len ;
224
+ while (bytes_left ) {
225
225
size_t to_write = mtd -> erasesize - offs ;
226
226
227
- if (to_write > total_written )
228
- to_write = total_written ;
227
+ if (to_write > bytes_left )
228
+ to_write = bytes_left ;
229
229
230
230
err = ubi_leb_write (gluebi -> desc , lnum , buf , offs , to_write );
231
231
if (err )
232
232
break ;
233
233
234
234
lnum += 1 ;
235
235
offs = 0 ;
236
- total_written -= to_write ;
236
+ bytes_left -= to_write ;
237
237
buf += to_write ;
238
238
}
239
239
240
- * retlen = len - total_written ;
240
+ * retlen = len - bytes_left ;
241
241
return err ;
242
242
}
243
243
0 commit comments