mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kevin Corry <kevcorry@us.ibm.com>
To: Joe Thornber <thornber@sistina.com>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Linux Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/7] dm: signed/unsigned audit
Date: Mon, 9 Jun 2003 10:03:27 -0500	[thread overview]
Message-ID: <200306091003.27762.kevcorry@us.ibm.com> (raw)
In-Reply-To: <20030609143523.GC11331@fib011235813.fsnet.co.uk>

On Monday 09 June 2003 09:35, Joe Thornber wrote:
> signed/unsigned audit.

> --- diff/drivers/md/dm.c	2003-05-21 11:50:15.000000000 +0100
> +++ source/drivers/md/dm.c	2003-06-09 15:05:02.000000000 +0100
> @@ -546,21 +546,22 @@
>
>  	spin_lock(&_minor_lock);
>  	if (!test_and_set_bit(minor, _minor_bits))
> -		r = minor;
> +		r = 0;
>  	spin_unlock(&_minor_lock);
>
>  	return r;
>  }
>
> -static int next_free_minor(void)
> +static int next_free_minor(unsigned int *minor)
>  {
> -	int minor, r = -EBUSY;
> +	unsigned int m, r = -EBUSY;

Looks like "r" should still be signed.

>  	spin_lock(&_minor_lock);
> -	minor = find_first_zero_bit(_minor_bits, MAX_DEVICES);
> -	if (minor != MAX_DEVICES) {
> -		set_bit(minor, _minor_bits);
> -		r = minor;
> +	m = find_first_zero_bit(_minor_bits, MAX_DEVICES);
> +	if (m != MAX_DEVICES) {
> +		set_bit(m, _minor_bits);
> +		*minor = m;
> +		r = 0;
>  	}
>  	spin_unlock(&_minor_lock);
>

-- 
Kevin Corry
kevcorry@us.ibm.com
http://evms.sourceforge.net/


  reply	other threads:[~2003-06-09 14:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-09 14:29 device-mapper patchset against 2.5.70 Joe Thornber
2003-06-09 14:34 ` [PATCH 1/7] dm: Replace __HIGH() and __LOW() macros Joe Thornber
2003-06-17 23:10   ` Adrian Bunk
2003-06-09 14:35 ` [PATCH 2/7] dm: signed/unsigned audit Joe Thornber
2003-06-09 15:03   ` Kevin Corry [this message]
2003-06-09 15:33     ` [PATCH 2/7 (corrected)] " Joe Thornber
2003-06-09 15:34     ` [PATCH 2/7] " Linus Torvalds
2003-06-09 14:36 ` [PATCH 3/7] dm: new suspend/resume target methods Joe Thornber
2003-06-09 14:36 ` [PATCH 4/7] dm: Lift dm_div_up() Joe Thornber
2003-06-09 14:37 ` [PATCH 5/7] dm: Fix memory leak in dm_register_target() Joe Thornber
2003-06-09 14:37 ` [PATCH 6/7] dm: Remove some debug messages Joe Thornber
2003-06-09 14:38 ` [PATCH 7/7] dm: Remove an old FIXME Joe Thornber

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=200306091003.27762.kevcorry@us.ibm.com \
    --to=kevcorry@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thornber@sistina.com \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®