[PATCH linux-next] macintosh/windfarm: fix comparing pointer to 0

2022-09-18 Thread cgel . zte
From: Xu Panda 

Comparing pointer whith NULL instead of comparing pointer to 0.

Reported-by: Zeal Robot 
Signed-off-by: Xu Panda 
---
 drivers/macintosh/windfarm_pm121.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/macintosh/windfarm_pm121.c 
b/drivers/macintosh/windfarm_pm121.c
index 36312f163aac..82dcd35f439a 100644
--- a/drivers/macintosh/windfarm_pm121.c
+++ b/drivers/macintosh/windfarm_pm121.c
@@ -651,7 +651,7 @@ static void pm121_create_cpu_fans(void)

/* First, locate the PID params in SMU SBD */
hdr = smu_get_sdb_partition(SMU_SDB_CPUPIDDATA_ID, NULL);
-   if (hdr == 0) {
+   if (hdr == NULL) {
printk(KERN_WARNING "pm121: CPU PID fan config not found.\n");
goto fail;
}
@@ -970,7 +970,7 @@ static int pm121_init_pm(void)
const struct smu_sdbp_header *hdr;

hdr = smu_get_sdb_partition(SMU_SDB_SENSORTREE_ID, NULL);
-   if (hdr != 0) {
+   if (hdr != NULL) {
struct smu_sdbp_sensortree *st =
(struct smu_sdbp_sensortree *)[1];
pm121_mach_model = st->model_id;
-- 
2.15.2



[PATCH linux-next] ocxl: Remove the unneeded result variable

2022-09-06 Thread cgel . zte
From: ye xingchen 

Return the value opal_npu_spa_clear_cache() directly instead of storing
it in another redundant variable.

Reported-by: Zeal Robot 
Signed-off-by: ye xingchen 
---
 arch/powerpc/platforms/powernv/ocxl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/ocxl.c 
b/arch/powerpc/platforms/powernv/ocxl.c
index 27c936075031..629067781cec 100644
--- a/arch/powerpc/platforms/powernv/ocxl.c
+++ b/arch/powerpc/platforms/powernv/ocxl.c
@@ -478,10 +478,8 @@ EXPORT_SYMBOL_GPL(pnv_ocxl_spa_release);
 int pnv_ocxl_spa_remove_pe_from_cache(void *platform_data, int pe_handle)
 {
struct spa_data *data = (struct spa_data *) platform_data;
-   int rc;
 
-   rc = opal_npu_spa_clear_cache(data->phb_opal_id, data->bdfn, pe_handle);
-   return rc;
+   return opal_npu_spa_clear_cache(data->phb_opal_id, data->bdfn, 
pe_handle);
 }
 EXPORT_SYMBOL_GPL(pnv_ocxl_spa_remove_pe_from_cache);
 
-- 
2.25.1


[PATCH linux-next] crypto: nx - Remove the unneeded result variable

2022-09-02 Thread cgel . zte
From: ye xingchen 

Return the value set_msg_len() directly instead of storing it in another
redundant variable.

Reported-by: Zeal Robot 
Signed-off-by: ye xingchen 
---
 drivers/crypto/nx/nx-aes-ccm.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/nx/nx-aes-ccm.c b/drivers/crypto/nx/nx-aes-ccm.c
index 3793885f928d..c843f4c6f684 100644
--- a/drivers/crypto/nx/nx-aes-ccm.c
+++ b/drivers/crypto/nx/nx-aes-ccm.c
@@ -134,7 +134,6 @@ static int generate_b0(u8 *iv, unsigned int assoclen, 
unsigned int authsize,
   unsigned int cryptlen, u8 *b0)
 {
unsigned int l, lp, m = authsize;
-   int rc;
 
memcpy(b0, iv, 16);
 
@@ -148,9 +147,7 @@ static int generate_b0(u8 *iv, unsigned int assoclen, 
unsigned int authsize,
if (assoclen)
*b0 |= 64;
 
-   rc = set_msg_len(b0 + 16 - l, cryptlen, l);
-
-   return rc;
+   return set_msg_len(b0 + 16 - l, cryptlen, l);
 }
 
 static int generate_pat(u8   *iv,
-- 
2.25.1


[PATCH linux-next] crypto: nx: remove redundant variable rc

2022-08-31 Thread cgel . zte
From: Jinpeng Cui 

Return value directly from set_msg_len() instead of
getting value from redundant variable rc.

Reported-by: Zeal Robot 
Signed-off-by: Jinpeng Cui 
---
 drivers/crypto/nx/nx-aes-ccm.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/nx/nx-aes-ccm.c b/drivers/crypto/nx/nx-aes-ccm.c
index 3793885f928d..c843f4c6f684 100644
--- a/drivers/crypto/nx/nx-aes-ccm.c
+++ b/drivers/crypto/nx/nx-aes-ccm.c
@@ -134,7 +134,6 @@ static int generate_b0(u8 *iv, unsigned int assoclen, 
unsigned int authsize,
   unsigned int cryptlen, u8 *b0)
 {
unsigned int l, lp, m = authsize;
-   int rc;
 
memcpy(b0, iv, 16);
 
@@ -148,9 +147,7 @@ static int generate_b0(u8 *iv, unsigned int assoclen, 
unsigned int authsize,
if (assoclen)
*b0 |= 64;
 
-   rc = set_msg_len(b0 + 16 - l, cryptlen, l);
-
-   return rc;
+   return set_msg_len(b0 + 16 - l, cryptlen, l);
 }
 
 static int generate_pat(u8   *iv,
-- 
2.25.1



[PATCH linux-next] powerpc/pseries/vas: Remove the unneeded result variable

2022-08-25 Thread cgel . zte
From: ye xingchen 

Return the value vas_register_coproc_api() directly instead of storing it
in another redundant variable.

Reported-by: Zeal Robot 
Signed-off-by: ye xingchen 
---
 arch/powerpc/platforms/pseries/vas.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/vas.c 
b/arch/powerpc/platforms/pseries/vas.c
index 7e6e6dd2e33e..46ea4e252f97 100644
--- a/arch/powerpc/platforms/pseries/vas.c
+++ b/arch/powerpc/platforms/pseries/vas.c
@@ -501,14 +501,10 @@ static const struct vas_user_win_ops vops_pseries = {
 int vas_register_api_pseries(struct module *mod, enum vas_cop_type cop_type,
 const char *name)
 {
-   int rc;
-
if (!copypaste_feat)
return -ENOTSUPP;
 
-   rc = vas_register_coproc_api(mod, cop_type, name, _pseries);
-
-   return rc;
+   return vas_register_coproc_api(mod, cop_type, name, _pseries);
 }
 EXPORT_SYMBOL_GPL(vas_register_api_pseries);
 
-- 
2.25.1


[PATCH linux-next] macintosh:adb:recordmcount:use !E in conditional statements

2022-07-31 Thread cgel . zte
From: ye xingchen 

Use !E to replace the type of x == 0. This change is just to 
simplify the code, no actual functional changes.

Reported-by: Zeal Robot 
Signed-off-by: ye xingchen 
---
 drivers/macintosh/adb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 1bbb9ca08d40..368ab25db234 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -673,7 +673,7 @@ static int adb_open(struct inode *inode, struct file *file)
goto out;
}
state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL);
-   if (state == 0) {
+   if (!state) {
ret = -ENOMEM;
goto out;
}
-- 
2.25.1


[PATCH V2] ASoC: imx-audmux: remove unnecessary check of clk_disable_unprepare/clk_prepare_enable

2022-06-05 Thread cgel . zte
From: Minghao Chi 

Because clk_disable_unprepare/clk_prepare_enable already checked NULL clock
parameter, so the additional checks are unnecessary, just remove them.

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi 
---
v1->v2:
remove the check of audmux_clk before "clk_prepare_enable"
 sound/soc/fsl/imx-audmux.c | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index dfa05d40b276..3ba82adace42 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -62,17 +62,14 @@ static ssize_t audmux_read_file(struct file *file, char 
__user *user_buf,
uintptr_t port = (uintptr_t)file->private_data;
u32 pdcr, ptcr;
 
-   if (audmux_clk) {
-   ret = clk_prepare_enable(audmux_clk);
-   if (ret)
-   return ret;
-   }
+   ret = clk_prepare_enable(audmux_clk);
+   if (ret)
+   return ret;
 
ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port));
pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port));
 
-   if (audmux_clk)
-   clk_disable_unprepare(audmux_clk);
+   clk_disable_unprepare(audmux_clk);
 
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!buf)
@@ -209,17 +206,14 @@ int imx_audmux_v2_configure_port(unsigned int port, 
unsigned int ptcr,
if (!audmux_base)
return -ENOSYS;
 
-   if (audmux_clk) {
-   ret = clk_prepare_enable(audmux_clk);
-   if (ret)
-   return ret;
-   }
+   ret = clk_prepare_enable(audmux_clk);
+   if (ret)
+   return ret;
 
writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(port));
writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(port));
 
-   if (audmux_clk)
-   clk_disable_unprepare(audmux_clk);
+   clk_disable_unprepare(audmux_clk);
 
return 0;
 }
-- 
2.25.1




[PATCH] ASoC: imx-audmux: remove unnecessary check of clk_disable_unprepare

2022-06-02 Thread cgel . zte
From: Minghao Chi 

Because clk_disable_unprepare already checked NULL clock
parameter, so the additional checks are unnecessary, just remove them.

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi 
---
 sound/soc/fsl/imx-audmux.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index dfa05d40b276..f434fa7decc1 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -71,8 +71,7 @@ static ssize_t audmux_read_file(struct file *file, char 
__user *user_buf,
ptcr = readl(audmux_base + IMX_AUDMUX_V2_PTCR(port));
pdcr = readl(audmux_base + IMX_AUDMUX_V2_PDCR(port));
 
-   if (audmux_clk)
-   clk_disable_unprepare(audmux_clk);
+   clk_disable_unprepare(audmux_clk);
 
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!buf)
@@ -218,8 +217,7 @@ int imx_audmux_v2_configure_port(unsigned int port, 
unsigned int ptcr,
writel(ptcr, audmux_base + IMX_AUDMUX_V2_PTCR(port));
writel(pdcr, audmux_base + IMX_AUDMUX_V2_PDCR(port));
 
-   if (audmux_clk)
-   clk_disable_unprepare(audmux_clk);
+   clk_disable_unprepare(audmux_clk);
 
return 0;
 }
-- 
2.25.1




[PATCH] powerpc/fsl_msi: fix return error value in error handing path

2022-04-24 Thread cgel . zte
From: Lv Ruyi 

This function fsl_msi_setup_hwirq() seems to return zero on success and
non-zero on failure, but it returns zero in error handing path.

Reported-by: Zeal Robot 
Signed-off-by: Lv Ruyi 
---
 arch/powerpc/sysdev/fsl_msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index b3475ae9f236..10f974cfa2f3 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -353,7 +353,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct 
platform_device *dev,
if (!virt_msir) {
dev_err(>dev, "%s: Cannot translate IRQ index %d\n",
__func__, irq_index);
-   return 0;
+   return -EINVAL;
}
 
cascade_data = kzalloc(sizeof(struct fsl_msi_cascade_data), GFP_KERNEL);
-- 
2.25.1



[PATCH] ASoC: fsl_asrc: using pm_runtime_resume_and_get to simplify the code

2022-04-19 Thread cgel . zte
From: Minghao Chi 

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi 
---
 sound/soc/fsl/fsl_asrc.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index d7d1536a4f37..31a7f9aac6e3 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -1211,11 +1211,9 @@ static int fsl_asrc_probe(struct platform_device *pdev)
goto err_pm_disable;
}
 
-   ret = pm_runtime_get_sync(>dev);
-   if (ret < 0) {
-   pm_runtime_put_noidle(>dev);
+   ret = pm_runtime_resume_and_get(>dev);
+   if (ret < 0)
goto err_pm_get_sync;
-   }
 
ret = fsl_asrc_init(asrc);
if (ret) {
-- 
2.25.1




[PATCH] ASoC: fsl_sai: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

2022-04-14 Thread cgel . zte
From: Minghao Chi 

Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. This change is just to simplify the code, no
actual functional changes.

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi 
---
 sound/soc/fsl/fsl_sai.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 4650a6931a94..a7930049a049 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -1134,11 +1134,9 @@ static int fsl_sai_probe(struct platform_device *pdev)
goto err_pm_disable;
}
 
-   ret = pm_runtime_get_sync(>dev);
-   if (ret < 0) {
-   pm_runtime_put_noidle(>dev);
+   ret = pm_runtime_resume_and_get(>dev);
+   if (ret < 0)
goto err_pm_get_sync;
-   }
 
/* Get sai version */
ret = fsl_sai_check_version(>dev);
-- 
2.25.1




[PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

2022-04-12 Thread cgel . zte
From: Minghao Chi 

Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi 
---
 sound/soc/fsl/fsl_esai.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index ed444e8f1d6b..1a2bdf8e76f0 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -1050,11 +1050,9 @@ static int fsl_esai_probe(struct platform_device *pdev)
goto err_pm_disable;
}
 
-   ret = pm_runtime_get_sync(>dev);
-   if (ret < 0) {
-   pm_runtime_put_noidle(>dev);
+   ret = pm_runtime_resume_and_get(>dev);
+   if (ret < 0)
goto err_pm_get_sync;
-   }
 
ret = fsl_esai_hw_init(esai_priv);
if (ret)
-- 
2.25.1



[PATCH] powerpc/powernv: fix missing of_node_put in uv_init()

2022-04-07 Thread cgel . zte
From: Lv Ruyi 

of_find_compatible_node() returns node pointer with refcount incremented,
use of_node_put() on it when done.

Reported-by: Zeal Robot 
Signed-off-by: Lv Ruyi 
---
 arch/powerpc/platforms/powernv/ultravisor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/powernv/ultravisor.c 
b/arch/powerpc/platforms/powernv/ultravisor.c
index e4a00ad06f9d..67c8c4b2d8b1 100644
--- a/arch/powerpc/platforms/powernv/ultravisor.c
+++ b/arch/powerpc/platforms/powernv/ultravisor.c
@@ -55,6 +55,7 @@ static int __init uv_init(void)
return -ENODEV;
 
uv_memcons = memcons_init(node, "memcons");
+   of_node_put(node);
if (!uv_memcons)
return -ENOENT;
 
-- 
2.25.1



[PATCH] powerpc/sysdev: fix refcount leak in icp_opal_init()

2022-04-01 Thread cgel . zte
From: Lv Ruyi 

The of_find_compatible_node() function returns a node pointer with
refcount incremented, use of_node_put() on it when done.

Reported-by: Zeal Robot 
Signed-off-by: Lv Ruyi 
---
 arch/powerpc/sysdev/xics/icp-opal.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/xics/icp-opal.c 
b/arch/powerpc/sysdev/xics/icp-opal.c
index bda4c32582d9..4dae624b9f2f 100644
--- a/arch/powerpc/sysdev/xics/icp-opal.c
+++ b/arch/powerpc/sysdev/xics/icp-opal.c
@@ -196,6 +196,7 @@ int __init icp_opal_init(void)
 
printk("XICS: Using OPAL ICP fallbacks\n");
 
+   of_node_put(np);
return 0;
 }
 
-- 
2.25.1



[PATCH] powerpc/sysdev: Use of_device_get_match_data()

2022-03-03 Thread cgel . zte
From: Minghao Chi (CGEL ZTE) 

Use of_device_get_match_data() to simplify the code.

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi (CGEL ZTE) 
---
 arch/powerpc/sysdev/fsl_msi.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index b3475ae9f236..9d135bbb30b7 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -387,7 +387,6 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct 
platform_device *dev,
 static const struct of_device_id fsl_of_msi_ids[];
 static int fsl_of_msi_probe(struct platform_device *dev)
 {
-   const struct of_device_id *match;
struct fsl_msi *msi;
struct resource res, msiir;
int err, i, j, irq_index, count;
@@ -397,10 +396,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
u32 offset;
struct pci_controller *phb;
 
-   match = of_match_device(fsl_of_msi_ids, >dev);
-   if (!match)
-   return -EINVAL;
-   features = match->data;
+   features = of_device_get_match_data(>dev);
 
printk(KERN_DEBUG "Setting up Freescale MSI support\n");
 
-- 
2.25.1



[PATCH V2] platforms/83xx: Use of_device_get_match_data()

2022-02-24 Thread cgel . zte
From: Minghao Chi (CGEL ZTE) 

Use of_device_get_match_data() to simplify the code.
v1->v2:
Add a judgment on the return value of the A function as NULL

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi (CGEL ZTE) 
---
 arch/powerpc/platforms/83xx/suspend.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/suspend.c 
b/arch/powerpc/platforms/83xx/suspend.c
index bb147d34d4a6..6d47a5b81485 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -322,18 +322,15 @@ static const struct platform_suspend_ops 
mpc83xx_suspend_ops = {
 static const struct of_device_id pmc_match[];
 static int pmc_probe(struct platform_device *ofdev)
 {
-   const struct of_device_id *match;
struct device_node *np = ofdev->dev.of_node;
struct resource res;
const struct pmc_type *type;
int ret = 0;
 
-   match = of_match_device(pmc_match, >dev);
-   if (!match)
+   type = of_device_get_match_data(>dev);
+   if (!type)
return -EINVAL;
 
-   type = match->data;
-
if (!of_device_is_available(np))
return -ENODEV;
 
-- 
2.25.1



[PATCH] platforms/83xx: Use of_device_get_match_data()

2022-02-20 Thread cgel . zte
From: Minghao Chi (CGEL ZTE) 

Use of_device_get_match_data() to simplify the code.

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi (CGEL ZTE) 
---
 arch/powerpc/platforms/83xx/suspend.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/suspend.c 
b/arch/powerpc/platforms/83xx/suspend.c
index bb147d34d4a6..9ae9268b683c 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -322,17 +322,12 @@ static const struct platform_suspend_ops 
mpc83xx_suspend_ops = {
 static const struct of_device_id pmc_match[];
 static int pmc_probe(struct platform_device *ofdev)
 {
-   const struct of_device_id *match;
struct device_node *np = ofdev->dev.of_node;
struct resource res;
const struct pmc_type *type;
int ret = 0;
 
-   match = of_match_device(pmc_match, >dev);
-   if (!match)
-   return -EINVAL;
-
-   type = match->data;
+   type = of_device_get_match_data(>dev);
 
if (!of_device_is_available(np))
return -ENODEV;
-- 
2.25.1



[PATCH] drivers/macintosh/ams: remove unneeded result variable

2022-01-17 Thread cgel . zte
From: Minghao Chi 

Return value from i2c_add_driver() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi 
Signed-off-by: CGEL ZTE 
---
 drivers/macintosh/ams/ams-i2c.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/macintosh/ams/ams-i2c.c b/drivers/macintosh/ams/ams-i2c.c
index 21271b2e9259..d2f0cde6f9c7 100644
--- a/drivers/macintosh/ams/ams-i2c.c
+++ b/drivers/macintosh/ams/ams-i2c.c
@@ -256,8 +256,6 @@ static void ams_i2c_exit(void)
 
 int __init ams_i2c_init(struct device_node *np)
 {
-   int result;
-
/* Set implementation stuff */
ams_info.of_node = np;
ams_info.exit = ams_i2c_exit;
@@ -266,7 +264,5 @@ int __init ams_i2c_init(struct device_node *np)
ams_info.clear_irq = ams_i2c_clear_irq;
ams_info.bustype = BUS_I2C;
 
-   result = i2c_add_driver(_i2c_driver);
-
-   return result;
+   return i2c_add_driver(_i2c_driver);
 }
-- 
2.25.1



[PATCH v2] powerpc/cell/axon_msi: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

2021-12-22 Thread cgel . zte
From: Changcheng Deng 

Fix the following coccicheck warning:
./arch/powerpc/platforms/cell/axon_msi.c: 456: 0-23: WARNING: fops_msic
should be defined with DEFINE_DEBUGFS_ATTRIBUTE

DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
imposes some significant overhead as compared to
DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Reported-by: Zeal Robot 
Signed-off-by: Changcheng Deng 
---
 arch/powerpc/platforms/cell/axon_msi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/axon_msi.c 
b/arch/powerpc/platforms/cell/axon_msi.c
index 354a58c1e6f2..362c1efe4180 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -453,7 +453,7 @@ static int msic_get(void *data, u64 *val)
return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(fops_msic, msic_get, msic_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_msic, msic_get, msic_set, "%llu\n");
 
 void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)
 {
@@ -474,6 +474,6 @@ void axon_msi_debug_setup(struct device_node *dn, struct 
axon_msic *msic)
 
snprintf(name, sizeof(name), "msic_%d", of_node_to_nid(dn));
 
-   debugfs_create_file(name, 0600, arch_debugfs_dir, msic, _msic);
+   debugfs_create_file_unsafe(name, 0600, arch_debugfs_dir, msic, 
_msic);
 }
 #endif /* DEBUG */
-- 
2.25.1



[PATCH] powerpc/cell/axon_msi: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

2021-12-21 Thread cgel . zte
From: Changcheng Deng 

Fix the following coccicheck warning:
./arch/powerpc/platforms/cell/axon_msi.c: 456: 0-23: WARNING: fops_msic
should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for
debugfs files.

Reported-by: Zeal Robot 
Signed-off-by: Changcheng Deng 
---
 arch/powerpc/platforms/cell/axon_msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/axon_msi.c 
b/arch/powerpc/platforms/cell/axon_msi.c
index 354a58c1e6f2..47bb0ae8d6c9 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -453,7 +453,7 @@ static int msic_get(void *data, u64 *val)
return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(fops_msic, msic_get, msic_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_msic, msic_get, msic_set, "%llu\n");
 
 void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic)
 {
-- 
2.25.1



[PATCH misc-next] drivers/misc: remove redundant rc variable

2021-12-14 Thread cgel . zte
From: Minghao Chi 

Return value from ocxl_context_attach() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot 
Signed-off-by: Minghao Chi 
---
 drivers/misc/ocxl/file.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c
index e70525eedaae..d881f5e40ad9 100644
--- a/drivers/misc/ocxl/file.c
+++ b/drivers/misc/ocxl/file.c
@@ -74,7 +74,6 @@ static long afu_ioctl_attach(struct ocxl_context *ctx,
 {
struct ocxl_ioctl_attach arg;
u64 amr = 0;
-   int rc;
 
pr_debug("%s for context %d\n", __func__, ctx->pasid);
 
@@ -86,8 +85,7 @@ static long afu_ioctl_attach(struct ocxl_context *ctx,
return -EINVAL;
 
amr = arg.amr & mfspr(SPRN_UAMOR);
-   rc = ocxl_context_attach(ctx, amr, current->mm);
-   return rc;
+   return ocxl_context_attach(ctx, amr, current->mm);
 }
 
 static long afu_ioctl_get_metadata(struct ocxl_context *ctx,
-- 
2.25.1



[PATCH] ASoC: imx-hdmi: add put_device() after of_find_device_by_node()

2021-11-09 Thread cgel . zte
From: Ye Guojin 

This was found by coccicheck:
./sound/soc/fsl/imx-hdmi.c,209,1-7,ERROR  missing put_device; call
of_find_device_by_node on line 119, but without a corresponding object
release within this function.

Reported-by: Zeal Robot 
Signed-off-by: Ye Guojin 
---
 sound/soc/fsl/imx-hdmi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c
index f10359a28800..929f69b758af 100644
--- a/sound/soc/fsl/imx-hdmi.c
+++ b/sound/soc/fsl/imx-hdmi.c
@@ -145,6 +145,8 @@ static int imx_hdmi_probe(struct platform_device *pdev)
data->dai.capture_only = false;
data->dai.init = imx_hdmi_init;
 
+   put_device(_pdev->dev);
+
if (of_node_name_eq(cpu_np, "sai")) {
data->cpu_priv.sysclk_id[1] = FSL_SAI_CLK_MAST1;
data->cpu_priv.sysclk_id[0] = FSL_SAI_CLK_MAST1;
-- 
2.25.1



[PATCH] powerpc: xmon: remove the duplicated operand of the bitwise operator

2021-11-04 Thread cgel . zte
From: Ye Guojin 

The operands of the bitwise OR operator are duplicated, remove one of
them.

Reported-by: Zeal Robot 
Signed-off-by: Ye Guojin 
---
 arch/powerpc/xmon/ppc-opc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/xmon/ppc-opc.c b/arch/powerpc/xmon/ppc-opc.c
index dfb80810b16c..2cab0ec0d162 100644
--- a/arch/powerpc/xmon/ppc-opc.c
+++ b/arch/powerpc/xmon/ppc-opc.c
@@ -6731,9 +6731,9 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 {"fre.",   A(63,24,1),   AFRALFRC_MASK, POWER5,POWER7|PPCVLE,  {FRT, 
FRB, A_L}},
 
 {"fmul",   A(63,25,0), AFRB_MASK,   PPCCOM,PPCEFS|PPCVLE,  {FRT, 
FRA, FRC}},
-{"fm", A(63,25,0), AFRB_MASK,   PWRCOM,PPCVLE|PPCVLE,  {FRT, 
FRA, FRC}},
+{"fm", A(63, 25, 0),   AFRB_MASK,   PWRCOM,PPCVLE, {FRT, FRA, 
FRC}},
 {"fmul.",  A(63,25,1), AFRB_MASK,   PPCCOM,PPCEFS|PPCVLE,  {FRT, 
FRA, FRC}},
-{"fm.",A(63,25,1), AFRB_MASK,   PWRCOM,PPCVLE|PPCVLE,  
{FRT, FRA, FRC}},
+{"fm.",A(63, 25, 1),   AFRB_MASK,   PWRCOM,PPCVLE, {FRT, 
FRA, FRC}},
 
 {"frsqrte",A(63,26,0),   AFRAFRC_MASK,  POWER7,PPCVLE, {FRT, 
FRB}},
 {"frsqrte",A(63,26,0),   AFRALFRC_MASK, PPC,   POWER7|PPCVLE,  {FRT, 
FRB, A_L}},
-- 
2.25.1



[PATCH] scsi: ibmvfc: replace snprintf in show functions with sysfs_emit

2021-11-04 Thread cgel . zte
From: Jing Yao 

coccicheck complains about the use of snprintf() in sysfs show
functions:
WARNING use scnprintf or sprintf

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Reported-by: Zeal Robot 
Signed-off-by: Jing Yao 
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index d0eab5700dc5..d5a197d17e0a 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3403,7 +3403,7 @@ static ssize_t ibmvfc_show_host_partition_name(struct 
device *dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, "%s\n",
vhost->login_buf->resp.partition_name);
 }
 
@@ -3413,7 +3413,7 @@ static ssize_t ibmvfc_show_host_device_name(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, "%s\n",
vhost->login_buf->resp.device_name);
 }
 
@@ -3423,7 +3423,7 @@ static ssize_t ibmvfc_show_host_loc_code(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, "%s\n",
vhost->login_buf->resp.port_loc_code);
 }
 
@@ -3433,7 +3433,7 @@ static ssize_t ibmvfc_show_host_drc_name(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, "%s\n",
vhost->login_buf->resp.drc_name);
 }
 
@@ -3442,7 +3442,7 @@ static ssize_t ibmvfc_show_host_npiv_version(struct 
device *dev,
 {
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
-   return snprintf(buf, PAGE_SIZE, "%d\n", 
be32_to_cpu(vhost->login_buf->resp.version));
+   return sysfs_emit(buf, "%d\n", 
be32_to_cpu(vhost->login_buf->resp.version));
 }
 
 static ssize_t ibmvfc_show_host_capabilities(struct device *dev,
@@ -3450,7 +3450,7 @@ static ssize_t ibmvfc_show_host_capabilities(struct 
device *dev,
 {
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
-   return snprintf(buf, PAGE_SIZE, "%llx\n", 
be64_to_cpu(vhost->login_buf->resp.capabilities));
+   return sysfs_emit(buf, "%llx\n", 
be64_to_cpu(vhost->login_buf->resp.capabilities));
 }
 
 /**
@@ -3471,7 +3471,7 @@ static ssize_t ibmvfc_show_log_level(struct device *dev,
int len;
 
spin_lock_irqsave(shost->host_lock, flags);
-   len = snprintf(buf, PAGE_SIZE, "%d\n", vhost->log_level);
+   len = sysfs_emit(buf, "%d\n", vhost->log_level);
spin_unlock_irqrestore(shost->host_lock, flags);
return len;
 }
@@ -3509,7 +3509,7 @@ static ssize_t ibmvfc_show_scsi_channels(struct device 
*dev,
int len;
 
spin_lock_irqsave(shost->host_lock, flags);
-   len = snprintf(buf, PAGE_SIZE, "%d\n", vhost->client_scsi_channels);
+   len = sysfs_emit(buf, "%d\n", vhost->client_scsi_channels);
spin_unlock_irqrestore(shost->host_lock, flags);
return len;
 }
-- 
2.25.1



[PATCH v2] drivers: scsi: replace snprintf in show functions with sysfs_emit

2021-11-02 Thread cgel . zte
From: Jing Yao 

coccicheck complains about the use of snprintf() in sysfs show
functions:
WARNING use scnprintf or sprintf

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Reported-by: Zeal Robot 
Signed-off-by: Jing Yao 
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index d0eab5700dc5..69bf55c037a5 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3403,7 +3403,7 @@ static ssize_t ibmvfc_show_host_partition_name(struct 
device *dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, "%s\n",
vhost->login_buf->resp.partition_name);
 }
 
@@ -3413,7 +3413,7 @@ static ssize_t ibmvfc_show_host_device_name(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, "%s\n",
vhost->login_buf->resp.device_name);
 }
 
@@ -3423,7 +3423,7 @@ static ssize_t ibmvfc_show_host_loc_code(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, "%s\n",
vhost->login_buf->resp.port_loc_code);
 }
 
@@ -3433,7 +3433,7 @@ static ssize_t ibmvfc_show_host_drc_name(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, "%s\n",
vhost->login_buf->resp.drc_name);
 }
 
@@ -3442,7 +3442,7 @@ static ssize_t ibmvfc_show_host_npiv_version(struct 
device *dev,
 {
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
-   return snprintf(buf, PAGE_SIZE, "%d\n", 
be32_to_cpu(vhost->login_buf->resp.version));
+   return sysfs_emit(buf, "%d\n", 
be32_to_cpu(vhost->login_buf->resp.version));
 }
 
 static ssize_t ibmvfc_show_host_capabilities(struct device *dev,
@@ -3450,7 +3450,7 @@ static ssize_t ibmvfc_show_host_capabilities(struct 
device *dev,
 {
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
-   return snprintf(buf, PAGE_SIZE, "%llx\n", 
be64_to_cpu(vhost->login_buf->resp.capabilities));
+   return sysfs_emit(buf, "%llx\n", 
be64_to_cpu(vhost->login_buf->resp.capabilities));
 }
 
 /**
-- 
2.25.1



[PATCH] powerpc/xmon: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

2021-11-01 Thread cgel . zte
From: Changcheng Deng 

Fix the following coccicheck warning:

./arch/powerpc/xmon/xmon.c: 4064: 0-23: WARNING: xmon_dbgfs_ops should
be defined with DEFINE_DEBUGFS_ATTRIBUTE

Reported-by: Zeal Robot 
Signed-off-by: Changcheng Deng 
---
 arch/powerpc/xmon/xmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index dd8241c009e5..875241bd216b 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -4062,7 +4062,7 @@ static int xmon_dbgfs_get(void *data, u64 *val)
return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(xmon_dbgfs_ops, xmon_dbgfs_get,
+DEFINE_DEBUGFS_ATTRIBUTE(xmon_dbgfs_ops, xmon_dbgfs_get,
xmon_dbgfs_set, "%llu\n");
 
 static int __init setup_xmon_dbgfs(void)
-- 
2.25.1



[PATCH] drivers: scsi: replace snprintf in show functions with sysfs_emit

2021-10-28 Thread cgel . zte
From: Jing Yao 

Reported-by: Zeal Robot 
Signed-off-by: Jing Yao 
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index d0eab5700dc5..9f20fefc2c02 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3403,7 +3403,7 @@ static ssize_t ibmvfc_show_host_partition_name(struct 
device *dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, PAGE_SIZE, "%s\n",
vhost->login_buf->resp.partition_name);
 }
 
@@ -3413,7 +3413,7 @@ static ssize_t ibmvfc_show_host_device_name(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, PAGE_SIZE, "%s\n",
vhost->login_buf->resp.device_name);
 }
 
@@ -3423,7 +3423,7 @@ static ssize_t ibmvfc_show_host_loc_code(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, PAGE_SIZE, "%s\n",
vhost->login_buf->resp.port_loc_code);
 }
 
@@ -3433,7 +3433,7 @@ static ssize_t ibmvfc_show_host_drc_name(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
+   return sysfs_emit(buf, PAGE_SIZE, "%s\n",
vhost->login_buf->resp.drc_name);
 }
 
@@ -3442,7 +3442,7 @@ static ssize_t ibmvfc_show_host_npiv_version(struct 
device *dev,
 {
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
-   return snprintf(buf, PAGE_SIZE, "%d\n", 
be32_to_cpu(vhost->login_buf->resp.version));
+   return sysfs_emit(buf, PAGE_SIZE, "%d\n", 
be32_to_cpu(vhost->login_buf->resp.version));
 }
 
 static ssize_t ibmvfc_show_host_capabilities(struct device *dev,
@@ -3450,7 +3450,7 @@ static ssize_t ibmvfc_show_host_capabilities(struct 
device *dev,
 {
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
-   return snprintf(buf, PAGE_SIZE, "%llx\n", 
be64_to_cpu(vhost->login_buf->resp.capabilities));
+   return sysfs_emit(buf, PAGE_SIZE, "%llx\n", 
be64_to_cpu(vhost->login_buf->resp.capabilities));
 }
 
 /**
-- 
2.25.1



[PATCH] scsi: ibmvfc: replace scnprintf in show functions with sysfs_emit

2021-10-27 Thread cgel . zte
From: Changcheng Deng 

Fix the coccicheck warning:
WARNING: use scnprintf or sprintf

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Reported-by: Zeal Robot 
Signed-off-by: Changcheng Deng 
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index a4b0a12f8a97..7f39a965677b 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3402,8 +3402,7 @@ static ssize_t ibmvfc_show_host_partition_name(struct 
device *dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
-   vhost->login_buf->resp.partition_name);
+   return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.partition_name);
 }
 
 static ssize_t ibmvfc_show_host_device_name(struct device *dev,
@@ -3412,8 +3411,7 @@ static ssize_t ibmvfc_show_host_device_name(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
-   vhost->login_buf->resp.device_name);
+   return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.device_name);
 }
 
 static ssize_t ibmvfc_show_host_loc_code(struct device *dev,
@@ -3422,8 +3420,7 @@ static ssize_t ibmvfc_show_host_loc_code(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
-   vhost->login_buf->resp.port_loc_code);
+   return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.port_loc_code);
 }
 
 static ssize_t ibmvfc_show_host_drc_name(struct device *dev,
@@ -3432,8 +3429,7 @@ static ssize_t ibmvfc_show_host_drc_name(struct device 
*dev,
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
 
-   return snprintf(buf, PAGE_SIZE, "%s\n",
-   vhost->login_buf->resp.drc_name);
+   return sysfs_emit(buf, "%s\n", vhost->login_buf->resp.drc_name);
 }
 
 static ssize_t ibmvfc_show_host_npiv_version(struct device *dev,
@@ -3441,7 +3437,7 @@ static ssize_t ibmvfc_show_host_npiv_version(struct 
device *dev,
 {
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
-   return snprintf(buf, PAGE_SIZE, "%d\n", 
be32_to_cpu(vhost->login_buf->resp.version));
+   return sysfs_emit(buf, "%d\n", 
be32_to_cpu(vhost->login_buf->resp.version));
 }
 
 static ssize_t ibmvfc_show_host_capabilities(struct device *dev,
@@ -3449,7 +3445,7 @@ static ssize_t ibmvfc_show_host_capabilities(struct 
device *dev,
 {
struct Scsi_Host *shost = class_to_shost(dev);
struct ibmvfc_host *vhost = shost_priv(shost);
-   return snprintf(buf, PAGE_SIZE, "%llx\n", 
be64_to_cpu(vhost->login_buf->resp.capabilities));
+   return sysfs_emit(buf, "%llx\n", 
be64_to_cpu(vhost->login_buf->resp.capabilities));
 }
 
 /**
-- 
2.25.1



[PATCH linux-next] module: remove duplicate include in interrupt.c

2021-08-16 Thread cgel . zte
From: Lv Ruyi 

'asm/interrupt.h' included in 'interrupt.c' is duplicated.

Reported-by: Zeal Robot 
Signed-off-by: Lv Ruyi 
---
 arch/powerpc/kernel/interrupt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index 21bbd615ca41..8a936515e4e4 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
2.25.1



[PATCH linux-next] powerpc/tm: remove duplicate include in tm-poison.c

2021-08-05 Thread cgel . zte
From: yong yiran 

'inttypes.h' included in 'tm-poison.c' is duplicated.
Remove all but the first include of inttypes.h from tm-poison.c.

Reported-by: Zeal Robot 
Signed-off-by: yong yiran 
---
 tools/testing/selftests/powerpc/tm/tm-poison.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/testing/selftests/powerpc/tm/tm-poison.c 
b/tools/testing/selftests/powerpc/tm/tm-poison.c
index 29e5f26af7b9..27c083a03d1f 100644
--- a/tools/testing/selftests/powerpc/tm/tm-poison.c
+++ b/tools/testing/selftests/powerpc/tm/tm-poison.c
@@ -20,7 +20,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "tm.h"
 
-- 
2.25.1