lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140902182402.GA12744@kroah.com>
Date:	Tue, 2 Sep 2014 11:24:02 -0700
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
Cc:	Benjamin Romer <benjamin.romer@...sys.com>,
	David Kershner <david.kershner@...sys.com>,
	sparmaintainer@...sys.com, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] staging: unisys: uislib: uisqueue.c: rewrite of
 do_locked_client_insert

On Tue, Sep 02, 2014 at 11:46:35PM +0530, Sudip Mukherjee wrote:
> From: Sudip Mukherjee <sudip@...torindia.org>
> 
> removed unused variables
> fixed sparse warning of context imbalance in 'do_locked_client_insert'
>                          different lock contexts for basic block
> 
> Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
> ---
> 
> v1 of the patch of the patch just fixed the sparse warning.
> On suggestion of Dan Carpenter v2 is the total rewrite of the function.
> Two of the function arguments (interruptHandle,channelId) are also not used. Wanted to remove them as well , 
> but then thought maybe the original author have planned for some use of those variables.
> 
>  drivers/staging/unisys/uislib/uisqueue.c | 37 ++++++++------------------------
>  1 file changed, 9 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c
> index 63dbe7c..acfa46d 100644
> --- a/drivers/staging/unisys/uislib/uisqueue.c
> +++ b/drivers/staging/unisys/uislib/uisqueue.c
> @@ -78,39 +78,20 @@ do_locked_client_insert(struct uisqueue_info *queueinfo,
>  			u64 interruptHandle, u8 *channelId)
>  {
>  	unsigned long flags;
> -	unsigned char queueWasEmpty;
> -	unsigned int locked = 0;
> -	unsigned int acquired = 0;
>  	u8 rc = 0;
>  
>  	spin_lock_irqsave(lock, flags);
> -	locked = 1;
> -
>  	if (!ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(queueinfo->chan, channelId, NULL))
> -		goto Away;
> -
> -	acquired = 1;
> -
> -	queueWasEmpty = visor_signalqueue_empty(queueinfo->chan, whichqueue);
> -	if (!visor_signal_insert(queueinfo->chan, whichqueue, pSignal))
> -		goto Away;
> -	ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId, NULL);
> -	acquired = 0;
> -
> -	queueinfo->packets_sent++;
> -
> -	rc = 1;
> -Away:
> -	if (acquired) {
> -		ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId,
> -						NULL);
> -		acquired = 0;
> -	}
> -	if (locked) {
> -		spin_unlock_irqrestore((spinlock_t *) lock, flags);
> -		locked = 0;
> +		goto unlock;
> +	visor_signalqueue_empty(queueinfo->chan, whichqueue);
> +	/*visor_signal_insert() only return 0 or 1 */

Odd comment style (hint, you need a ' ' at the beginning...)

And why comment this at all?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ