Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1497064

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

From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf()
Date 2016-10-07 10:20 +0200
Message-ID <spyxP-5Vj-17@gated-at.bofh.it> (permalink)
References <qEuGl-43C-5@gated-at.bofh.it> <spcH0-6dt-53@gated-at.bofh.it> <spda1-6DS-23@gated-at.bofh.it> <spda1-6DS-21@gated-at.bofh.it> <spyet-5tC-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 07.10.2016 09:53, Dan Carpenter wrote:
> 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
>> <elfring@users.sourceforge.net> wrote:
>>> From: Markus Elfring <elfring@users.sourceforge.net>
>>> 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.

Also a matter of taste.
See http://yarchive.net/comp/linux/struct_init.html

Thanks,
//richard

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Richard Weinberger <richard.weinberger@gmail.com> - 2016-10-06 11:30 +0200
  Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-07 10:00 +0200
    Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Richard Weinberger <richard@nod.at> - 2016-10-07 10:20 +0200
    Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-07 11:00 +0200
      Re: md/raid1: Improve another size determination in setup_conf() Richard Weinberger <richard@nod.at> - 2016-10-07 11:10 +0200
        Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-07 13:00 +0200
          Re: md/raid1: Improve another size determination in setup_conf() "Austin S. Hemmelgarn" <ahferroin7@gmail.com> - 2016-10-07 14:00 +0200
            Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-07 17:30 +0200
              Re: md/raid1: Improve another size determination in setup_conf() Jiri Kosina <jikos@kernel.org> - 2016-10-07 17:40 +0200
                Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-07 18:40 +0200
                Re: md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-10 15:20 +0200
      Re: md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-10 15:10 +0200
        Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-10 15:30 +0200
          Re: md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-10 16:10 +0200
            Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-10 16:30 +0200
    Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-10 15:20 +0200
      Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-12 10:30 +0200
        Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Jes Sorensen <Jes.Sorensen@redhat.com> - 2016-10-12 14:20 +0200
  Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-10 13:20 +0200
    Re: md/raid1: Improve another size determination in setup_conf() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-10 14:30 +0200
    Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Bjørn Mork <bjorn@mork.no> - 2016-10-10 16:10 +0200
    Re: [PATCH 24/54] md/raid1: Improve another size determination in  setup_conf() Dan Carpenter <dan.carpenter@oracle.com> - 2016-10-11 08:30 +0200

csiph-web