Re: [PATCH v2] staging: mt7621-mmc: Fix debug macros in dbg.h
On Sat, Aug 18, 2018 at 01:49:23PM +0200, Greg Kroah-Hartman wrote: > On Sat, Aug 18, 2018 at 05:13:17PM +0530, Nishad Kamdar wrote: > > Fixed four debug macros by replacing printk with dev_ > > without __func__ or __LINE__ or current->comm and current->pid. > > Further removed the do {} while(0) loop for single statement > > macro. Issues found by checkpatch. > > > > Signed-off-by: Nishad Kamdar > > --- > > Changes in v2: > > - Replace printk with dev_. > > - Remove __func__, __LINE__, current->comm, current->pid from arguments. > > - Remove the do {} while(0) loop from these macros. > > - Modify commit message to include other changes. > > --- > > drivers/staging/mt7621-mmc/dbg.h | 26 +++--- > > 1 file changed, 7 insertions(+), 19 deletions(-) > > > > diff --git a/drivers/staging/mt7621-mmc/dbg.h > > b/drivers/staging/mt7621-mmc/dbg.h > > index 2f2c56b73987..e8091db3c1d6 100644 > > --- a/drivers/staging/mt7621-mmc/dbg.h > > +++ b/drivers/staging/mt7621-mmc/dbg.h > > @@ -104,19 +104,13 @@ do { \ > > > > #define N_MSG(evt, fmt, args...) > > /* > > -do {\ > > -if ((DBG_EVT_##evt) & sd_debug_zone[host->id]) { \ > > -printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ > > -host->id, ##args , __FUNCTION__, __LINE__, current->comm, > > current->pid); \ > > -} \ > > -} while(0) > > -*/ > > + *if ((DBG_EVT_##evt) & sd_debug_zone[host->id]) { \ > > + *dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args) \ > > + *} > > + */ > > This can just be deleted, just drop it. > > > > > #define ERR_MSG(fmt, args...) \ > > -do { \ > > - printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ > > - host->id, ##args, __FUNCTION__, __LINE__, current->comm, > > current->pid); \ > > -} while (0); > > +dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args) > > No, please just replace all usages of ERR_MSG with dev_err() in the code > itself, and then drop ERR_MSG. No driver/subsystem should have special > macros just for it. > > > #if 1 > > //defined CONFIG_MTK_MMC_CD_POLL > > @@ -124,17 +118,11 @@ do { \ > > #define IRQ_MSG(fmt, args...) > > #else > > #define INIT_MSG(fmt, args...) \ > > -do { \ > > - printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ > > - host->id, ##args, __FUNCTION__, __LINE__, current->comm, > > current->pid); \ > > -} while (0); > > +dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args) > > Same here. Actually I bet all INIT_MSG can just be removed :) > > > > > /* PID in ISR in not corrent */ > > #define IRQ_MSG(fmt, args...) \ > > -do { \ > > - printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n", \ > > - host->id, ##args, __FUNCTION__, __LINE__); \ > > -} while (0); > > +dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args) > > Same here, just replace the usage of these macros with the real thing. > > thanks, > > greg k-h Ok, I will make the changes in the next version. thanks for the review. regards, nishad ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging: mt7621-mmc: Fix debug macros and their usages
Fixed four debug macros and their usages. Replaced printk with dev_ without __func__ or __LINE__ or current->comm and current->pid. Further removed the do {} while(0) loop for single statement macros. Out of the four, replaced all usages of ERR_MSG and IRQ_MSG with dev_err() in the code itself and dropped them from dbg.h. Removed all INIT_MSG usages and dropped it from dgb.h. Issues found by checkpatch. Signed-off-by: Nishad Kamdar --- Changes in v3: - Replace usages of ERR_MSG and IRQ_MSG with dev_err() in code itself. - Remove all INIT_MSG usages. - Drop ERR_MSG, INIT_MSG and IRQ_MSG from dbg.h. Changes in v2: - Replace printk with dev_. - Remove __func__, __LINE__, current->comm, current->pid from arguments. - Remove the do {} while(0) loop from these macros. - Modify commit message to include other changes. --- drivers/staging/mt7621-mmc/dbg.h | 36 +-- drivers/staging/mt7621-mmc/sd.c | 180 --- 2 files changed, 121 insertions(+), 95 deletions(-) diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc/dbg.h index 2f2c56b73987..5458dae5dc03 100644 --- a/drivers/staging/mt7621-mmc/dbg.h +++ b/drivers/staging/mt7621-mmc/dbg.h @@ -104,38 +104,10 @@ do { \ #define N_MSG(evt, fmt, args...) /* -do {\ -if ((DBG_EVT_##evt) & sd_debug_zone[host->id]) { \ -printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ -host->id, ##args , __FUNCTION__, __LINE__, current->comm, current->pid); \ -} \ -} while(0) -*/ - -#define ERR_MSG(fmt, args...) \ -do { \ - printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ - host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ -} while (0); - -#if 1 -//defined CONFIG_MTK_MMC_CD_POLL -#define INIT_MSG(fmt, args...) -#define IRQ_MSG(fmt, args...) -#else -#define INIT_MSG(fmt, args...) \ -do { \ - printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \ - host->id, ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \ -} while (0); - -/* PID in ISR in not corrent */ -#define IRQ_MSG(fmt, args...) \ -do { \ - printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n", \ - host->id, ##args, __FUNCTION__, __LINE__); \ -} while (0); -#endif + *if ((DBG_EVT_##evt) & sd_debug_zone[host->id]) { \ + *dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args) \ + *} + */ void msdc_debug_proc_init(void); diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c index 04d23cc7cd4a..5cb6bc36e78b 100644 --- a/drivers/staging/mt7621-mmc/sd.c +++ b/drivers/staging/mt7621-mmc/sd.c @@ -187,12 +187,10 @@ static u32 hclks[] = {5000}; /* +/- by chhung */ // #define msdc_vcore_on(host) \ do {\ - INIT_MSG("[+]VMC ref. count<%d>", ++host->pwr_ref); \ (void)hwPowerOn(MT65XX_POWER_LDO_VMC, VOL_3300, "SD"); \ } while (0) #define msdc_vcore_off(host) \ do {\ - INIT_MSG("[-]VMC ref. count<%d>", --host->pwr_ref); \ (void)hwPowerDown(MT65XX_POWER_LDO_VMC, "SD"); \ } while (0) @@ -422,7 +420,9 @@ static void msdc_tasklet_card(struct work_struct *work) mmc_detect_change(host->mmc, msecs_to_jiffies(20)); } - IRQ_MSG("card found<%s>", inserted ? "inserted" : "removed"); + dev_err(mmc_dev(host->mmc), + "%d -> card found<%s>\n", + host->id, inserted ? "inserted" : "removed"); #endif spin_unlock(&host->lock); @@ -439,7 +439,6 @@ static void msdc_select_clksrc(struct msdc_host *host, unsigned char clksrc) u32 val; BUG_ON(clksrc > 3); - INIT_MSG("set clock source to <%d>", clksrc); val = readl(host->base + MSDC_CLKSRC_REG); if (readl(host->base + MSDC_ECO_VER) >= 4) { @@ -466,7 +465,8 @@ static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz) //u8 clksrc = hw->clk_src; if (!hz) { // set mmc system clock to 0 ? - //ERR_MSG("set mclk to 0!!!"); + //dev_err(mmc_dev(host->mmc), "%d -> set mclk to 0!!!\n", + //host->id); msdc_reset_hw(host); return; } @@ -509,10 +509,6 @@ static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz) host->mclk = hz; msdc_set_timeout(host, host->timeout_ns, host->timeout_clks); // need? - INIT_MSG(""); - INIT_MSG("!!! Set<%dKHz> Source<%dKHz> -> sclk<%dKHz>", hz / 1000, hclk / 1000, sclk / 1000); - INIT_MSG(""); - msdc_irq_restore(flags); } @@ -521,7 +517,7 @@ static void msdc_abort_data(struct msdc_host *ho
Re: [PATCH 01/23] mtd: rawnand: plat_nand: Pass a nand_chip object to all platform_nand_ctrl hooks
Hello! On 17/08/18 18:09, Boris Brezillon wrote: Let's make the raw NAND API consistent by patching all helpers and hooks to take a nand_chip object instead of an mtd_info one or remove the mtd_info object when both are passed. In order to do that, we first need to update the platform_nand_ctrl hooks to take a nand_chip object instead of an mtd_info. We had temporary plat_nand_xxx() wrappers to the do the mtd -> chip conversion, but those will be dropped when doing the patching nand_chip hooks to take a nand_chip object. Signed-off-by: Boris Brezillon Reviewed-by: Alexander Sverdlin For the EP93xx parts: Acked-by: Alexander Sverdlin --- arch/arm/mach-ep93xx/snappercl15.c | 7 ++-- arch/arm/mach-ep93xx/ts72xx.c | 7 ++-- arch/arm/mach-imx/mach-qong.c | 11 +++ arch/arm/mach-ixp4xx/ixdp425-setup.c| 3 +- arch/arm/mach-omap1/board-fsample.c | 2 +- arch/arm/mach-omap1/board-h2.c | 2 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-nand.c| 3 +- arch/arm/mach-omap1/board-perseus2.c| 2 +- arch/arm/mach-omap1/common.h| 2 +- arch/arm/mach-orion5x/ts78xx-setup.c| 18 --- arch/arm/mach-pxa/balloon3.c| 8 ++--- arch/arm/mach-pxa/em-x270.c | 5 ++- arch/arm/mach-pxa/palmtx.c | 5 ++- arch/mips/alchemy/devboards/db1200.c| 5 ++- arch/mips/alchemy/devboards/db1300.c| 5 ++- arch/mips/alchemy/devboards/db1550.c| 5 ++- arch/mips/netlogic/xlr/platform-flash.c | 4 +-- arch/mips/pnx833x/common/platform.c | 3 +- arch/mips/rb532/devices.c | 5 ++- arch/sh/boards/mach-migor/setup.c | 6 ++-- drivers/mtd/nand/raw/plat_nand.c| 57 ++--- include/linux/mtd/rawnand.h | 10 +++--- 23 files changed, 101 insertions(+), 76 deletions(-) diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c index 45940c1d7787..aa03ea79c5f5 100644 --- a/arch/arm/mach-ep93xx/snappercl15.c +++ b/arch/arm/mach-ep93xx/snappercl15.c @@ -45,10 +45,9 @@ #define NAND_CTRL_ADDR(chip) (chip->IO_ADDR_W + 0x40) -static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, +static void snappercl15_nand_cmd_ctrl(struct nand_chip *chip, int cmd, unsigned int ctrl) { - struct nand_chip *chip = mtd_to_nand(mtd); static u16 nand_state = SNAPPERCL15_NAND_WPN; u16 set; @@ -73,10 +72,8 @@ static void snappercl15_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, __raw_writew((cmd & 0xff) | nand_state, chip->IO_ADDR_W); } -static int snappercl15_nand_dev_ready(struct mtd_info *mtd) +static int snappercl15_nand_dev_ready(struct nand_chip *chip) { - struct nand_chip *chip = mtd_to_nand(mtd); - return !!(__raw_readw(NAND_CTRL_ADDR(chip)) & SNAPPERCL15_NAND_RDY); } diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index c089a2a4fe30..26259dd9e951 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -76,11 +76,9 @@ static void __init ts72xx_map_io(void) #define TS72XX_NAND_CONTROL_ADDR_LINE 22 /* 0xN040 */ #define TS72XX_NAND_BUSY_ADDR_LINE23 /* 0xN080 */ -static void ts72xx_nand_hwcontrol(struct mtd_info *mtd, +static void ts72xx_nand_hwcontrol(struct nand_chip *chip, int cmd, unsigned int ctrl) { - struct nand_chip *chip = mtd_to_nand(mtd); - if (ctrl & NAND_CTRL_CHANGE) { void __iomem *addr = chip->IO_ADDR_R; unsigned char bits; @@ -99,9 +97,8 @@ static void ts72xx_nand_hwcontrol(struct mtd_info *mtd, __raw_writeb(cmd, chip->IO_ADDR_W); } -static int ts72xx_nand_device_ready(struct mtd_info *mtd) +static int ts72xx_nand_device_ready(struct nand_chip *chip) { - struct nand_chip *chip = mtd_to_nand(mtd); void __iomem *addr = chip->IO_ADDR_R; addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE); diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c index 42a700053103..ff015f603ac9 100644 --- a/arch/arm/mach-imx/mach-qong.c +++ b/arch/arm/mach-imx/mach-qong.c @@ -129,10 +129,9 @@ static void qong_init_nor_mtd(void) /* * Hardware specific access to control-lines */ -static void qong_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) +static void qong_nand_cmd_ctrl(struct nand_chip *nand_chip, int cmd, + unsigned int ctrl) { - struct nand_chip *nand_chip = mtd_to_nand(mtd); - if (cmd == NAND_CMD_NONE) return; @@ -145,14 +144,14 @@ static void qong_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) /* * Read the Device Ready pin. */ -static int qong_nand_device_ready(struct mtd_info *mtd) +static int qong_nand_device_ready
Re: [PATCH 08/23] mtd: rawnand: Pass a nand_chip object to ecc->read_xxx() hooks
Hi Stefan, On Sat, 18 Aug 2018 10:30:13 +0200 Stefan Agner wrote: > > diff --git a/drivers/mtd/nand/raw/tegra_nand.c > > b/drivers/mtd/nand/raw/tegra_nand.c > > index 5dcee20e2a8c..bcc3a2888c4f 100644 > > --- a/drivers/mtd/nand/raw/tegra_nand.c > > +++ b/drivers/mtd/nand/raw/tegra_nand.c > > @@ -615,10 +615,10 @@ static int tegra_nand_page_xfer(struct mtd_info > > *mtd, struct nand_chip *chip, > > return ret; > > } > > > > -static int tegra_nand_read_page_raw(struct mtd_info *mtd, > > - struct nand_chip *chip, u8 *buf, > > +static int tegra_nand_read_page_raw(struct nand_chip *chip, u8 *buf, > > int oob_required, int page) > > { > > + struct mtd_info *mtd = nand_to_mtd(chip); > > void *oob_buf = oob_required ? chip->oob_poi : NULL; > > > > return tegra_nand_page_xfer(mtd, chip, buf, oob_buf, > > Since mtd is only required to pass it to tegra_nand_page_xfer, it would > be better to change tegra_nand_page_xfer to only take chip. For sure, but that's the sort of cleanups I'll leave to NAND controller driver maintainers (in this case you ;-)). I only take care of the NAND API here and try to make things as simple as possible to ease review and avoid breaking drivers. Regards, Boris ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: mt7621-mmc: Fix debug macros and their usages
On Sun, Aug 19, 2018 at 03:35:02PM +0530, Nishad Kamdar wrote: > Fixed four debug macros and their usages. Replaced printk with > dev_ without __func__ or __LINE__ or current->comm and > current->pid. Further removed the do {} while(0) loop for single > statement macros. > Out of the four, replaced all usages of ERR_MSG and IRQ_MSG with > dev_err() in the code itself and dropped them from dbg.h. > Removed all INIT_MSG usages and dropped it from dgb.h. > Issues found by checkpatch. This needs to be multiple patches. One for each type of macro you are deleting/changing, not all lumped together into one big patch. Plaese fix that up and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: sm750fb: sm750: add SPDX-License-Identifier
Adding missing SPDX-License-Identifier Signed-off-by: Jannis Nawroth --- drivers/staging/sm750fb/sm750.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 846d7d243994..f2a969fcc913 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: fsl-dpaa2: ethsw: dpsw: Use correct SPDX-License-Identifier comment
Use correct comment for SPDX-License-Identifier Signed-off-by: Jannis Nawroth --- drivers/staging/fsl-dpaa2/ethsw/dpsw.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethsw/dpsw.h b/drivers/staging/fsl-dpaa2/ethsw/dpsw.h index db43fa3782b8..95feb7ffd575 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/dpsw.h +++ b/drivers/staging/fsl-dpaa2/ethsw/dpsw.h @@ -1,5 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0 -/* +/* SPDX-License-Identifier: GPL-2.0 * Copyright 2014-2016 Freescale Semiconductor Inc. * Copyright 2017-2018 NXP * -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: Removed unneeded variable
This patch removed unneeded variable named ret because this variable is used only to return 0. Signed-off-by: Bhaskar Singh --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index bee3c3a7a7a9..4801345a2b57 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -1370,7 +1370,7 @@ static int rtw_wx_get_essid(struct net_device *dev, struct iw_request_info *a, union iwreq_data *wrqu, char *extra) { - u32 len, ret = 0; + u32 len; struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; @@ -1388,7 +1388,7 @@ static int rtw_wx_get_essid(struct net_device *dev, wrqu->essid.length = len; wrqu->essid.flags = 1; - return ret; + return 0; } static int rtw_wx_set_rate(struct net_device *dev, -- 2.16.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 00/20] staging: mt7621-pci: Parse ports info from DT and other minor cleanups
On Sun, Aug 12 2018, Sergio Paracuellos wrote: > This patch series parse remaining port info from device tree storing > it in mt7621_pcie_port struct created for this. > > Also minor cleanups are performed here: > - Remove not used macros. > - Use kernel reset_control functions. > - Remove unused code. > > Changes in v2: > - Rewrite phy part of the driver > - fix some checkpatch complains > - make use of sysctl from DT > > Hope this helps. Unfortunately commit f8c55dc6e828324fc58c0bb32d72a5a4041d1c3b broke DMA on the mt7621, so I cannot test anything since then. I apply these patches onto 4cafd03a916e2f7c15520fed0b7894cf25f4ecc5 and get [0.57] mt7621-pci 1e14.pcie: missing "reg" property [0.58] mt7621-pci 1e14.pcie: Parsing DT failed [0.59] mt7621-pci: probe of 1e14.pcie failed with error -22 and no working PCI. Thanks, NeilBrown > > Best regards, > Sergio Paracuellos > > Sergio Paracuellos (20): > staging: mt7621-pci: parse and init port data from device tree > staging: mt7621-pci: replace return value if > devm_pci_alloc_host_bridge call fails > staging: mt7621-pci: add two helpers for read and write pcie register > ports > staging: mt7621-pci: factor out 'mt7621_pcie_enable_port' function > staging: mt7621-pci: remove [ASSERT|DEASSERT]_SYSRST_PCIE macros > staging: mt7621-pci: remove GPL2+ text from license header > staging: mt7621-pci: remove two commented code lines > staging: mt7621-pci: remove reset related unused macros > staging: mt7621-pci: reagroup reset related macros all together > staging: mt7621-pci: make some function static > staging: mt7621-pci: show N_FTS status using a loop > staging: mt7621-pci: rewrite pcie phy related functions > staging: mt7621-pci: factor out 'mt7621_enable_phy' function > staging: mt7621-pci: debug port N_FTS inside 'mt7621_pcie_enable_port' > staging: mt7621-pci: rename 'mt7621_pcie_enable_port' into > 'mt7621_pcie_init_port' > staging: mt7621-dts: add sysctl registers base address to pcie > staging: mt7621-pci: remap and use sysctl from device tree > staging: mt7621-pci: use a trailing */ on a separate line > staging: mt7621-pci: use dev_* functions instead of printk > staging: mt7621-pci: do not initialise statics to 0 > > drivers/staging/mt7621-dts/mt7621.dtsi | 4 +- > drivers/staging/mt7621-pci/pci-mt7621.c | 600 > > 2 files changed, 381 insertions(+), 223 deletions(-) > > -- > 2.7.4 signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel