Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x68k/stand x68k/stand: Merge {sd,cd}strategy and {s...



details:   https://anonhg.NetBSD.org/src/rev/474fabfaf0f2
branches:  trunk
changeset: 367702:474fabfaf0f2
user:      isaki <isaki%NetBSD.org@localhost>
date:      Thu Jun 23 12:32:22 2022 +0000

description:
x68k/stand: Merge {sd,cd}strategy and {sd,cd}close respectively.
For sd and cd devs, only open differs and the rest is the same.
No functional changes intended.
Suggested by tsutsui@ at port-x68k.

diffstat:

 sys/arch/x68k/stand/boot/conf.c     |   6 +++---
 sys/arch/x68k/stand/libsa/libx68k.h |   8 +++-----
 sys/arch/x68k/stand/libsa/sdcd.c    |  21 +++------------------
 3 files changed, 9 insertions(+), 26 deletions(-)

diffs (91 lines):

diff -r bf4b8afbfadf -r 474fabfaf0f2 sys/arch/x68k/stand/boot/conf.c
--- a/sys/arch/x68k/stand/boot/conf.c   Thu Jun 23 09:58:25 2022 +0000
+++ b/sys/arch/x68k/stand/boot/conf.c   Thu Jun 23 12:32:22 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.12 2022/04/25 15:12:07 mlelstv Exp $        */
+/*     $NetBSD: conf.c,v 1.13 2022/06/23 12:32:22 isaki Exp $  */
 
 /*
  * Copyright (c) 2001 Minoura Makoto
@@ -40,8 +40,8 @@
 #include "libx68k.h"
 
 struct devsw devsw[] = {
-       { "sd", sdstrategy, sdopen, sdclose, noioctl },
-       { "cd", cdstrategy, cdopen, cdclose, noioctl },
+       { "sd", sdcdstrategy, sdopen, sdcdclose, noioctl },
+       { "cd", sdcdstrategy, cdopen, sdcdclose, noioctl },
        { "fd", fdstrategy, fdopen, fdclose, noioctl },
        { "nfs", net_strategy, net_open, net_close, net_ioctl },
        { 0, 0, 0, 0, 0 }
diff -r bf4b8afbfadf -r 474fabfaf0f2 sys/arch/x68k/stand/libsa/libx68k.h
--- a/sys/arch/x68k/stand/libsa/libx68k.h       Thu Jun 23 09:58:25 2022 +0000
+++ b/sys/arch/x68k/stand/libsa/libx68k.h       Thu Jun 23 12:32:22 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: libx68k.h,v 1.7 2016/06/26 04:17:17 isaki Exp $        */
+/*     $NetBSD: libx68k.h,v 1.8 2022/06/23 12:32:22 isaki Exp $        */
 
 /*
  * Copyright (c) 2001 Minoura Makoto
@@ -50,13 +50,11 @@
 
 /* sdcd.c */
 struct sd_softc;
-int sdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
 int sdopen(struct open_file *, ...);
-int sdclose(struct open_file *);
+int sdcdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+int sdcdclose(struct open_file *);
 int sd_getbsdpartition(int, int);
-int cdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
 int cdopen(struct open_file *, ...);
-int cdclose(struct open_file *);
 
 /* fd.c */
 int fdstrategy(void *, int, daddr_t, size_t, void *, size_t *);
diff -r bf4b8afbfadf -r 474fabfaf0f2 sys/arch/x68k/stand/libsa/sdcd.c
--- a/sys/arch/x68k/stand/libsa/sdcd.c  Thu Jun 23 09:58:25 2022 +0000
+++ b/sys/arch/x68k/stand/libsa/sdcd.c  Thu Jun 23 12:32:22 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdcd.c,v 1.17 2022/06/21 12:43:57 isaki Exp $  */
+/*     $NetBSD: sdcd.c,v 1.18 2022/06/23 12:32:22 isaki Exp $  */
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -301,7 +301,7 @@
 }
 
 int
-sdclose(struct open_file *f)
+sdcdclose(struct open_file *f)
 {
 
        dealloc(f->f_devdata, sizeof(struct sdcd_softc));
@@ -309,7 +309,7 @@
 }
 
 int
-sdstrategy(void *arg, int rw, daddr_t dblk, size_t size,
+sdcdstrategy(void *arg, int rw, daddr_t dblk, size_t size,
            void *buf, size_t *rsize)
 {
        struct sdcd_softc *sc = arg;
@@ -382,18 +382,3 @@
 
        return 0;
 }
-
-int
-cdclose(struct open_file *f)
-{
-
-       dealloc(f->f_devdata, sizeof(struct sdcd_softc));
-       return 0;
-}
-
-int
-cdstrategy(void *arg, int rw, daddr_t dblk, size_t size,
-           void *buf, size_t *rsize)
-{
-       return sdstrategy(arg, rw, dblk, size, buf, rsize);
-}



Home | Main Index | Thread Index | Old Index