[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] createRawFileOpHook: avoid dead stores



On 04/07/2010 12:42 PM, Jim Meyering wrote:
> +++ b/src/storage/storage_backend.c
> @@ -308,12 +308,11 @@ static int createRawFileOpHook(int fd, void *data) {
>                   * update every 9s is a fair-enough trade-off
>                   */
>                  unsigned long long bytes = 512 * 1024 * 1024;
> -                int r;
> 
>                  if (bytes > remain)
>                      bytes = remain;
> -                if ((r = safezero(fd, 0, hdata->vol->allocation - remain,
> -                                  bytes)) != 0) {
> +                if (safezero(fd, 0, hdata->vol->allocation - remain,
> +                             bytes) != 0) {
>                      ret = errno;
>                      virReportSystemError(errno, _("cannot fill file '%s'"),
>                                           hdata->vol->target.path);

ACK - the fact that it still compiles is proof of the dead store, so the
removal is safe.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]