All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Krzysztof Wilczyński" <kw@linux.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Subject: [PATCH 2/2] PCI: syscall: Change type of err variable from long to int
Date: Thu, 29 Jul 2021 23:37:55 +0000	[thread overview]
Message-ID: <20210729233755.1509616-2-kw@linux.com> (raw)
In-Reply-To: <20210729233755.1509616-1-kw@linux.com>

The pciconfig_read syscall uses an err variable is currently declared as
long and even though it matches the function signature as generated by
the SYSCALL_DEFINEx() macro is a bit wasteful as the syscall returns
a handful of simple error codes.

Thus, change the err value type from long to int to lower the storage
requirements and also align it with the pciconfig_write syscall.

Related:
  commit ef9e4005cbaf ("PCI: Align checking of syscall user config accessors")

Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
 drivers/pci/syscall.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index b842af1e06b8..525f16caed1d 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -19,8 +19,7 @@ SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
 	u8 byte;
 	u16 word;
 	u32 dword;
-	long err;
-	int cfg_ret;
+	int err, cfg_ret;
 
 	err = -EPERM;
 	if (!capable(CAP_SYS_ADMIN))
-- 
2.32.0


  reply	other threads:[~2021-07-29 23:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 23:37 [PATCH 1/2] PCI: syscall: Set the ~0 value on access failure Krzysztof Wilczyński
2021-07-29 23:37 ` Krzysztof Wilczyński [this message]
2021-07-30 21:06   ` [PATCH 2/2] PCI: syscall: Change type of err variable from long to int Bjorn Helgaas

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=20210729233755.1509616-2-kw@linux.com \
    --to=kw@linux.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.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.