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

On Mon, Mar 27, 2017 at 04:05:00PM +0000, 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 <>
     NetBSD: 26 ans d'experience feront toujours la difference

Home | Main Index | Thread Index | Old Index