mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Tejun Heo <tj@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>, Jens Axboe <axboe@kernel.dk>,
	Kay Sievers <kay.sievers@vrfy.org>,
	David Cross <david.cross@cypress.com>,
	linux-kernel@vger.kernel.org
Subject: suspect code in cyasblkdev_block conversion to bdops->check_events()
Date: Fri, 25 Mar 2011 06:48:03 -0400	[thread overview]
Message-ID: <check-events-cyasblkdev-block-suspect@mdm.bga.com> (raw)

> commit cafb0bfca1a73efd6d8a4a6a6a716e6134b96c24
> Author: Tejun Heo <tj@kernel.org>
> Commit: Tejun Heo <tj@kernel.org>
> 
>     staging: Convert to bdops->check_events()
>     
>     Convert two staging drivers - blkvsc_drv and cyasblkdev_block - from
>     ->media_changed() to ->check_events().  The former always indicated
>     media changed while the latter always indicated media not changed.
>     Not sure what the drivers are trying to achieve but keep the original
>     behavior.
>     
>     Signed-off-by: Tejun Heo <tj@kernel.org>
>     Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
>     Cc: Jens Axboe <axboe@kernel.dk>
>     Cc: Kay Sievers <kay.sievers@vrfy.org>
> 
..
> diff --git a/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c b/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c
> index e1851f0..842cd92 100644
..
> @@ -1090,6 +1090,7 @@ static int cyasblkdev_add_disks(int bus_num,
>  		bd->user_disk_0->first_minor = devidx << CYASBLKDEV_SHIFT;
>  		bd->user_disk_0->minors = 8;
>  		bd->user_disk_0->fops = &cyasblkdev_bdops;
> +		bd->user_disk_0->events = DISK_EVENT_MEDIA_CHANGE;
>  		bd->user_disk_0->private_data = bd;
>  		bd->user_disk_0->queue = bd->queue.queue;
>  		bd->dbgprn_flags = DBGPRN_RD_RQ;
> @@ -1190,6 +1191,7 @@ static int cyasblkdev_add_disks(int bus_num,
>  		bd->user_disk_1->first_minor = (devidx + 1) << CYASBLKDEV_SHIFT;
>  		bd->user_disk_1->minors = 8;
>  		bd->user_disk_1->fops = &cyasblkdev_bdops;
> +		bd->user_disk_0->events = DISK_EVENT_MEDIA_CHANGE;
>  		bd->user_disk_1->private_data = bd;
Date: Fri, 25 Mar 2011 04:48:01 -0600
X-Originating-IP: 71.22.127.106

The 0 on the above line triggered my suspect code pattern detector.

>  		bd->user_disk_1->queue = bd->queue.queue;
>  		bd->dbgprn_flags = DBGPRN_RD_RQ;
> @@ -1278,6 +1280,7 @@ static int cyasblkdev_add_disks(int bus_num,
>  				(devidx + 2) << CYASBLKDEV_SHIFT;
>  			bd->system_disk->minors = 8;
>  			bd->system_disk->fops = &cyasblkdev_bdops;
> +			bd->system_disk->events = DISK_EVENT_MEDIA_CHANGE;
>  			bd->system_disk->private_data = bd;
>  			bd->system_disk->queue = bd->queue.queue;
>  			/* don't search for vfat

milton

             reply	other threads:[~2011-03-25 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25 10:48 Milton Miller [this message]
2011-03-25 14:38 ` [PATCH] staging: Fix bdops->check_events() misconversion in cyasblkdev_block.c Tejun Heo

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=check-events-cyasblkdev-block-suspect@mdm.bga.com \
    --to=miltonm@bga.com \
    --cc=axboe@kernel.dk \
    --cc=david.cross@cypress.com \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome