All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org, wl@xen.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 13/18] mini-os: eliminate tpmtis union member in struct file
Date: Tue, 11 Jan 2022 15:58:12 +0100	[thread overview]
Message-ID: <20220111145817.22170-14-jgross@suse.com> (raw)
In-Reply-To: <20220111145817.22170-1-jgross@suse.com>

Replace the tpmtis specific union member in struct file with the
common dev pointer.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 include/lib.h | 5 -----
 lib/sys.c     | 2 +-
 tpm_tis.c     | 8 ++++----
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/include/lib.h b/include/lib.h
index 2ddc076..d6a29ba 100644
--- a/include/lib.h
+++ b/include/lib.h
@@ -193,11 +193,6 @@ struct file {
 	    struct evtchn_port_list ports;
 	} evtchn;
 	struct gntmap gntmap;
-#ifdef CONFIG_TPM_TIS
-	struct {
-	   struct tpm_chip *dev;
-	} tpm_tis;
-#endif
 #ifdef CONFIG_XENBUS
         struct {
             /* To each xenbus FD is associated a queue of watch events for this
diff --git a/lib/sys.c b/lib/sys.c
index b042bf5..96fc769 100644
--- a/lib/sys.c
+++ b/lib/sys.c
@@ -468,7 +468,7 @@ int close(int fd)
 #endif
 #ifdef CONFIG_TPM_TIS
 	case FTYPE_TPM_TIS:
-            shutdown_tpm_tis(files[fd].tpm_tis.dev);
+            shutdown_tpm_tis(files[fd].dev);
 	    files[fd].type = FTYPE_NONE;
 	    return 0;
 #endif
diff --git a/tpm_tis.c b/tpm_tis.c
index 4127118..477f555 100644
--- a/tpm_tis.c
+++ b/tpm_tis.c
@@ -1288,14 +1288,14 @@ int tpm_tis_open(struct tpm_chip* tpm)
 
    tpm->fd = alloc_fd(FTYPE_TPM_TIS);
    printk("tpm_tis_open() -> %d\n", tpm->fd);
-   files[tpm->fd].tpm_tis.dev = tpm;
+   files[tpm->fd].dev = tpm;
    return tpm->fd;
 }
 
 int tpm_tis_posix_write(int fd, const uint8_t* buf, size_t count)
 {
    struct tpm_chip* tpm;
-   tpm = files[fd].tpm_tis.dev;
+   tpm = files[fd].dev;
 
    if(tpm->locality < 0) {
       printk("tpm_tis_posix_write() failed! locality not set!\n");
@@ -1323,7 +1323,7 @@ int tpm_tis_posix_read(int fd, uint8_t* buf, size_t count)
 {
    int rc;
    struct tpm_chip* tpm;
-   tpm = files[fd].tpm_tis.dev;
+   tpm = files[fd].dev;
 
    if(count == 0) {
       return 0;
@@ -1350,7 +1350,7 @@ int tpm_tis_posix_read(int fd, uint8_t* buf, size_t count)
 int tpm_tis_posix_fstat(int fd, struct stat* buf)
 {
    struct tpm_chip* tpm;
-   tpm = files[fd].tpm_tis.dev;
+   tpm = files[fd].dev;
 
    buf->st_mode = O_RDWR;
    buf->st_uid = 0;
-- 
2.26.2



  parent reply	other threads:[~2022-01-11 15:09 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 14:57 [PATCH v2 00/18] mini-os: remove struct file dependency on config Juergen Gross
2022-01-11 14:58 ` [PATCH v2 01/18] mini-os: split struct file definition from its usage Juergen Gross
2022-01-11 14:58 ` [PATCH v2 02/18] mini-os: makes file.read bool and move it ahead of device specific part Juergen Gross
2022-01-11 14:58 ` [PATCH v2 03/18] mini-os: make offset a common struct file member for all types Juergen Gross
2022-01-11 14:58 ` [PATCH v2 04/18] mini-os: replace multiple fd elements in struct file by common one Juergen Gross
2022-01-11 14:58 ` [PATCH v2 05/18] mini-os: introduce a common dev pointer in struct file Juergen Gross
2022-01-11 14:58 ` [PATCH v2 06/18] mini-os: eliminate blkfront union member " Juergen Gross
2022-01-11 14:58 ` [PATCH v2 07/18] mini-os: eliminate consfront " Juergen Gross
2022-01-11 14:58 ` [PATCH v2 08/18] mini-os: eliminate fbfront " Juergen Gross
2022-01-11 14:58 ` [PATCH v2 09/18] mini-os: eliminate kbdfront " Juergen Gross
2022-01-11 14:58 ` [PATCH v2 10/18] mini-os: eliminate netfront " Juergen Gross
2022-01-11 14:58 ` [PATCH v2 11/18] mini-os: move tpm respgot member of struct file to device specific data Juergen Gross
2022-01-11 14:58 ` [PATCH v2 12/18] mini-os: eliminate tpmfront union member in struct file Juergen Gross
2022-01-11 14:58 ` Juergen Gross [this message]
2022-01-11 14:58 ` [PATCH v2 14/18] mini-os: eliminate xenbus " Juergen Gross
2022-01-11 14:58 ` [PATCH v2 15/18] mini-os: introduce get_file_from_fd() Juergen Gross
2022-01-11 18:17   ` Andrew Cooper
2022-01-12  7:36     ` Juergen Gross
2022-01-11 14:58 ` [PATCH v2 16/18] mini-os: reset file type in close() in one place only Juergen Gross
2022-01-11 15:28   ` Samuel Thibault
2022-01-11 18:11   ` Andrew Cooper
2022-01-12  7:35     ` Juergen Gross
2022-01-11 19:14   ` Andrew Cooper
2022-01-12  7:39     ` Juergen Gross
2022-01-11 14:58 ` [PATCH v2 17/18] mini-os: use function vectors instead of switch for file operations Juergen Gross
2022-01-11 18:08   ` Andrew Cooper
2022-01-11 19:39     ` Samuel Thibault
2022-01-12  7:34     ` Juergen Gross
2022-01-12  8:19       ` Andrew Cooper
2022-01-12  8:22         ` Juergen Gross
2022-01-11 19:58   ` Samuel Thibault
2022-01-11 20:05   ` Samuel Thibault
2022-01-11 20:42     ` Samuel Thibault
2022-01-12  7:42     ` Juergen Gross
2022-01-11 20:10   ` Samuel Thibault
2022-01-11 14:58 ` [PATCH v2 18/18] mini-os: remove file type FTYPE_XC Juergen Gross
2022-01-11 18:19   ` Andrew Cooper
2022-01-12  7:37     ` Juergen Gross
2022-01-11 19:42 ` [PATCH v2 00/18] mini-os: remove struct file dependency on config Andrew Cooper
2022-01-12  7:40   ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220111145817.22170-14-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=minios-devel@lists.xenproject.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.