Skip to content

Commit 391e8bb

Browse files
author
Al Viro
committed
sanitize const/signedness for udf
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 072f98b commit 391e8bb

5 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎fs/udf/balloc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ static void udf_table_free_blocks(struct super_block *sb,
547547
}
548548

549549
if (epos.offset + (2 * adsize) > sb->s_blocksize) {
550-
char *sptr, *dptr;
550+
unsigned char *sptr, *dptr;
551551
int loffset;
552552

553553
brelse(oepos.bh);

‎fs/udf/dir.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
4545
int block, iblock;
4646
loff_t nf_pos = (filp->f_pos - 1) << 2;
4747
int flen;
48-
char *fname = NULL;
49-
char *nameptr;
48+
unsigned char *fname = NULL;
49+
unsigned char *nameptr;
5050
uint16_t liu;
5151
uint8_t lfi;
5252
loff_t size = udf_ext0_offset(dir) + dir->i_size;

‎fs/udf/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
16721672
return -1;
16731673

16741674
if (epos->offset + (2 * adsize) > inode->i_sb->s_blocksize) {
1675-
char *sptr, *dptr;
1675+
unsigned char *sptr, *dptr;
16761676
struct buffer_head *nbh;
16771677
int err, loffset;
16781678
struct kernel_lb_addr obloc = epos->block;

‎fs/udf/namei.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
#include <linux/crc-itu-t.h>
3535
#include <linux/exportfs.h>
3636

37-
static inline int udf_match(int len1, const char *name1, int len2,
38-
const char *name2)
37+
static inline int udf_match(int len1, const unsigned char *name1, int len2,
38+
const unsigned char *name2)
3939
{
4040
if (len1 != len2)
4141
return 0;
@@ -142,15 +142,15 @@ int udf_write_fi(struct inode *inode, struct fileIdentDesc *cfi,
142142
}
143143

144144
static struct fileIdentDesc *udf_find_entry(struct inode *dir,
145-
struct qstr *child,
145+
const struct qstr *child,
146146
struct udf_fileident_bh *fibh,
147147
struct fileIdentDesc *cfi)
148148
{
149149
struct fileIdentDesc *fi = NULL;
150150
loff_t f_pos;
151151
int block, flen;
152-
char *fname = NULL;
153-
char *nameptr;
152+
unsigned char *fname = NULL;
153+
unsigned char *nameptr;
154154
uint8_t lfi;
155155
uint16_t liu;
156156
loff_t size;
@@ -308,7 +308,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir,
308308
{
309309
struct super_block *sb = dir->i_sb;
310310
struct fileIdentDesc *fi = NULL;
311-
char *name = NULL;
311+
unsigned char *name = NULL;
312312
int namelen;
313313
loff_t f_pos;
314314
loff_t size = udf_ext0_offset(dir) + dir->i_size;
@@ -885,16 +885,16 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
885885
{
886886
struct inode *inode;
887887
struct pathComponent *pc;
888-
char *compstart;
888+
const char *compstart;
889889
struct udf_fileident_bh fibh;
890890
struct extent_position epos = {};
891891
int eoffset, elen = 0;
892892
struct fileIdentDesc *fi;
893893
struct fileIdentDesc cfi;
894-
char *ea;
894+
uint8_t *ea;
895895
int err;
896896
int block;
897-
char *name = NULL;
897+
unsigned char *name = NULL;
898898
int namelen;
899899
struct buffer_head *bh;
900900
struct udf_inode_info *iinfo;
@@ -970,7 +970,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry,
970970

971971
pc = (struct pathComponent *)(ea + elen);
972972

973-
compstart = (char *)symname;
973+
compstart = symname;
974974

975975
do {
976976
symname++;

‎fs/udf/symlink.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
#include <linux/buffer_head.h>
3333
#include "udf_i.h"
3434

35-
static void udf_pc_to_char(struct super_block *sb, char *from, int fromlen,
36-
char *to)
35+
static void udf_pc_to_char(struct super_block *sb, unsigned char *from,
36+
int fromlen, unsigned char *to)
3737
{
3838
struct pathComponent *pc;
3939
int elen = 0;
40-
char *p = to;
40+
unsigned char *p = to;
4141

4242
while (elen < fromlen) {
4343
pc = (struct pathComponent *)(from + elen);
@@ -75,9 +75,9 @@ static int udf_symlink_filler(struct file *file, struct page *page)
7575
{
7676
struct inode *inode = page->mapping->host;
7777
struct buffer_head *bh = NULL;
78-
char *symlink;
78+
unsigned char *symlink;
7979
int err = -EIO;
80-
char *p = kmap(page);
80+
unsigned char *p = kmap(page);
8181
struct udf_inode_info *iinfo;
8282

8383
lock_kernel();

0 commit comments

Comments
 (0)