lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180117232840.GA53542@bhelgaas-glaptop.roam.corp.google.com>
Date:   Wed, 17 Jan 2018 17:28:40 -0600
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     poza@...eaurora.org
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>,
        Philippe Ombredanne <pombredanne@...b.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
        Dongdong Liu <liudongdong3@...wei.com>,
        Keith Busch <keith.busch@...el.com>, Wei Zhang <wzhang@...com>,
        Sinan Kaya <okaya@...eaurora.org>,
        Timur Tabi <timur@...eaurora.org>
Subject: Re: [PATCH v4 2/5] PCI/ERR: Rename error reporting to generic pci
 naming

On Wed, Jan 17, 2018 at 02:00:40PM +0530, poza@...eaurora.org wrote:
> On 2018-01-17 13:54, poza@...eaurora.org wrote:
> >On 2018-01-17 06:46, Bjorn Helgaas wrote:
> >>On Tue, Jan 16, 2018 at 03:28:40PM +0530, Oza Pawandeep wrote:
> >>>This patch renames error reporting to generic function with
> >>>pci prefix
> >>>
> >>>Signed-off-by: Oza Pawandeep <poza@...eaurora.org>
> >>>
> >>>diff --git a/drivers/pci/pcie/aer/aerdrv_core.c
> >>>b/drivers/pci/pcie/aer/aerdrv_core.c
> >>>index 4fda843..5ed9575 100644
> >>>--- a/drivers/pci/pcie/aer/aerdrv_core.c
> >>>+++ b/drivers/pci/pcie/aer/aerdrv_core.c
> >>>@@ -285,7 +285,7 @@ static void handle_error_source(struct
> >>>pcie_device *aerdev,
> >>> 			pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS,
> >>> 					info->status);
> >>> 	} else
> >>>-		do_recovery(dev, info->severity);
> >>>+		pci_do_recovery(dev, info->severity);
> >>> }
> >>>
> >>> #ifdef CONFIG_ACPI_APEI_PCIEAER
> >>>@@ -349,7 +349,7 @@ static void aer_recover_work_func(struct
> >>>work_struct *work)
> >>> 			continue;
> >>> 		}
> >>> 		cper_print_aer(pdev, entry.severity, entry.regs);
> >>>-		do_recovery(pdev, entry.severity);
> >>>+		pci_do_recovery(pdev, entry.severity);
> >>> 		pci_dev_put(pdev);
> >>> 	}
> >>> }
> >>>diff --git a/drivers/pci/pcie/pcie-err.c
> >>>b/drivers/pci/pcie/pcie-err.c
> >>>index 76e66bb..5792a9f 100644
> >>>--- a/drivers/pci/pcie/pcie-err.c
> >>>+++ b/drivers/pci/pcie/pcie-err.c
> >>>@@ -20,12 +20,12 @@
> >>> #include <linux/pcieport_if.h>
> >>> #include "portdrv.h"
> >>>
> >>>-struct aer_broadcast_data {
> >>>+struct pci_err_broadcast_data {
> >>> 	enum pci_channel_state state;
> >>> 	enum pci_ers_result result;
> >>> };
> >>>
> >>>-pci_ers_result_t merge_result(enum pci_ers_result orig,
> >>>+pci_ers_result_t pci_merge_result(enum pci_ers_result orig,
> >>
> >>Most of these functions started out static in aerdrv_core.c and should
> >>remain static.  Therefore, they do not need to be renamed.  Same for
> >>the struct aer_broadcast_data.
> 
> ok so in conclusion I should rename only do_recovery. nothing else
> to be renamed.
> and keep the functions static after moving them to pci_err.c.

Functions should always be static whenever possible.

Names of static functions need not contain the subsystem.  It's
sometimes nice if they do, but in this case I think a rename adds
confusion but no real benefit.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ