Re: [PATCH] drivers: char: hw_random: printk replacement

2014-09-15 Thread Sudip Mukherjee
On Mon, Sep 15, 2014 at 07:41:23PM +0800, Herbert Xu wrote:
> On Thu, Aug 28, 2014 at 08:32:58PM +0530, Sudip Mukherjee wrote:
> > as pr_* macros are more preffered over printk, so printk replaced with 
> > corresponding pr_* macros
> > 
> > Signed-off-by: Sudip Mukherjee 
> 
> Your patch doesn't even build:
> 
>   CC [M]  drivers/char/hw_random/intel-rng.o
>   CC [M]  drivers/char/hw_random/amd-rng.o
>   CC [M]  drivers/char/hw_random/via-rng.o
>   drivers/char/hw_random/intel-rng.c: In function ‘intel_init_hw_struct’:
>   drivers/char/hw_random/intel-rng.c:317:3: error: expected ‘)’ before 
> ‘warning’
>   drivers/char/hw_random/intel-rng.c:308:36: warning: unused variable 
> ‘warning’ [-Wunused-variable]
>   make[1]: *** [drivers/char/hw_random/intel-rng.o] Error 1
> 
> Cheers,
> -- 

i am extremely sorry for the mess. after applying the patch i tested with 
allmodconfig
and seeing no error i thought it was ok. but now after your mail when i am 
verifying i
noticed that allmodconfig is not including it in the config and as a result it 
was not tested.

i will post a corrected v2 of the patch.

sorry again,

thanks
sudip


> Email: Herbert Xu 
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: char: hw_random: printk replacement

2014-09-15 Thread Herbert Xu
On Thu, Aug 28, 2014 at 08:32:58PM +0530, Sudip Mukherjee wrote:
> as pr_* macros are more preffered over printk, so printk replaced with 
> corresponding pr_* macros
> 
> Signed-off-by: Sudip Mukherjee 

Your patch doesn't even build:

  CC [M]  drivers/char/hw_random/intel-rng.o
  CC [M]  drivers/char/hw_random/amd-rng.o
  CC [M]  drivers/char/hw_random/via-rng.o
  drivers/char/hw_random/intel-rng.c: In function ‘intel_init_hw_struct’:
  drivers/char/hw_random/intel-rng.c:317:3: error: expected ‘)’ before ‘warning’
  drivers/char/hw_random/intel-rng.c:308:36: warning: unused variable ‘warning’ 
[-Wunused-variable]
  make[1]: *** [drivers/char/hw_random/intel-rng.o] Error 1

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: char: hw_random: printk replacement

2014-09-15 Thread Herbert Xu
On Thu, Aug 28, 2014 at 08:32:58PM +0530, Sudip Mukherjee wrote:
 as pr_* macros are more preffered over printk, so printk replaced with 
 corresponding pr_* macros
 
 Signed-off-by: Sudip Mukherjee su...@vectorindia.org

Your patch doesn't even build:

  CC [M]  drivers/char/hw_random/intel-rng.o
  CC [M]  drivers/char/hw_random/amd-rng.o
  CC [M]  drivers/char/hw_random/via-rng.o
  drivers/char/hw_random/intel-rng.c: In function ‘intel_init_hw_struct’:
  drivers/char/hw_random/intel-rng.c:317:3: error: expected ‘)’ before ‘warning’
  drivers/char/hw_random/intel-rng.c:308:36: warning: unused variable ‘warning’ 
[-Wunused-variable]
  make[1]: *** [drivers/char/hw_random/intel-rng.o] Error 1

Cheers,
-- 
Email: Herbert Xu herb...@gondor.apana.org.au
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: char: hw_random: printk replacement

2014-09-15 Thread Sudip Mukherjee
On Mon, Sep 15, 2014 at 07:41:23PM +0800, Herbert Xu wrote:
 On Thu, Aug 28, 2014 at 08:32:58PM +0530, Sudip Mukherjee wrote:
  as pr_* macros are more preffered over printk, so printk replaced with 
  corresponding pr_* macros
  
  Signed-off-by: Sudip Mukherjee su...@vectorindia.org
 
 Your patch doesn't even build:
 
   CC [M]  drivers/char/hw_random/intel-rng.o
   CC [M]  drivers/char/hw_random/amd-rng.o
   CC [M]  drivers/char/hw_random/via-rng.o
   drivers/char/hw_random/intel-rng.c: In function ‘intel_init_hw_struct’:
   drivers/char/hw_random/intel-rng.c:317:3: error: expected ‘)’ before 
 ‘warning’
   drivers/char/hw_random/intel-rng.c:308:36: warning: unused variable 
 ‘warning’ [-Wunused-variable]
   make[1]: *** [drivers/char/hw_random/intel-rng.o] Error 1
 
 Cheers,
 -- 

i am extremely sorry for the mess. after applying the patch i tested with 
allmodconfig
and seeing no error i thought it was ok. but now after your mail when i am 
verifying i
noticed that allmodconfig is not including it in the config and as a result it 
was not tested.

i will post a corrected v2 of the patch.

sorry again,

thanks
sudip


 Email: Herbert Xu herb...@gondor.apana.org.au
 Home Page: http://gondor.apana.org.au/~herbert/
 PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: char: hw_random: printk replacement

2014-09-08 Thread Sudip Mukherjee
On Thu, Aug 28, 2014 at 08:32:58PM +0530, Sudip Mukherjee wrote:
> as pr_* macros are more preffered over printk, so printk replaced with 
> corresponding pr_* macros
> 
> Signed-off-by: Sudip Mukherjee 
> ---
> 
> The replacement was done by a bash script to avoid copy paste error. The 
> script is as follows :
> 
> OLD="printk(KERN_ERR \?"
> OLD1="printk(KERN_NOTICE \?"
> OLD2="printk(KERN_WARNING \?"
> OLD3="printk(KERN_INFO \?"
> NEW="pr_err("
> NEW1="pr_notice("
> NEW2="pr_warn("
> NEW3="pr_info("
> TFILE="/tmp/out.tmp.$$"
> for f in *.c
> do
> sed -e "s/$OLD/$NEW/g" -e "s/$OLD1/$NEW1/g" -e "s/$OLD2/$NEW2/g" -e 
> "s/$OLD3/$NEW3/g" "$f" > $TFILE && mv $TFILE "$f"
> done
> 
> Frankly speaking this script has missed one instance of printk(warning) in 
> intel-rng.c file , and this one was edited manually.
> 
>  drivers/char/hw_random/amd-rng.c |  4 ++--
>  drivers/char/hw_random/geode-rng.c   |  4 ++--
>  drivers/char/hw_random/intel-rng.c   | 12 ++--
>  drivers/char/hw_random/pasemi-rng.c  |  2 +-
>  drivers/char/hw_random/pseries-rng.c |  2 +-
>  drivers/char/hw_random/via-rng.c |  8 
>  6 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/char/hw_random/amd-rng.c 
> b/drivers/char/hw_random/amd-rng.c
> index c6af038..48f6a83 100644
> --- a/drivers/char/hw_random/amd-rng.c
> +++ b/drivers/char/hw_random/amd-rng.c
> @@ -142,10 +142,10 @@ found:
>   amd_rng.priv = (unsigned long)pmbase;
>   amd_pdev = pdev;
>  
> - printk(KERN_INFO "AMD768 RNG detected\n");
> + pr_info("AMD768 RNG detected\n");
>   err = hwrng_register(_rng);
>   if (err) {
> - printk(KERN_ERR PFX "RNG registering failed (%d)\n",
> + pr_err(PFX "RNG registering failed (%d)\n",
>  err);
>   release_region(pmbase + 0xF0, 8);
>   goto out;
> diff --git a/drivers/char/hw_random/geode-rng.c 
> b/drivers/char/hw_random/geode-rng.c
> index 4c4d4e1..0d0579f 100644
> --- a/drivers/char/hw_random/geode-rng.c
> +++ b/drivers/char/hw_random/geode-rng.c
> @@ -109,10 +109,10 @@ found:
>   goto out;
>   geode_rng.priv = (unsigned long)mem;
>  
> - printk(KERN_INFO "AMD Geode RNG detected\n");
> + pr_info("AMD Geode RNG detected\n");
>   err = hwrng_register(_rng);
>   if (err) {
> - printk(KERN_ERR PFX "RNG registering failed (%d)\n",
> + pr_err(PFX "RNG registering failed (%d)\n",
>  err);
>   goto err_unmap;
>   }
> diff --git a/drivers/char/hw_random/intel-rng.c 
> b/drivers/char/hw_random/intel-rng.c
> index 86fe45c..3122376 100644
> --- a/drivers/char/hw_random/intel-rng.c
> +++ b/drivers/char/hw_random/intel-rng.c
> @@ -199,7 +199,7 @@ static int intel_rng_init(struct hwrng *rng)
>   if ((hw_status & INTEL_RNG_ENABLED) == 0)
>   hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED);
>   if ((hw_status & INTEL_RNG_ENABLED) == 0) {
> - printk(KERN_ERR PFX "cannot enable RNG, aborting\n");
> + pr_err(PFX "cannot enable RNG, aborting\n");
>   goto out;
>   }
>   err = 0;
> @@ -216,7 +216,7 @@ static void intel_rng_cleanup(struct hwrng *rng)
>   if (hw_status & INTEL_RNG_ENABLED)
>   hwstatus_set(mem, hw_status & ~INTEL_RNG_ENABLED);
>   else
> - printk(KERN_WARNING PFX "unusual: RNG already disabled\n");
> + pr_warn(PFX "unusual: RNG already disabled\n");
>  }
>  
>  
> @@ -274,7 +274,7 @@ static int __init intel_rng_hw_init(void *_intel_rng_hw)
>   if (mfc != INTEL_FWH_MANUFACTURER_CODE ||
>   (dvc != INTEL_FWH_DEVICE_CODE_8M &&
>dvc != INTEL_FWH_DEVICE_CODE_4M)) {
> - printk(KERN_NOTICE PFX "FWH not detected\n");
> + pr_notice(PFX "FWH not detected\n");
>   return -ENODEV;
>   }
>  
> @@ -314,7 +314,7 @@ PFX "RNG, try using the 'no_fwh_detect' option.\n";
>  
>   if (no_fwh_detect)
>   return -ENODEV;
> - printk(warning);
> + pr_warn(warning);
>   return -EBUSY;
>   }
>  
> @@ -392,10 +392,10 @@ fwh_done:
>   goto out;
>   }
>  
> - printk(KERN_INFO "Intel 82802 RNG detected\n");
> + pr_info("Intel 82802 RNG detected\n");
>   err = hwrng_register(_rng);
>   if (err) {
> - printk(KERN_ERR PFX "RNG registering failed (%d)\n",
> + pr_err(PFX "RNG registering failed (%d)\n",
>  err);
>   iounmap(mem);
>   }
> diff --git a/drivers/char/hw_random/pasemi-rng.c 
> b/drivers/char/hw_random/pasemi-rng.c
> index c66279b..c0347d1 100644
> --- a/drivers/char/hw_random/pasemi-rng.c
> +++ b/drivers/char/hw_random/pasemi-rng.c
> @@ -113,7 +113,7 @@ static int rng_probe(struct platform_device *ofdev)
>  
>   pasemi_rng.priv = (unsigned long)rng_regs;
>  
> - printk(KERN_INFO "Registering PA 

Re: [PATCH] drivers: char: hw_random: printk replacement

2014-09-08 Thread Sudip Mukherjee
On Thu, Aug 28, 2014 at 08:32:58PM +0530, Sudip Mukherjee wrote:
 as pr_* macros are more preffered over printk, so printk replaced with 
 corresponding pr_* macros
 
 Signed-off-by: Sudip Mukherjee su...@vectorindia.org
 ---
 
 The replacement was done by a bash script to avoid copy paste error. The 
 script is as follows :
 
 OLD=printk(KERN_ERR \?
 OLD1=printk(KERN_NOTICE \?
 OLD2=printk(KERN_WARNING \?
 OLD3=printk(KERN_INFO \?
 NEW=pr_err(
 NEW1=pr_notice(
 NEW2=pr_warn(
 NEW3=pr_info(
 TFILE=/tmp/out.tmp.$$
 for f in *.c
 do
 sed -e s/$OLD/$NEW/g -e s/$OLD1/$NEW1/g -e s/$OLD2/$NEW2/g -e 
 s/$OLD3/$NEW3/g $f  $TFILE  mv $TFILE $f
 done
 
 Frankly speaking this script has missed one instance of printk(warning) in 
 intel-rng.c file , and this one was edited manually.
 
  drivers/char/hw_random/amd-rng.c |  4 ++--
  drivers/char/hw_random/geode-rng.c   |  4 ++--
  drivers/char/hw_random/intel-rng.c   | 12 ++--
  drivers/char/hw_random/pasemi-rng.c  |  2 +-
  drivers/char/hw_random/pseries-rng.c |  2 +-
  drivers/char/hw_random/via-rng.c |  8 
  6 files changed, 16 insertions(+), 16 deletions(-)
 
 diff --git a/drivers/char/hw_random/amd-rng.c 
 b/drivers/char/hw_random/amd-rng.c
 index c6af038..48f6a83 100644
 --- a/drivers/char/hw_random/amd-rng.c
 +++ b/drivers/char/hw_random/amd-rng.c
 @@ -142,10 +142,10 @@ found:
   amd_rng.priv = (unsigned long)pmbase;
   amd_pdev = pdev;
  
 - printk(KERN_INFO AMD768 RNG detected\n);
 + pr_info(AMD768 RNG detected\n);
   err = hwrng_register(amd_rng);
   if (err) {
 - printk(KERN_ERR PFX RNG registering failed (%d)\n,
 + pr_err(PFX RNG registering failed (%d)\n,
  err);
   release_region(pmbase + 0xF0, 8);
   goto out;
 diff --git a/drivers/char/hw_random/geode-rng.c 
 b/drivers/char/hw_random/geode-rng.c
 index 4c4d4e1..0d0579f 100644
 --- a/drivers/char/hw_random/geode-rng.c
 +++ b/drivers/char/hw_random/geode-rng.c
 @@ -109,10 +109,10 @@ found:
   goto out;
   geode_rng.priv = (unsigned long)mem;
  
 - printk(KERN_INFO AMD Geode RNG detected\n);
 + pr_info(AMD Geode RNG detected\n);
   err = hwrng_register(geode_rng);
   if (err) {
 - printk(KERN_ERR PFX RNG registering failed (%d)\n,
 + pr_err(PFX RNG registering failed (%d)\n,
  err);
   goto err_unmap;
   }
 diff --git a/drivers/char/hw_random/intel-rng.c 
 b/drivers/char/hw_random/intel-rng.c
 index 86fe45c..3122376 100644
 --- a/drivers/char/hw_random/intel-rng.c
 +++ b/drivers/char/hw_random/intel-rng.c
 @@ -199,7 +199,7 @@ static int intel_rng_init(struct hwrng *rng)
   if ((hw_status  INTEL_RNG_ENABLED) == 0)
   hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED);
   if ((hw_status  INTEL_RNG_ENABLED) == 0) {
 - printk(KERN_ERR PFX cannot enable RNG, aborting\n);
 + pr_err(PFX cannot enable RNG, aborting\n);
   goto out;
   }
   err = 0;
 @@ -216,7 +216,7 @@ static void intel_rng_cleanup(struct hwrng *rng)
   if (hw_status  INTEL_RNG_ENABLED)
   hwstatus_set(mem, hw_status  ~INTEL_RNG_ENABLED);
   else
 - printk(KERN_WARNING PFX unusual: RNG already disabled\n);
 + pr_warn(PFX unusual: RNG already disabled\n);
  }
  
  
 @@ -274,7 +274,7 @@ static int __init intel_rng_hw_init(void *_intel_rng_hw)
   if (mfc != INTEL_FWH_MANUFACTURER_CODE ||
   (dvc != INTEL_FWH_DEVICE_CODE_8M 
dvc != INTEL_FWH_DEVICE_CODE_4M)) {
 - printk(KERN_NOTICE PFX FWH not detected\n);
 + pr_notice(PFX FWH not detected\n);
   return -ENODEV;
   }
  
 @@ -314,7 +314,7 @@ PFX RNG, try using the 'no_fwh_detect' option.\n;
  
   if (no_fwh_detect)
   return -ENODEV;
 - printk(warning);
 + pr_warn(warning);
   return -EBUSY;
   }
  
 @@ -392,10 +392,10 @@ fwh_done:
   goto out;
   }
  
 - printk(KERN_INFO Intel 82802 RNG detected\n);
 + pr_info(Intel 82802 RNG detected\n);
   err = hwrng_register(intel_rng);
   if (err) {
 - printk(KERN_ERR PFX RNG registering failed (%d)\n,
 + pr_err(PFX RNG registering failed (%d)\n,
  err);
   iounmap(mem);
   }
 diff --git a/drivers/char/hw_random/pasemi-rng.c 
 b/drivers/char/hw_random/pasemi-rng.c
 index c66279b..c0347d1 100644
 --- a/drivers/char/hw_random/pasemi-rng.c
 +++ b/drivers/char/hw_random/pasemi-rng.c
 @@ -113,7 +113,7 @@ static int rng_probe(struct platform_device *ofdev)
  
   pasemi_rng.priv = (unsigned long)rng_regs;
  
 - printk(KERN_INFO Registering PA Semi RNG\n);
 + pr_info(Registering PA Semi RNG\n);
  
   err = hwrng_register(pasemi_rng);
  
 diff --git a/drivers/char/hw_random/pseries-rng.c 
 

Re: [PATCH] drivers: char: hw_random: printk replacement

2014-08-29 Thread Michael Ellerman
On Thu, 2014-08-28 at 20:32 +0530, Sudip Mukherjee wrote:
> as pr_* macros are more preffered over printk, so printk replaced with 
> corresponding pr_* macros
 
I suppose ...

>  drivers/char/hw_random/pasemi-rng.c  |  2 +-
>  drivers/char/hw_random/pseries-rng.c |  2 +-

These look OK to me.

cheers


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: char: hw_random: printk replacement

2014-08-29 Thread Michael Ellerman
On Thu, 2014-08-28 at 20:32 +0530, Sudip Mukherjee wrote:
 as pr_* macros are more preffered over printk, so printk replaced with 
 corresponding pr_* macros
 
I suppose ...

  drivers/char/hw_random/pasemi-rng.c  |  2 +-
  drivers/char/hw_random/pseries-rng.c |  2 +-

These look OK to me.

cheers


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/