From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934318AbaGXSh5 (ORCPT ); Thu, 24 Jul 2014 14:37:57 -0400 Received: from mout.gmx.net ([212.227.15.19]:51011 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757603AbaGXSh4 (ORCPT ); Thu, 24 Jul 2014 14:37:56 -0400 Message-ID: <53D15280.5070407@gmx.de> Date: Thu, 24 Jul 2014 20:37:52 +0200 From: =?UTF-8?B?VG9yYWxmIEbDtnJzdGVy?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Ilya Dryomov CC: linux-ia64@vger.kernel.org, Ceph Development , Linux Kernel Subject: Re: sizeof (struct tYpO *) : it is just a typo or rather a bug ? References: <53D14E60.1010105@gmx.de> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:c8Kjehwzin47qvzIbk0vXBNh74tx5tIpyfqvcydLanP3tsP75lL NLhyQBJDD28m+oQUFnuy5J3XSARf0Tg9V4KfP6+qnycu0LZszvmfp6kofCIy3FM2om+fqV8 wcA3Xy9LWTXlzv+BEF1NwU+FnCAeeVfCrWvfwvd51BPRs5PW969Wp2IXBUZ+NOPuF70YwbV y6LbQHNxRkuJJOs8J8WKw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/24/2014 08:33 PM, Ilya Dryomov wrote: > On Thu, Jul 24, 2014 at 10:20 PM, Toralf Förster 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?VG9yYWxmIEbDtnJzdGVy?= Subject: Re: sizeof (struct tYpO *) : it is just a typo or rather a bug ? Date: Thu, 24 Jul 2014 20:37:52 +0200 Message-ID: <53D15280.5070407@gmx.de> References: <53D14E60.1010105@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mout.gmx.net ([212.227.15.19]:51011 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757603AbaGXSh4 (ORCPT ); Thu, 24 Jul 2014 14:37:56 -0400 In-Reply-To: Sender: ceph-devel-owner@vger.kernel.org List-ID: To: Ilya Dryomov Cc: linux-ia64@vger.kernel.org, Ceph Development , Linux Kernel On 07/24/2014 08:33 PM, Ilya Dryomov wrote: > On Thu, Jul 24, 2014 at 10:20 PM, Toralf F=C3=B6rster 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 defini= tion is located : >> >> arch/ia64/sn/kernel/io_acpi_init.c: sizeof(struct pci_devdev= _info *)) { >> tools/perf/builtin-sched.c: sched->tasks =3D realloc(sched->task= s, sched->nr_tasks * sizeof(struct task_task *)); >> fs/ceph/xattr.c: xattrs =3D kcalloc(numattr, sizeof(s= truct ceph_xattr *), >> fs/ceph/xattr.c: memset(xattrs, 0, numattr*sizeof(str= uct ceph_xattr *)); >=20 > 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? >=20 > Thanks, >=20 > Ilya >=20 1: grep -Hr "sizeof[ *(]struct .* \*.)" | cut -f2- -d':' | tee ~/tmp/out 2: cat ~/tmp/out | perl -wane 'chomp(); my ($left, $right) =3D split (/si= zeof\(/); 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 --=20 Toralf -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?VG9yYWxmIEbDtnJzdGVy?= Date: Thu, 24 Jul 2014 18:37:52 +0000 Subject: Re: sizeof (struct tYpO *) : it is just a typo or rather a bug ? Message-Id: <53D15280.5070407@gmx.de> List-Id: References: <53D14E60.1010105@gmx.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Ilya Dryomov Cc: linux-ia64@vger.kernel.org, Ceph Development , Linux Kernel On 07/24/2014 08:33 PM, Ilya Dryomov wrote: > On Thu, Jul 24, 2014 at 10:20 PM, Toralf F=C3=B6rster 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_inf= o *)) { >> tools/perf/builtin-sched.c: sched->tasks =3D realloc(sched->tasks, s= ched->nr_tasks * sizeof(struct task_task *)); >> fs/ceph/xattr.c: xattrs =3D kcalloc(numattr, sizeof(struc= t ceph_xattr *), >> fs/ceph/xattr.c: memset(xattrs, 0, numattr*sizeof(struct = ceph_xattr *)); >=20 > 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? >=20 > Thanks, >=20 > Ilya >=20 1: grep -Hr "sizeof[ *(]struct .* \*.)" | cut -f2- -d':' | tee ~/tmp/out 2: cat ~/tmp/out | perl -wane 'chomp(); my ($left, $right) =3D 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 erro= r; echo; done 3: ignore false positives --=20 Toralf