Skip to content

Commit b94fdd0

Browse files
Matthew Garrettaegl
authored andcommitted
pstore: Make "part" unsigned
We'll never have a negative part, so just make this an unsigned int. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
1 parent 5628068 commit b94fdd0

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎drivers/acpi/apei/erst.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -933,8 +933,8 @@ static int erst_open_pstore(struct pstore_info *psi);
933933
static int erst_close_pstore(struct pstore_info *psi);
934934
static ssize_t erst_reader(u64 *id, enum pstore_type_id *type,
935935
struct timespec *time, struct pstore_info *psi);
936-
static u64 erst_writer(enum pstore_type_id type, int part, size_t size,
937-
struct pstore_info *psi);
936+
static u64 erst_writer(enum pstore_type_id type, unsigned int part,
937+
size_t size, struct pstore_info *psi);
938938
static int erst_clearer(enum pstore_type_id type, u64 id,
939939
struct pstore_info *psi);
940940

@@ -1040,8 +1040,8 @@ static ssize_t erst_reader(u64 *id, enum pstore_type_id *type,
10401040
return (rc < 0) ? rc : (len - sizeof(*rcd));
10411041
}
10421042

1043-
static u64 erst_writer(enum pstore_type_id type, int part, size_t size,
1044-
struct pstore_info *psi)
1043+
static u64 erst_writer(enum pstore_type_id type, unsigned int part,
1044+
size_t size, struct pstore_info *psi)
10451045
{
10461046
struct cper_pstore_record *rcd = (struct cper_pstore_record *)
10471047
(erst_info.buf - sizeof(*rcd));

‎fs/pstore/platform.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ static void pstore_dump(struct kmsg_dumper *dumper,
6767
unsigned long size, total = 0;
6868
char *dst, *why;
6969
u64 id;
70-
int hsize, part = 1;
70+
int hsize;
71+
unsigned int part = 1;
7172

7273
if (reason < ARRAY_SIZE(reason_str))
7374
why = reason_str[reason];

‎include/linux/pstore.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct pstore_info {
3939
int (*close)(struct pstore_info *psi);
4040
ssize_t (*read)(u64 *id, enum pstore_type_id *type,
4141
struct timespec *time, struct pstore_info *psi);
42-
u64 (*write)(enum pstore_type_id type, int part,
42+
u64 (*write)(enum pstore_type_id type, unsigned int part,
4343
size_t size, struct pstore_info *psi);
4444
int (*erase)(enum pstore_type_id type, u64 id,
4545
struct pstore_info *psi);

0 commit comments

Comments
 (0)