Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8c96f8c authored by Tobias Klauser's avatar Tobias Klauser Committed by Linus Torvalds
Browse files

[PATCH] fs: Use ARRAY_SIZE macro



Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a
duplicate of ARRAY_SIZE.  Some trailing whitespaces are also deleted.

Signed-off-by: default avatarTobias Klauser <tklauser@nuerscht.ch>
Cc: David Howells <dhowells@redhat.com>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Acked-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Chris Mason <mason@suse.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Nathan Scott <nathans@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b5029622
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ static struct rxrpc_service AFSCM_service = {
	.error_func	= afscm_error,
	.aemap_func	= afscm_aemap,
	.ops_begin	= &AFSCM_ops[0],
	.ops_end	= &AFSCM_ops[sizeof(AFSCM_ops) / sizeof(AFSCM_ops[0])],
	.ops_end	= &AFSCM_ops[ARRAY_SIZE(AFSCM_ops)],
};

static DECLARE_COMPLETION(kafscmd_alive);
+2 −3
Original line number Diff line number Diff line
@@ -1522,8 +1522,7 @@ static struct {
	{ ATM_QUERYLOOP32,   ATM_QUERYLOOP }
};

#define NR_ATM_IOCTL (sizeof(atm_ioctl_map)/sizeof(atm_ioctl_map[0]))

#define NR_ATM_IOCTL ARRAY_SIZE(atm_ioctl_map)

static int do_atm_iobuf(unsigned int fd, unsigned int cmd, unsigned long arg)
{
@@ -1824,7 +1823,7 @@ static struct {
	{ FDWERRORGET32, FDWERRORGET }
};

#define NR_FD_IOCTL_TRANS (sizeof(fd_ioctl_trans_table)/sizeof(fd_ioctl_trans_table[0]))
#define NR_FD_IOCTL_TRANS ARRAY_SIZE(fd_ioctl_trans_table)

static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
{
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ static struct {
	{ "loglevel",	loglevel_read, loglevel_write }
#endif
};
#define NPROCENT	(sizeof(Entries)/sizeof(Entries[0]))
#define NPROCENT	ARRAY_SIZE(Entries)

void jfs_proc_init(void)
{
+3 −3
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ static struct rpc_procinfo nsm_procedures[] = {

static struct rpc_version	nsm_version1 = {
		.number		= 1,
		.nrprocs	= sizeof(nsm_procedures)/sizeof(nsm_procedures[0]),
		.nrprocs	= ARRAY_SIZE(nsm_procedures),
		.procs		= nsm_procedures
};

@@ -238,7 +238,7 @@ static struct rpc_stat nsm_stats;
static struct rpc_program	nsm_program = {
		.name		= "statd",
		.number		= SM_PROGRAM,
		.nrvers		= sizeof(nsm_version)/sizeof(nsm_version[0]),
		.nrvers		= ARRAY_SIZE(nsm_version),
		.version	= nsm_version,
		.stats		= &nsm_stats
};
+1 −1
Original line number Diff line number Diff line
@@ -509,7 +509,7 @@ static struct svc_version * nlmsvc_version[] = {

static struct svc_stat		nlmsvc_stats;

#define NLM_NRVERS	(sizeof(nlmsvc_version)/sizeof(nlmsvc_version[0]))
#define NLM_NRVERS	ARRAY_SIZE(nlmsvc_version)
static struct svc_program	nlmsvc_program = {
	.pg_prog		= NLM_PROGRAM,		/* program number */
	.pg_nvers		= NLM_NRVERS,		/* number of entries in nlmsvc_version */
Loading