public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: kmalloc args reversed, small function definition fixes
@ 2008-08-27 20:24 Harvey Harrison
  2008-08-28  7:26 ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Harvey Harrison @ 2008-08-27 20:24 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Andrew Morton, LKML

Noticed by sparse:
block/blk-softirq.c:156:12: warning: symbol 'blk_softirq_init' was not declared. Should it be static?
block/genhd.c:583:28: warning: function 'bdget_disk' with external linkage has definition
block/genhd.c:659:17: warning: incorrect type in argument 1 (different base types)
block/genhd.c:659:17:    expected unsigned int [unsigned] [usertype] size
block/genhd.c:659:17:    got restricted gfp_t
block/genhd.c:659:29: warning: incorrect type in argument 2 (different base types)
block/genhd.c:659:29:    expected restricted gfp_t [usertype] flags
block/genhd.c:659:29:    got unsigned int
block: kmalloc args reversed

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
new in next-20080827

 block/blk-settings.c |    2 +-
 block/genhd.c        |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index a60e959..d70692b 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -443,7 +443,7 @@ void blk_queue_update_dma_alignment(struct request_queue *q, int mask)
 }
 EXPORT_SYMBOL(blk_queue_update_dma_alignment);
 
-int __init blk_settings_init(void)
+static int __init blk_settings_init(void)
 {
 	blk_max_low_pfn = max_low_pfn - 1;
 	blk_max_pfn = max_pfn - 1;
diff --git a/block/genhd.c b/block/genhd.c
index a189358..e2eaaa3 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -580,7 +580,7 @@ struct gendisk *get_gendisk(dev_t devt, int *partno)
  * RETURNS:
  * Resulting block_device on success, NULL on failure.
  */
-extern struct block_device *bdget_disk(struct gendisk *disk, int partno)
+struct block_device *bdget_disk(struct gendisk *disk, int partno)
 {
 	struct hd_struct *part;
 	struct block_device *bdev = NULL;
@@ -656,7 +656,7 @@ static void *disk_seqf_start(struct seq_file *seqf, loff_t *pos)
 	struct class_dev_iter *iter;
 	struct device *dev;
 
-	iter = kmalloc(GFP_KERNEL, sizeof(*iter));
+	iter = kmalloc(sizeof(*iter), GFP_KERNEL);
 	if (!iter)
 		return ERR_PTR(-ENOMEM);
 
-- 
1.6.0.366.gf9ffa8




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] block: kmalloc args reversed, small function definition  fixes
  2008-08-27 20:24 [PATCH] block: kmalloc args reversed, small function definition fixes Harvey Harrison
@ 2008-08-28  7:26 ` Jens Axboe
  2008-08-28 14:19   ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2008-08-28  7:26 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andrew Morton, LKML

On Wed, Aug 27 2008, Harvey Harrison wrote:
> Noticed by sparse:
> block/blk-softirq.c:156:12: warning: symbol 'blk_softirq_init' was not declared. Should it be static?
> block/genhd.c:583:28: warning: function 'bdget_disk' with external linkage has definition
> block/genhd.c:659:17: warning: incorrect type in argument 1 (different base types)
> block/genhd.c:659:17:    expected unsigned int [unsigned] [usertype] size
> block/genhd.c:659:17:    got restricted gfp_t
> block/genhd.c:659:29: warning: incorrect type in argument 2 (different base types)
> block/genhd.c:659:29:    expected restricted gfp_t [usertype] flags
> block/genhd.c:659:29:    got unsigned int
> block: kmalloc args reversed

Woops, that kmalloc() is nasty. Thanks a lot, applied to for-2.6.28.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] block: kmalloc args reversed, small function definition  fixes
  2008-08-28  7:26 ` Jens Axboe
@ 2008-08-28 14:19   ` Christoph Hellwig
  2008-08-28 14:28     ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2008-08-28 14:19 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Harvey Harrison, Andrew Morton, LKML

On Thu, Aug 28, 2008 at 09:26:21AM +0200, Jens Axboe wrote:
> On Wed, Aug 27 2008, Harvey Harrison wrote:
> > Noticed by sparse:
> > block/blk-softirq.c:156:12: warning: symbol 'blk_softirq_init' was not declared. Should it be static?
> > block/genhd.c:583:28: warning: function 'bdget_disk' with external linkage has definition
> > block/genhd.c:659:17: warning: incorrect type in argument 1 (different base types)
> > block/genhd.c:659:17:    expected unsigned int [unsigned] [usertype] size
> > block/genhd.c:659:17:    got restricted gfp_t
> > block/genhd.c:659:29: warning: incorrect type in argument 2 (different base types)
> > block/genhd.c:659:29:    expected restricted gfp_t [usertype] flags
> > block/genhd.c:659:29:    got unsigned int
> > block: kmalloc args reversed
> 
> Woops, that kmalloc() is nasty. Thanks a lot, applied to for-2.6.28.

Umm, the gfp bit sounds like a clear 2.6.27 candidate.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] block: kmalloc args reversed, small function  definition  fixes
  2008-08-28 14:19   ` Christoph Hellwig
@ 2008-08-28 14:28     ` Jens Axboe
  2008-08-28 14:30       ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2008-08-28 14:28 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Harvey Harrison, Andrew Morton, LKML

On Thu, Aug 28 2008, Christoph Hellwig wrote:
> On Thu, Aug 28, 2008 at 09:26:21AM +0200, Jens Axboe wrote:
> > On Wed, Aug 27 2008, Harvey Harrison wrote:
> > > Noticed by sparse:
> > > block/blk-softirq.c:156:12: warning: symbol 'blk_softirq_init' was not declared. Should it be static?
> > > block/genhd.c:583:28: warning: function 'bdget_disk' with external linkage has definition
> > > block/genhd.c:659:17: warning: incorrect type in argument 1 (different base types)
> > > block/genhd.c:659:17:    expected unsigned int [unsigned] [usertype] size
> > > block/genhd.c:659:17:    got restricted gfp_t
> > > block/genhd.c:659:29: warning: incorrect type in argument 2 (different base types)
> > > block/genhd.c:659:29:    expected restricted gfp_t [usertype] flags
> > > block/genhd.c:659:29:    got unsigned int
> > > block: kmalloc args reversed
> > 
> > Woops, that kmalloc() is nasty. Thanks a lot, applied to for-2.6.28.
> 
> Umm, the gfp bit sounds like a clear 2.6.27 candidate.

I would agree, except the bug is introduced by a patch in the 2.6.28
series :-)

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] block: kmalloc args reversed, small function definition  fixes
  2008-08-28 14:28     ` Jens Axboe
@ 2008-08-28 14:30       ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2008-08-28 14:30 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Christoph Hellwig, Harvey Harrison, Andrew Morton, LKML

On Thu, Aug 28, 2008 at 04:28:00PM +0200, Jens Axboe wrote:
> > > Woops, that kmalloc() is nasty. Thanks a lot, applied to for-2.6.28.
> > 
> > Umm, the gfp bit sounds like a clear 2.6.27 candidate.
> 
> I would agree, except the bug is introduced by a patch in the 2.6.28
> series :-)

Ah, okay.  Makes sense then.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-08-28 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-27 20:24 [PATCH] block: kmalloc args reversed, small function definition fixes Harvey Harrison
2008-08-28  7:26 ` Jens Axboe
2008-08-28 14:19   ` Christoph Hellwig
2008-08-28 14:28     ` Jens Axboe
2008-08-28 14:30       ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox