Date: Tue, 7 Mar 2017 23:02:59 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314888 - head/sys/dev/nvme Message-ID: <201703072302.v27N2xZG006884@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Tue Mar 7 23:02:59 2017 New Revision: 314888 URL: https://svnweb.freebsd.org/changeset/base/314888 Log: cwd10 takes the low 32-bits and cwd11 takes the upper 32-bits of the lba. Rather than do a cast to uint64_t, which clang warns might be unaligned, do the stores 32-bits at a time. Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme.h Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Tue Mar 7 22:42:44 2017 (r314887) +++ head/sys/dev/nvme/nvme.h Tue Mar 7 23:02:59 2017 (r314888) @@ -955,7 +955,8 @@ void nvme_ns_rw_cmd(struct nvme_command { cmd->opc = rwcmd; cmd->nsid = nsid; - *(uint64_t *)&cmd->cdw10 = lba; + cmd->cdw10 = lba & 0xffffffffu; + cmd->cdw11 = lba >> 32; cmd->cdw12 = count-1; cmd->cdw13 = 0; cmd->cdw14 = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703072302.v27N2xZG006884>