Date: Wed, 25 Feb 2015 10:18:12 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279278 - head/sys/geom/raid Message-ID: <201502251018.t1PAICqv015073@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Feb 25 10:18:11 2015 New Revision: 279278 URL: https://svnweb.freebsd.org/changeset/base/279278 Log: Replace constant with proper sizeof(). Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 2 weeks Modified: head/sys/geom/raid/md_intel.c head/sys/geom/raid/md_jmicron.c head/sys/geom/raid/md_nvidia.c head/sys/geom/raid/md_promise.c head/sys/geom/raid/md_sii.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Wed Feb 25 10:10:40 2015 (r279277) +++ head/sys/geom/raid/md_intel.c Wed Feb 25 10:18:11 2015 (r279278) @@ -1487,7 +1487,6 @@ g_raid_md_taste_intel(struct g_raid_md_o /* Read metadata from device. */ meta = NULL; - vendor = 0xffff; disk_pos = 0; g_topology_unlock(); error = g_raid_md_get_label(cp, serial, sizeof(serial)); @@ -1496,7 +1495,8 @@ g_raid_md_taste_intel(struct g_raid_md_o pp->name, error); goto fail2; } - len = 2; + vendor = 0xffff; + len = sizeof(vendor); if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = intel_meta_read(cp); Modified: head/sys/geom/raid/md_jmicron.c ============================================================================== --- head/sys/geom/raid/md_jmicron.c Wed Feb 25 10:10:40 2015 (r279277) +++ head/sys/geom/raid/md_jmicron.c Wed Feb 25 10:18:11 2015 (r279278) @@ -836,9 +836,9 @@ g_raid_md_taste_jmicron(struct g_raid_md /* Read metadata from device. */ meta = NULL; - vendor = 0xffff; g_topology_unlock(); - len = 2; + vendor = 0xffff; + len = sizeof(vendor); if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = jmicron_meta_read(cp); Modified: head/sys/geom/raid/md_nvidia.c ============================================================================== --- head/sys/geom/raid/md_nvidia.c Wed Feb 25 10:10:40 2015 (r279277) +++ head/sys/geom/raid/md_nvidia.c Wed Feb 25 10:18:11 2015 (r279278) @@ -841,9 +841,9 @@ g_raid_md_taste_nvidia(struct g_raid_md_ /* Read metadata from device. */ meta = NULL; - vendor = 0xffff; g_topology_unlock(); - len = 2; + vendor = 0xffff; + len = sizeof(vendor); if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = nvidia_meta_read(cp); Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Wed Feb 25 10:10:40 2015 (r279277) +++ head/sys/geom/raid/md_promise.c Wed Feb 25 10:18:11 2015 (r279278) @@ -1105,9 +1105,9 @@ g_raid_md_taste_promise(struct g_raid_md /* Read metadata from device. */ meta = NULL; - vendor = 0xffff; g_topology_unlock(); - len = 2; + vendor = 0xffff; + len = sizeof(vendor); if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); subdisks = promise_meta_read(cp, metaarr); Modified: head/sys/geom/raid/md_sii.c ============================================================================== --- head/sys/geom/raid/md_sii.c Wed Feb 25 10:10:40 2015 (r279277) +++ head/sys/geom/raid/md_sii.c Wed Feb 25 10:18:11 2015 (r279278) @@ -923,9 +923,9 @@ g_raid_md_taste_sii(struct g_raid_md_obj /* Read metadata from device. */ meta = NULL; - vendor = 0xffff; g_topology_unlock(); - len = 2; + vendor = 0xffff; + len = sizeof(vendor); if (pp->geom->rank == 1) g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor); meta = sii_meta_read(cp);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502251018.t1PAICqv015073>