All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toralf Förster" <toralf.foerster@gmx.de>
To: Ilya Dryomov <ilya.dryomov@inktank.com>
Cc: linux-ia64@vger.kernel.org,
	Ceph Development <ceph-devel@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: sizeof (struct tYpO *) : it is just a typo or rather a bug ?
Date: Thu, 24 Jul 2014 20:37:52 +0200	[thread overview]
Message-ID: <53D15280.5070407@gmx.de> (raw)
In-Reply-To: <CALFYKtAyB6xGEgJ65Ti5vPx9xf4ipX9__FZBwosBYg1y9z7cKg@mail.gmail.com>

On 07/24/2014 08:33 PM, Ilya Dryomov wrote:
> On Thu, Jul 24, 2014 at 10:20 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
>> Inspired by this "typo" fix
>> http://article.gmane.org/gmane.linux.kernel/1754640
>> I grep'ed the current git tree of linus for similar issues.
>>
>> For these 4 places I'm wondering where the appropriate struct definition is located :
>>
>> arch/ia64/sn/kernel/io_acpi_init.c:         sizeof(struct pci_devdev_info *)) {
>> tools/perf/builtin-sched.c:     sched->tasks = realloc(sched->tasks, sched->nr_tasks * sizeof(struct task_task *));
>> fs/ceph/xattr.c:                xattrs = kcalloc(numattr, sizeof(struct ceph_xattr *),
>> fs/ceph/xattr.c:                memset(xattrs, 0, numattr*sizeof(struct ceph_xattr *));
> 
> Heh, the ceph one is a five year old typo..  Looks like it should be
> struct ceph_inode_xattr, I'll fix it up.  I'm curious though, how did
> you grep for these?
> 
> Thanks,
> 
>                 Ilya
> 

1:
	grep -Hr "sizeof[ *(]struct .* \*.)"  | cut -f2- -d':' | tee ~/tmp/out

2:
	cat ~/tmp/out | perl -wane 'chomp(); my ($left, $right) = split (/sizeof\(/); print $right, "\n";' | cut -f2 -d' ' | sort -u | cut -f1 -d')' | grep -v '^+' | while read i; do echo $i; git grep -q "struct $i {" || echo error; echo; done

3:
	ignore false positives

-- 
Toralf


WARNING: multiple messages have this Message-ID (diff)
From: "Toralf Förster" <toralf.foerster@gmx.de>
To: Ilya Dryomov <ilya.dryomov@inktank.com>
Cc: linux-ia64@vger.kernel.org,
	Ceph Development <ceph-devel@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: sizeof (struct tYpO *) : it is just a typo or rather a bug ?
Date: Thu, 24 Jul 2014 20:37:52 +0200	[thread overview]
Message-ID: <53D15280.5070407@gmx.de> (raw)
In-Reply-To: <CALFYKtAyB6xGEgJ65Ti5vPx9xf4ipX9__FZBwosBYg1y9z7cKg@mail.gmail.com>

On 07/24/2014 08:33 PM, Ilya Dryomov wrote:
> On Thu, Jul 24, 2014 at 10:20 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
>> Inspired by this "typo" fix
>> http://article.gmane.org/gmane.linux.kernel/1754640
>> I grep'ed the current git tree of linus for similar issues.
>>
>> For these 4 places I'm wondering where the appropriate struct definition is located :
>>
>> arch/ia64/sn/kernel/io_acpi_init.c:         sizeof(struct pci_devdev_info *)) {
>> tools/perf/builtin-sched.c:     sched->tasks = realloc(sched->tasks, sched->nr_tasks * sizeof(struct task_task *));
>> fs/ceph/xattr.c:                xattrs = kcalloc(numattr, sizeof(struct ceph_xattr *),
>> fs/ceph/xattr.c:                memset(xattrs, 0, numattr*sizeof(struct ceph_xattr *));
> 
> Heh, the ceph one is a five year old typo..  Looks like it should be
> struct ceph_inode_xattr, I'll fix it up.  I'm curious though, how did
> you grep for these?
> 
> Thanks,
> 
>                 Ilya
> 

1:
	grep -Hr "sizeof[ *(]struct .* \*.)"  | cut -f2- -d':' | tee ~/tmp/out

2:
	cat ~/tmp/out | perl -wane 'chomp(); my ($left, $right) = split (/sizeof\(/); print $right, "\n";' | cut -f2 -d' ' | sort -u | cut -f1 -d')' | grep -v '^+' | while read i; do echo $i; git grep -q "struct $i {" || echo error; echo; done

3:
	ignore false positives

-- 
Toralf

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: "Toralf Förster" <toralf.foerster@gmx.de>
To: Ilya Dryomov <ilya.dryomov@inktank.com>
Cc: linux-ia64@vger.kernel.org,
	Ceph Development <ceph-devel@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: sizeof (struct tYpO *) : it is just a typo or rather a bug ?
Date: Thu, 24 Jul 2014 18:37:52 +0000	[thread overview]
Message-ID: <53D15280.5070407@gmx.de> (raw)
In-Reply-To: <CALFYKtAyB6xGEgJ65Ti5vPx9xf4ipX9__FZBwosBYg1y9z7cKg@mail.gmail.com>

On 07/24/2014 08:33 PM, Ilya Dryomov wrote:
> On Thu, Jul 24, 2014 at 10:20 PM, Toralf Förster <toralf.foerster@gmx.de> wrote:
>> Inspired by this "typo" fix
>> http://article.gmane.org/gmane.linux.kernel/1754640
>> I grep'ed the current git tree of linus for similar issues.
>>
>> For these 4 places I'm wondering where the appropriate struct definition is located :
>>
>> arch/ia64/sn/kernel/io_acpi_init.c:         sizeof(struct pci_devdev_info *)) {
>> tools/perf/builtin-sched.c:     sched->tasks = realloc(sched->tasks, sched->nr_tasks * sizeof(struct task_task *));
>> fs/ceph/xattr.c:                xattrs = kcalloc(numattr, sizeof(struct ceph_xattr *),
>> fs/ceph/xattr.c:                memset(xattrs, 0, numattr*sizeof(struct ceph_xattr *));
> 
> Heh, the ceph one is a five year old typo..  Looks like it should be
> struct ceph_inode_xattr, I'll fix it up.  I'm curious though, how did
> you grep for these?
> 
> Thanks,
> 
>                 Ilya
> 

1:
	grep -Hr "sizeof[ *(]struct .* \*.)"  | cut -f2- -d':' | tee ~/tmp/out

2:
	cat ~/tmp/out | perl -wane 'chomp(); my ($left, $right) = split (/sizeof\(/); print $right, "\n";' | cut -f2 -d' ' | sort -u | cut -f1 -d')' | grep -v '^+' | while read i; do echo $i; git grep -q "struct $i {" || echo error; echo; done

3:
	ignore false positives

-- 
Toralf


  reply	other threads:[~2014-07-24 18:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 18:20 sizeof (struct tYpO *) : it is just a typo or rather a bug ? Toralf Förster
2014-07-24 18:20 ` Toralf Förster
2014-07-24 18:33 ` Ilya Dryomov
2014-07-24 18:33   ` Ilya Dryomov
2014-07-24 18:33   ` Ilya Dryomov
2014-07-24 18:37   ` Toralf Förster [this message]
2014-07-24 18:37     ` Toralf Förster
2014-07-24 18:37     ` Toralf Förster
2014-07-25 11:20 ` Henrique de Moraes Holschuh
2014-07-25 11:20   ` Henrique de Moraes Holschuh
2014-07-25 11:20   ` Henrique de Moraes Holschuh
2014-07-28 17:21   ` [Cocci] Fwd: " Toralf Förster
2014-07-28 20:13     ` Julia Lawall
2014-07-28 20:41       ` Toralf Förster
2014-07-28 20:50         ` Julia Lawall
2014-07-28 21:20           ` Toralf Förster
2014-07-29  5:49             ` Julia Lawall

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=53D15280.5070407@gmx.de \
    --to=toralf.foerster@gmx.de \
    --cc=ceph-devel@vger.kernel.org \
    --cc=ilya.dryomov@inktank.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.