Re: [PATCH 2/2] PCI: syscall: Change type of err variable from long to int

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

 



On Thu, Jul 29, 2021 at 11:37:55PM +0000, Krzysztof Wilczyński wrote:
> 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@xxxxxxxxx>

Applied both to pci/enumeration for v5.15, thanks!

> ---
>  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
> 



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux