[PATCH] mtd: phram: error handling

2015-11-11 Thread Saurabh Sengar
> More importantly, it's good to test these cases too: > * phram is built-in (not a module), with and without a phram= line on > the commandline > * writing to /sys/module/phram/parameters/phram (for both the module > and built-in cases) Hi Brian, 1) I have tried phram as built-in, with and

Re: [PATCH] mtd: phram: error handling

2015-11-11 Thread Brian Norris
Hi Saurabh, On Wed, Nov 11, 2015 at 01:53:58PM +0530, Saurabh Sengar wrote: > Brian Norris wrote: > > Well, today you're in luck! You're touching a driver that requires no > > special hardware, so you should be able to test it. > > > I think you can try using the mem= kernel parameter (see > > Do

[PATCH] mtd: phram: error handling

2015-11-11 Thread Saurabh Sengar
Brian Norris wrote: > Well, today you're in luck! You're touching a driver that requires no > special hardware, so you should be able to test it. > I think you can try using the mem= kernel parameter (see > Documentation/kernel-parameters.txt) to restrict your system memory, and > then try using

Re: [PATCH] mtd: phram: error handling

2015-11-10 Thread Brian Norris
On Wed, Nov 11, 2015 at 12:57:55AM +0530, Saurabh Sengar wrote: > Sorry, I am not able to test the driver, sending the patch as asked above. Well, today you're in luck! You're touching a driver that requires no special hardware, so you should be able to test it. I think you can try using the mem=

[PATCH] mtd: phram: error handling

2015-11-10 Thread Saurabh Sengar
Expand parse_err macro with hidden flow in-place. Remove the now unused parse_err macro. Miscellanea: o Use invalid not illegal for error messages Noticed-by: Brian Norris Signed-off-by: Joe Perches Signed-off-by: Saurabh Sengar --- >> I think -EINVAL makes more sense than 1. That >> could be

Re: [PATCH] mtd: phram: error handling

2015-11-10 Thread Brian Norris
On Tue, Nov 10, 2015 at 10:45:55AM -0800, Joe Perches wrote: > On Tue, 2015-11-10 at 10:39 -0800, Brian Norris wrote: > > On Tue, Nov 10, 2015 at 10:33:07AM -0800, Joe Perches wrote: > > > Expand parse_err macro with hidden flow in-place. > > > Remove the now unused parse_err macro. > [] > > I thin

Re: [PATCH] mtd: phram: error handling

2015-11-10 Thread Joe Perches
On Tue, 2015-11-10 at 10:39 -0800, Brian Norris wrote: > On Tue, Nov 10, 2015 at 10:33:07AM -0800, Joe Perches wrote: > > Expand parse_err macro with hidden flow in-place. > > Remove the now unused parse_err macro. [] > I think -EINVAL makes more sense than 1. That > could be a subsequent patch, I

Re: [PATCH] mtd: phram: error handling

2015-11-10 Thread Brian Norris
On Tue, Nov 10, 2015 at 10:33:07AM -0800, Joe Perches wrote: > Expand parse_err macro with hidden flow in-place. > Remove the now unused parse_err macro. Quick one... thanks, I guess. > Miscellanea: > > o Use invalid not illegal for error messages > > Noticed-by: Brian Norris > Signed-off-by:

[PATCH] mtd: phram: error handling

2015-11-10 Thread Joe Perches
Expand parse_err macro with hidden flow in-place. Remove the now unused parse_err macro. Miscellanea: o Use invalid not illegal for error messages Noticed-by: Brian Norris Signed-off-by: Joe Perches --- > Did you notice that > there's a "return" statement embedded in the parse_err() macro? So

Re: [PATCH] mtd: phram: error handling

2015-11-08 Thread Andy Shevchenko
On Sun, Nov 8, 2015 at 10:47 AM, Saurabh Sengar wrote: > registering the device with NULL pointer can lead to crash, > hence fixing it. Hmm… Why not just checking it before an register attempt? I think user is in right to know as many problems as they have at one shot, with your patch if there ar

[PATCH] mtd: phram: error handling

2015-11-08 Thread Saurabh Sengar
registering the device with NULL pointer can lead to crash, hence fixing it. Signed-off-by: Saurabh Sengar --- in case of 'illegal start address' or 'illegal device length', name pointer is getting freed. we shouldn't register the device with NULL pointer. drivers/mtd/devices/phram.c | 4 +++-