Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usb gadgetfs EFAULT error bugfix #299

Closed
wants to merge 1 commit into from
Closed

Conversation

oandrew
Copy link

@oandrew oandrew commented Jun 22, 2016

copy_to_iter() returns number of bytes copied

@oandrew oandrew closed this Jun 22, 2016
metux added a commit to metux/linux that referenced this pull request Apr 27, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Apr 29, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Apr 30, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Apr 30, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Jun 12, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Jun 27, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Jul 10, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Jul 11, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Jul 31, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Jul 31, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Aug 20, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Nov 21, 2019
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
metux added a commit to metux/linux that referenced this pull request Jan 10, 2020
Fix checkpatch errors:

    ERROR: else should follow close brace '}'
    torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121:
    +	}
    +	else

    WARNING: line over 80 characters
    torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150:
    +					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,

    WARNING: Block comments should align the * on each line
    torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66:
    + * Check, if transmit buffers are processed
    +*/

    WARNING: braces {} are not necessary for any arm of this statement
    torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170:
    +		if (IS_SMC(pinfo)) {
    [...]
    +		} else {
    [...]

    WARNING: labels should not be indented
    torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292:
    +		      error_return:

    ERROR: code indent should use tabs where possible
    torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299:
    +^I^I                        BD_SC_OV | BD_SC_ID);$

    WARNING: labels should not be indented
    torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319:
    +      handle_error:

    WARNING: line over 80 characters
    torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423:
    +		setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));

    ERROR: space required before the open parenthesis '('
    torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451:
    +		while(!cpm_uart_tx_empty(port)) {

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);

    WARNING: line over 80 characters
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: code indent should use tabs where possible
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    WARNING: please, no spaces at the start of a line
    torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484:
    +                                 struct ktermios *termios,$

    ERROR: code indent should use tabs where possible
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: please, no spaces at the start of a line
    torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485:
    +                                 struct ktermios *old)$

    WARNING: line over 80 characters
    torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624:
    +		/* Output in *one* operation, so we don't interrupt RX/TX if they

    WARNING: Block comments use a trailing */ on a separate line
    torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625:
    +		 * were already enabled. */

    WARNING: line over 80 characters
    torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629:
    +		out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);

    WARNING: line over 80 characters
    torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773:
    +	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);

    ERROR: code indent should use tabs where possible
    torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836:
    +^I         SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$

    ERROR: code indent should use tabs where possible
    torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859:
    +^I         (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$

    ERROR: code indent should use tabs where possible
    torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861:
    +^I         (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$

    WARNING: space prohibited between function name and open parenthesis '('
    torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866:
    +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)

    WARNING: line over 80 characters
    torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    WARNING: Missing a blank line after declarations
    torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462:
    +			smc_t __iomem *smcp = pinfo->smcp;
    +			clrbits16(&smcp->smc_smcmr,

    WARNING: Missing a blank line after declarations
    torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467:
    +			scc_t __iomem *sccp = pinfo->sccp;
    +			clrbits32(&sccp->scc_gsmrl,

    ERROR: code indent should use tabs where possible
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    #1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151:
    +                              struct uart_cpm_port *pinfo)$

    ERROR: "(foo*)" should be "(foo *)"
    #1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161:
    +		struct clk *clk = clk_get(NULL, (const char*)data);

    WARNING: Missing a blank line after declarations
    #1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162:
    +		struct clk *clk = clk_get(NULL, (const char*)data);
    +		if (!IS_ERR(clk))

    ERROR: code indent should use tabs where possible
    #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169:
    +^I^I^I                "fsl,cpm-brg property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178:
    +^I^I                "fsl,cpm-command property.\n", np);$

    ERROR: code indent should use tabs where possible
    #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192:

    WARNING: braces {} are not necessary for any arm of this statement
    #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: braces {} are not necessary for any arm of this statement
    #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287:
    +	if (unlikely(nolock)) {
    [...]
    +	} else {
    [...]

    WARNING: line over 80 characters
    #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354:
    +		clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);

    ERROR: Macros with complex values should be enclosed in parentheses
    #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394:
    +#define CPM_UART_CONSOLE	&cpm_scc_uart_console

    WARNING: Missing a blank line after declarations
    #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437:
    +	struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
    +	return uart_remove_one_port(&cpm_reg, &pinfo->port);

    WARNING: please, no spaces at the start of a line
    #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464:
    + };$

    WARNING: Missing a blank line after declarations
    #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469:
    +	int ret = uart_register_driver(&cpm_reg);
    +	if (ret)

    WARNING: Missing a blank line after declarations
    #1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062:
    +	int		i;
    +	volatile cbd_t	*bdp;

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19:
    +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)

    ERROR: "foo * bar" should be "foo *bar"
    torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25:
    +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)

    WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1:
    +// SPDX-License-Identifier: GPL-2.0

    WARNING: Block comments use * on subsequent lines
    torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106:
    +/*
    +   virtual to phys transtalion

    ERROR: code indent should use tabs where possible
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109:
    +                                         struct uart_cpm_port *pinfo)$

    ERROR: code indent should use tabs where possible
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

    WARNING: please, no spaces at the start of a line
    torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125:
    +                                 struct uart_cpm_port *pinfo)$

Signed-off-by: Enrico Weigelt <info@metux.net>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ruscur pushed a commit to ruscur/linux that referenced this pull request Dec 16, 2020
At the time being, PPC32 has Classical BPF support.

The test_bpf module exhibits some failure:

	test_bpf: torvalds#298 LD_IND byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#299 LD_IND halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#301 LD_IND halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)
	test_bpf: torvalds#303 LD_ABS byte frag jited:1 ret 202 != 66 FAIL (1 times)
	test_bpf: torvalds#304 LD_ABS halfword frag jited:1 ret 51958 != 17220 FAIL (1 times)
	test_bpf: torvalds#306 LD_ABS halfword mixed head/frag jited:1 ret 51958 != 1305 FAIL (1 times)

	test_bpf: Summary: 371 PASSED, 7 FAILED, [119/366 JIT'ed]

Fixing this is not worth the effort. Instead, remove support for
classical BPF and prepare for adding Extended BPF support instead.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 25, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 26, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 26, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this pull request Nov 26, 2022
commit 1b5f1c3 upstream.

In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
zhijianli88 pushed a commit to zhijianli88/linux that referenced this pull request Dec 6, 2022
In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
atishp04 pushed a commit to atishp04/linux that referenced this pull request Dec 9, 2022
In register_synth_event(), if set_synth_event_print_fmt() failed, then
both trace_remove_event_call() and unregister_trace_event() will be
called, which means the trace_event_call will call
__unregister_trace_event() twice. As the result, the second unregister
will causes the wild-memory-access.

register_synth_event
    set_synth_event_print_fmt failed
    trace_remove_event_call
        event_remove
            if call->event.funcs then
            __unregister_trace_event (first call)
    unregister_trace_event
        __unregister_trace_event (second call)

Fix the bug by avoiding to call the second __unregister_trace_event() by
checking if the first one is called.

general protection fault, probably for non-canonical address
	0xfbd59c0000000024: 0000 [#1] SMP KASAN PTI
KASAN: maybe wild-memory-access in range
[0xdead000000000120-0xdead000000000127]
CPU: 0 PID: 3807 Comm: modprobe Not tainted
6.1.0-rc1-00186-g76f33a7eedb4 torvalds#299
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
RIP: 0010:unregister_trace_event+0x6e/0x280
Code: 00 fc ff df 4c 89 ea 48 c1 ea 03 80 3c 02 00 0f 85 0e 02 00 00 48
b8 00 00 00 00 00 fc ff df 4c 8b 63 08 4c 89 e2 48 c1 ea 03 <80> 3c 02
00 0f 85 e2 01 00 00 49 89 2c 24 48 85 ed 74 28 e8 7a 9b
RSP: 0018:ffff88810413f370 EFLAGS: 00010a06
RAX: dffffc0000000000 RBX: ffff888105d050b0 RCX: 0000000000000000
RDX: 1bd5a00000000024 RSI: ffff888119e276e0 RDI: ffffffff835a8b20
RBP: dead000000000100 R08: 0000000000000000 R09: fffffbfff0913481
R10: ffffffff8489a407 R11: fffffbfff0913480 R12: dead000000000122
R13: ffff888105d050b8 R14: 0000000000000000 R15: ffff888105d05028
FS:  00007f7823e8d540(0000) GS:ffff888119e00000(0000)
knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7823e7ebec CR3: 000000010a058002 CR4: 0000000000330ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __create_synth_event+0x1e37/0x1eb0
 create_or_delete_synth_event+0x110/0x250
 synth_event_run_command+0x2f/0x110
 test_gen_synth_cmd+0x170/0x2eb [synth_event_gen_test]
 synth_event_gen_test_init+0x76/0x9bc [synth_event_gen_test]
 do_one_initcall+0xdb/0x480
 do_init_module+0x1cf/0x680
 load_module+0x6a50/0x70a0
 __do_sys_finit_module+0x12f/0x1c0
 do_syscall_64+0x3f/0x90
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Link: https://lkml.kernel.org/r/20221117012346.22647-3-shangxiaojing@huawei.com

Fixes: 4b14793 ("tracing: Add support for 'synthetic' events")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: <zanussi@kernel.org>
Cc: <fengguang.wu@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant