Messages in this thread | | | Date | Wed, 7 Oct 2020 15:46:14 +0200 | From | Christoph Hellwig <> | Subject | Re: [PATCH 09/12] samples: configfs: prefer sizeof(*var) to sizeof(struct var_type) |
| |
On Thu, Sep 24, 2020 at 02:45:23PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bgolaszewski@baylibre.com> > > It's better to use the size of the actual variable than its type when > allocating memory. This also has the benefit of avoiding a line break > here.
Either style has up an downside. The variable based on tracks type changes automatically, but on the other hand leads to lots of bugs where people forget the *. I'd rather not just change from one to the other pointlessly.
| |