From nobody Wed Jan 26 07:30:46 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D3F9E197504E; Wed, 26 Jan 2022 07:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JkFkZ5fhYz4pr3; Wed, 26 Jan 2022 07:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643182246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tJ5yx04qlNh1thQMZ20Y8k/Gi+LB6+CJ6XFjgsZuPOU=; b=sdUSzFd88KrSoMShSx1p42Qc/ysgHzmoqNl62zKuFrzqF8HeImtJDmkM28f5w1U21nuS0n fdJl3lTQYVzOgNgWy3i1P1bybh4wJQGndkeCWKkTWSzsvMrVXZGItx2WV+EMrAoCj9XMj/ hR/DVqsrSuAd86wC/CxmPUnzxGQAZ4YO6juiug2JSn0PSd+wqPA6RAuRHtSLEBpc1OnIGy FjEIzARt1YbKxagNQsgUCfamP7wjPCKmAvQ9FcAk0EI4UzgMhcRL5UM/LKZHqpRaZc1jJc w55M0GqQU6jgWr1/xb6xOxLWb8MJ1VHYTL+8KqWQhZeChaO904DTfxSncUDk9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3A52194BC; Wed, 26 Jan 2022 07:30:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20Q7UkfL058815; Wed, 26 Jan 2022 07:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20Q7UkTN058814; Wed, 26 Jan 2022 07:30:46 GMT (envelope-from git) Date: Wed, 26 Jan 2022 07:30:46 GMT Message-Id: <202201260730.20Q7UkTN058814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 098780e8fe98 - stable/13 - mmc_da: use MMC_SECTOR_SIZE constant in place of literals List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 098780e8fe98f07963fe67b48faf8a5f7ba48e99 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643182246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tJ5yx04qlNh1thQMZ20Y8k/Gi+LB6+CJ6XFjgsZuPOU=; b=g5iUUIwDlwPLFAgjHIB9eXvDM5lyPjd0F3IhU75zO2y8UZl2s1sXOUard4AQaq09siIxjq YnQq56y9XThc5nDqoio8HBkd8vRfm49Yp1iOY3R6DdyMkkWnTdcPiMNB0qBV0IBTXv3uJK 7mk611pdPdc38HGayJ8lG3shC/aGATV84rEqYLffY0aa1wpT4giuw9miy26g3OQKQoAbr7 3FXGJAGxwsr/07m9H3oeWyH31QKBvCNQ4HfY26a2i/jtQa7DIiLcdnLL1TrOGPYVdbWtX6 z5Tuyxl5BseuViDD7ZdKYfRssCvoO442jmCVbMYXKLFLpqEBmI8rEjDIzyixFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643182246; a=rsa-sha256; cv=none; b=nPqd1dD/AdDPbdUP0KS5RQgP2VTrtgjcoKPAEcR+oYBoCpwKyS7800p6IZFhsqENmer6hv 2oddPiH1wgNGYrOGHUEXOMcc0VkLBS3Jh6a4e6R9IPy1FyAE978p+1au7sv5BM+Bv9hVC1 y5IDrPJ4JAfRP70dbVNyxAOtDzDccA4Cjiv4iITOOeF4sjZzDyahe98LXUWfIe2O4BUHbB hsMM68CRSz3Lc0GY1i4UEBI1Kstznfp8PhyBruqqBABDUeMRTL7FSZa6vuNy+yogcK8MPZ 0YC9anPDw5qjO5KlLBXvUV4JYs0glX+GLiRTajXH8DHOJ0i1Ke6fq13RZm2C6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=098780e8fe98f07963fe67b48faf8a5f7ba48e99 commit 098780e8fe98f07963fe67b48faf8a5f7ba48e99 Author: Andriy Gapon AuthorDate: 2022-01-12 07:14:36 +0000 Commit: Andriy Gapon CommitDate: 2022-01-26 07:29:59 +0000 mmc_da: use MMC_SECTOR_SIZE constant in place of literals (cherry picked from commit 60b7d5a24a8fe9ddd4f3880119a52d9df8519fbe) --- sys/cam/mmc/mmc_da.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 272721f5ef34..15e80fe879c9 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1257,7 +1257,7 @@ sdda_start_init(void *context, union ccb *start_ccb) mmc_decode_cid_sd(mmcp->card_cid, &softc->cid); } - softc->sector_count = softc->csd.capacity / 512; + softc->sector_count = softc->csd.capacity / MMC_SECTOR_SIZE; softc->mediasize = softc->csd.capacity; softc->cmd6_time = mmc_get_cmd6_timeout(periph); @@ -1269,7 +1269,7 @@ sdda_start_init(void *context, union ccb *start_ccb) (softc->raw_ext_csd[EXT_CSD_SEC_CNT + 3] << 24); if (sec_count != 0) { softc->sector_count = sec_count; - softc->mediasize = softc->sector_count * 512; + softc->mediasize = softc->sector_count * MMC_SECTOR_SIZE; /* FIXME: there should be a better name for this option...*/ mmcp->card_features |= CARD_FEATURE_SDHC; } @@ -1556,7 +1556,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, const char *name, part->disk = disk_alloc(); part->disk->d_rotation_rate = DISK_RR_NON_ROTATING; part->disk->d_devstat = devstat_new_entry(part->name, - cnt, 512, + cnt, MMC_SECTOR_SIZE, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT | XPORT_DEVSTAT_TYPE(cpi.transport), DEVSTAT_PRIORITY_DISK); @@ -1838,7 +1838,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ccb) { struct ccb_mmcio *mmcio; uint64_t blockno = bp->bio_pblkno; - uint16_t count = bp->bio_bcount / 512; + uint16_t count = bp->bio_bcount / MMC_SECTOR_SIZE; uint16_t opcode; if (bp->bio_cmd == BIO_READ) @@ -1875,7 +1875,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ccb) mmcio->cmd.data = softc->mmcdata; memset(mmcio->cmd.data, 0, sizeof(struct mmc_data)); mmcio->cmd.data->data = bp->bio_data; - mmcio->cmd.data->len = 512 * count; + mmcio->cmd.data->len = MMC_SECTOR_SIZE * count; mmcio->cmd.data->flags = (bp->bio_cmd == BIO_READ ? MMC_DATA_READ : MMC_DATA_WRITE); /* Direct h/w to issue CMD12 upon completion */ if (count > 1) { @@ -2025,7 +2025,7 @@ sddadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, if (softc->state != SDDA_STATE_NORMAL) return (ENXIO); - count = length / 512; + count = length / MMC_SECTOR_SIZE; if (count == 0) return (0); @@ -2045,7 +2045,7 @@ sddadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, else opcode = MMC_WRITE_BLOCK; mmcio.cmd.opcode = opcode; - mmcio.cmd.arg = offset / 512; + mmcio.cmd.arg = offset / MMC_SECTOR_SIZE; if (!(mmcp->card_features & CARD_FEATURE_SDHC)) mmcio.cmd.arg <<= 9; @@ -2053,7 +2053,7 @@ sddadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, mmcio.cmd.data = softc->mmcdata; memset(mmcio.cmd.data, 0, sizeof(struct mmc_data)); mmcio.cmd.data->data = virtual; - mmcio.cmd.data->len = 512 * count; + mmcio.cmd.data->len = MMC_SECTOR_SIZE * count; mmcio.cmd.data->flags = MMC_DATA_WRITE; /* Direct h/w to issue CMD12 upon completion */