Skip to content

Commit 9d6b14c

Browse files
committed
Merge tag 'flex-array-transformations-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux
Pull flexible-array updates from Gustavo A. R. Silva. * tag 'flex-array-transformations-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: fs: omfs: Use flexible-array member in struct omfs_extent sparc: openpromio: Address -Warray-bounds warning reiserfs: Replace one-element array with flexible-array member
2 parents eaf9f46 + 4d8cbf6 commit 9d6b14c

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

arch/sparc/include/uapi/asm/openpromio.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
* were chosen to be exactly equal to the SunOS equivalents.
1111
*/
1212

13-
struct openpromio
14-
{
13+
struct openpromio {
1514
unsigned int oprom_size; /* Actual size of the oprom_array. */
16-
char oprom_array[1]; /* Holds property names and values. */
15+
char oprom_array[]; /* Holds property names and values. */
1716
};
1817

1918
#define OPROMMAXPARAM 4096 /* Maximum size of oprom_array. */

fs/omfs/file.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static u32 omfs_max_extents(struct omfs_sb_info *sbi, int offset)
1414
{
1515
return (sbi->s_sys_blocksize - offset -
1616
sizeof(struct omfs_extent)) /
17-
sizeof(struct omfs_extent_entry) + 1;
17+
sizeof(struct omfs_extent_entry);
1818
}
1919

2020
void omfs_make_empty_table(struct buffer_head *bh, int offset)
@@ -24,8 +24,8 @@ void omfs_make_empty_table(struct buffer_head *bh, int offset)
2424
oe->e_next = ~cpu_to_be64(0ULL);
2525
oe->e_extent_count = cpu_to_be32(1),
2626
oe->e_fill = cpu_to_be32(0x22),
27-
oe->e_entry.e_cluster = ~cpu_to_be64(0ULL);
28-
oe->e_entry.e_blocks = ~cpu_to_be64(0ULL);
27+
oe->e_entry[0].e_cluster = ~cpu_to_be64(0ULL);
28+
oe->e_entry[0].e_blocks = ~cpu_to_be64(0ULL);
2929
}
3030

3131
int omfs_shrink_inode(struct inode *inode)
@@ -68,7 +68,7 @@ int omfs_shrink_inode(struct inode *inode)
6868

6969
last = next;
7070
next = be64_to_cpu(oe->e_next);
71-
entry = &oe->e_entry;
71+
entry = oe->e_entry;
7272

7373
/* ignore last entry as it is the terminator */
7474
for (; extent_count > 1; extent_count--) {
@@ -117,7 +117,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
117117
u64 *ret_block)
118118
{
119119
struct omfs_extent_entry *terminator;
120-
struct omfs_extent_entry *entry = &oe->e_entry;
120+
struct omfs_extent_entry *entry = oe->e_entry;
121121
struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb);
122122
u32 extent_count = be32_to_cpu(oe->e_extent_count);
123123
u64 new_block = 0;
@@ -245,7 +245,7 @@ static int omfs_get_block(struct inode *inode, sector_t block,
245245

246246
extent_count = be32_to_cpu(oe->e_extent_count);
247247
next = be64_to_cpu(oe->e_next);
248-
entry = &oe->e_entry;
248+
entry = oe->e_entry;
249249

250250
if (extent_count > max_extents)
251251
goto out_brelse;

fs/omfs/omfs_fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct omfs_extent {
7777
__be64 e_next; /* next extent table location */
7878
__be32 e_extent_count; /* total # extents in this table */
7979
__be32 e_fill;
80-
struct omfs_extent_entry e_entry; /* start of extent entries */
80+
struct omfs_extent_entry e_entry[]; /* start of extent entries */
8181
};
8282

8383
#endif

fs/reiserfs/fix_node.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,8 +2252,9 @@ static int get_virtual_node_size(struct super_block *sb, struct buffer_head *bh)
22522252

22532253
return sizeof(struct virtual_node) +
22542254
max(max_num_of_items * sizeof(struct virtual_item),
2255-
sizeof(struct virtual_item) + sizeof(struct direntry_uarea) +
2256-
(max_num_of_entries - 1) * sizeof(__u16));
2255+
sizeof(struct virtual_item) +
2256+
struct_size_t(struct direntry_uarea, entry_sizes,
2257+
max_num_of_entries));
22572258
}
22582259

22592260
/*

fs/reiserfs/reiserfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2373,7 +2373,7 @@ struct virtual_node {
23732373
struct direntry_uarea {
23742374
int flags;
23752375
__u16 entry_count;
2376-
__u16 entry_sizes[1];
2376+
__u16 entry_sizes[];
23772377
} __attribute__ ((__packed__));
23782378

23792379
/***************************************************************************

0 commit comments

Comments
 (0)