From owner-svn-src-head@freebsd.org Mon Jun 24 20:19:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F2C715D85AB; Mon, 24 Jun 2019 20:19:04 +0000 (UTC) (envelope-from imp@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45F3886C39; Mon, 24 Jun 2019 20:19:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15ADB6075; Mon, 24 Jun 2019 20:19:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x5OKJ3VL048673; Mon, 24 Jun 2019 20:19:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5OKJ3Rl048672; Mon, 24 Jun 2019 20:19:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906242019.x5OKJ3Rl048672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 24 Jun 2019 20:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349341 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 349341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45F3886C39 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jun 2019 20:19:05 -0000 Author: imp Date: Mon Jun 24 20:19:03 2019 New Revision: 349341 URL: https://svnweb.freebsd.org/changeset/base/349341 Log: Use ata_param_fixup instead of a custom copy here Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Jun 24 20:18:58 2019 (r349340) +++ head/sbin/camcontrol/camcontrol.c Mon Jun 24 20:19:03 2019 (r349341) @@ -2326,9 +2326,11 @@ ata_do_identify(struct cam_device *device, int retry_c } } + ident_buf = (struct ata_params *)ptr; + ata_param_fixup(ident_buf); + error = 1; for (i = 0; i < sizeof(struct ata_params) / 2; i++) { - ptr[i] = le16toh(ptr[i]); if (ptr[i] != 0) error = 0; } @@ -2345,26 +2347,6 @@ ata_do_identify(struct cam_device *device, int retry_c free(ptr); return (error); } - - ident_buf = (struct ata_params *)ptr; - if (strncmp(ident_buf->model, "FX", 2) && - strncmp(ident_buf->model, "NEC", 3) && - strncmp(ident_buf->model, "Pioneer", 7) && - strncmp(ident_buf->model, "SHARP", 5)) { - ata_bswap(ident_buf->model, sizeof(ident_buf->model)); - ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bswap(ident_buf->media_serial, sizeof(ident_buf->media_serial)); - } - ata_btrim(ident_buf->model, sizeof(ident_buf->model)); - ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); - ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); - ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); - ata_btrim(ident_buf->media_serial, sizeof(ident_buf->media_serial)); - ata_bpack(ident_buf->media_serial, ident_buf->media_serial, - sizeof(ident_buf->media_serial)); *ident_bufp = ident_buf;