From owner-svn-src-head@freebsd.org Wed Aug 15 22:59:50 2018 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 747B61073834 for ; Wed, 15 Aug 2018 22:59:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F34C6818B7 for ; Wed, 15 Aug 2018 22:59:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id p81-v6so4212372itp.1 for ; Wed, 15 Aug 2018 15:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=azziFUU7DXY/7d+wW7f7KIkRgyW8UzTyRWqer2K9bW0=; b=jsxaelDqZeaeya/hXiZkNpeY9cO/w0Sn4NSYqofTJCxm1OEYPFlCASrbN4+8cAryTf aojTjk9y6v10/h8XI+1yfBrqfmLs+1qq7A/k4kI3aoLpCno4Xeo/InuNBL5AvtkNkwjF enYeLeZsY4vYT4dFkJeSpk9VpSlgaIVemv+/IhqU814xFFpt0HwkMi3XZO4bRIVl5zlT iSBoCc4O93ZPAjU3VNwtP3oH1xNWZL84dzxEKsPKtuCjjn2FXVcvh147rgYUwFHlgFO6 zpgAYcHjlqm2SoecX/0JwNRqB7ywobSEZFbwN2wYnp2uSc8fVnJm0SkMAa31zOcQNt10 wr3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=azziFUU7DXY/7d+wW7f7KIkRgyW8UzTyRWqer2K9bW0=; b=ZBC9PQK9WB/h2YdMExqzJY97D3JLvOhX9+6b7qGTVGzwk9puqclnPw3twpBtFC6G39 ayK8l8GGW/ywtCoc4bu3gNAchY/oft+4RsHK8b1I9WG8ceDdXbkA7G3/a+swUtE8dC24 Sk6l0JJDRe+2r5zklW/pkFvBFWpw8r5/9csXrQYc1Hh+uoek+YrkyOLg9Iplo3J9ervX 2bzxuXblX+kVbJJw5NoplNBOvwa1/6/mgobXBHE+XksS/wVrwzaAY4pvX2LFrJfi9wTU KEtEJb80gfy04FtajlmMTIsT5thhWtNOQrCagJj5bsosNIFB/ZqNMfc8ik0ubhemJOfr jKeQ== X-Gm-Message-State: AOUpUlFOyWK/jyIW/6fkpPmgn4zXBq4O+TzKV71yi/iCrLi+PBJcR9h/ qoOfCIrJ3UfYAGvvkmsENL77iToWJ0Hwu7RkzFa9LacAFqk= X-Google-Smtp-Source: AA+uWPyM2JQFmVMKEeJ5M5iFQhYouaiqdnb9uAnDdM7sryR78hNQ9q5ehNBNIkRw83ZirlAWIegZTBiVAMYIf5oagBg= X-Received: by 2002:a02:bb04:: with SMTP id y4-v6mr25103717jan.5.1534373989190; Wed, 15 Aug 2018 15:59:49 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:257:0:0:0:0:0 with HTTP; Wed, 15 Aug 2018 15:59:48 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <1534372134.1466.21.camel@freebsd.org> References: <201808152225.w7FMP5J2018006@repo.freebsd.org> <1534372134.1466.21.camel@freebsd.org> From: Warner Losh Date: Wed, 15 Aug 2018 16:59:48 -0600 X-Google-Sender-Auth: k0mnpw-HHUNjSbeaj-SeP9utBSw Message-ID: Subject: Re: svn commit: r337878 - head/stand/i386/libi386 To: Ian Lepore Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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: Wed, 15 Aug 2018 22:59:50 -0000 On Wed, Aug 15, 2018 at 4:28 PM, Ian Lepore wrote: > On Wed, 2018-08-15 at 22:25 +0000, Toomas Soome wrote: > > Author: tsoome > > Date: Wed Aug 15 22:25:05 2018 > > New Revision: 337878 > > URL: https://svnweb.freebsd.org/changeset/base/337878 > > > > Log: > > libi386: remove bd_read() and bd_write() wrappers > > > > Those wroappers are nice, but do not really add much value. > > > > Modified: > > head/stand/i386/libi386/biosdisk.c > > > > Modified: head/stand/i386/libi386/biosdisk.c > > ===================================================================== > > ========= > > --- head/stand/i386/libi386/biosdisk.c Wed Aug 15 21:47:03 > > 2018 (r337877) > > +++ head/stand/i386/libi386/biosdisk.c Wed Aug 15 22:25:05 > > 2018 (r337878) > > @@ -94,10 +94,7 @@ static int nbdinfo = 0; > > > > static void bd_io_workaround(struct disk_devdesc *dev); > > > > -static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, > > - caddr_t dest); > > -static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int > > blks, > > - caddr_t dest); > > +static int bd_io(struct disk_devdesc *, daddr_t, int, caddr_t, int); > > static int bd_int13probe(struct bdinfo *bd); > > > > static int bd_init(void); > > @@ -506,7 +503,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > > dblk, s > > case F_READ: > > DEBUG("read %d from %lld to %p", blks, dblk, buf); > > > > - if (blks && (rc = bd_read(dev, dblk, blks, buf))) { > > + if (blks && (rc = bd_io(dev, dblk, blks, buf, 0))) { > > /* Filter out floppy controller errors */ > > if (BD(dev).bd_flags != BD_FLOPPY || rc != > > 0x20) { > > printf("read %d from %lld to %p, > > error: 0x%x\n", > > @@ -518,7 +515,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t > > dblk, s > > case F_WRITE : > > DEBUG("write %d from %lld to %p", blks, dblk, buf); > > > > - if (blks && bd_write(dev, dblk, blks, buf)) { > > + if (blks && bd_io(dev, dblk, blks, buf, 1)) { > > DEBUG("write error"); > > return (EIO); > > } > > @@ -713,20 +710,6 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, > > int blks > > } > > > > return (0); > > -} > > - > > -static int > > -bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > > dest) > > -{ > > - > > - return (bd_io(dev, dblk, blks, dest, 0)); > > -} > > - > > -static int > > -bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t > > dest) > > -{ > > - > > - return (bd_io(dev, dblk, blks, dest, 1)); > > } > > > > /* > > > > This would be a more satisfying change if there were something like > > #define BD_RD 0 > #define BD_WR 1 > > so that it was clear at a glance what a bd_io() call is doing. > I think that's a good idea... Warner