NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-xen/52112: arch/xen/xenbus/xenbus_dev.c:400: pointless assignment in critical section



The following reply was made to PR port-xen/52112; it has been noted by GNATS.

From: Manuel Bouyer <bouyer%antioche.eu.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: port-xen-maintainer%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
        netbsd-bugs%netbsd.org@localhost
Subject: Re: port-xen/52112: arch/xen/xenbus/xenbus_dev.c:400: pointless
 assignment in critical section
Date: Mon, 27 Mar 2017 18:13:26 +0200

 On Mon, Mar 27, 2017 at 04:05:00PM +0000, dcb314%hotmail.com@localhost wrote:
 > src/sys/arch/xen/xenbus/xenbus_dev.c:395] -> [src/sys/arch/xen/xenbus/xenbus_dev.c:400]: (style) Variable 'u' is reassigned a value before the old one has been used.
 > 
 > Source code is
 > 
 >     struct xenbus_dev_data *u = kfs->kfs_v;
 >     struct xenbus_dev_lwp *xlwp;
 >     struct xenbus_dev_transaction *trans;
 > 
 >     mutex_enter(&xenbus_dev_open_mtx);
 >     u = kfs->kfs_v;
 > 
 > Second assignment looks pointless. Suggest remove. 
 
 Actually it's the first one that should be removed. The xenbus_dev_open_mtx
 mutex protects kfs. Maybe kfs assignement should be moved under the
 mutex too.
 Will look and fix later today
 
 -- 
 Manuel Bouyer <bouyer%antioche.eu.org@localhost>
      NetBSD: 26 ans d'experience feront toujours la difference
 --
 


Home | Main Index | Thread Index | Old Index