WARNING: do not add new typedefs - is that for real?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: linux-kernel <linux-kernel@...>
Cc: Andy Whitcroft <apw@...>, Randy Dunlap <rdunlap@...>, Joel Schopp <jschopp@...>, Andrew Morton <akpm@...>
Date: Tuesday, January 1, 2008 - 12:15 pm

I have this code:

<c_code>
/* 
 * osd-r10 4.12.5 Data-In and Data-Out buffer offsets
 * byte offset = mantissa * (2^(exponent+8))
 */
typedef __be32 osd_cdb_offset;

osd_cdb_offset __osd_encode_offset(u64 offset, unsigned *padding,
	int min_shift, int max_shift);

struct osd_attributes_list_mode {
	__be32		get_attr_desc_bytes;
	osd_cdb_offset	get_attr_desc_offset;

	__be32		get_attr_alloc_length;
	osd_cdb_offset	get_attr_offset;

	__be32		set_attr_bytes;
	osd_cdb_offset	set_attr_offset;
	__be32 not_used;
};
</c_code>


the osd_cdb_offset above is this special OSD-standard floating-point-like
special type. It is of size 32 bit in special network order. What should
I do then:

__be32 __osd_encode_offset(u64 offset, unsigned *padding,
	int min_shift, int max_shift);

But it is not a __be32. It is this special floating-point-like thingy!!!?
How was __be32 defined with a #define???!!

Come on guys, it is not checkpatch.pl place to complain about good language
constructs that can be misused. This is the maintainers and reviewers
job to say that a: "typedef struct foo Foo;" is bad practice and we don't
like it, but it can not be left to a script. "typedef"s should be used
where they should be used.

Boaz
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
WARNING: do not add new typedefs - is that for real?, Boaz Harrosh, (Tue Jan 1, 12:15 pm)
Re: WARNING: do not add new typedefs - is that for real?, Christoph Hellwig, (Wed Jan 2, 6:08 am)
Re: WARNING: do not add new typedefs - is that for real?, Christoph Hellwig, (Wed Jan 2, 4:37 pm)
Re: WARNING: do not add new typedefs - is that for real?, Andy Whitcroft, (Wed Jan 2, 5:58 am)