Thread (106 messages) 106 messages, 12 authors, 2016-10-28

Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf()

From: Dan Carpenter <hidden>
Date: 2016-10-07 07:54:47
Also in: kernel-janitors, lkml

Possibly related (same subject, not in this thread)

On Thu, Oct 06, 2016 at 11:29:20AM +0200, Richard Weinberger wrote:
On Thu, Oct 6, 2016 at 11:22 AM, SF Markus Elfring
[off-list ref] wrote:
quoted
From: Markus Elfring <redacted>
Date: Tue, 4 Oct 2016 21:46:18 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.
Isn't this pure matter of taste?
Some developers prefer sizeof(*ptr) because it is easier to type, other
developers prefer sizeof(struct foo) because you can determine the type
at first sight and makes review more easy.
sizeof(*ptr) is more future proof and normally more obvious and easier
to review.  That said, I've tried to tell Markus to only send bugfix
patches because these are a waste of time and regularly introduce bugs.

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help