All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Andy Whitcroft <apw@shadowen.org>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Joel Schopp <jschopp@austin.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: WARNING: do not add new typedefs - is that for real?
Date: Tue, 01 Jan 2008 18:15:46 +0200	[thread overview]
Message-ID: <477A6732.4010609@panasas.com> (raw)

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

             reply	other threads:[~2008-01-01 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-01 16:15 Boaz Harrosh [this message]
2008-01-02  9:58 ` WARNING: do not add new typedefs - is that for real? Andy Whitcroft
2008-01-02 10:08 ` Christoph Hellwig
2008-01-02 12:18   ` Boaz Harrosh
2008-01-02 20:37     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=477A6732.4010609@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=jschopp@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.