[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201007134614.GC764@lst.de>
Date: Wed, 7 Oct 2020 15:46:14 +0200
From: Christoph Hellwig <hch@....de>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Joel Becker <jlbec@...lplan.org>, Christoph Hellwig <hch@....de>,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
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@...libre.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.
Powered by blists - more mailing lists