Message ID | 20240320180943.3683-1-chandrapratap3519@gmail.com (mailing list archive) |
---|---|
State | Handled Elsewhere |
Headers | show |
Series | [v2] staging: sm750fb: Replace comparisons with NULL and 0 | expand |
On Wed, Mar 20, 2024 at 11:39:43PM +0530, Chandra Pratap wrote: > Replace '(opt != NULL)' with '(opt)' and '(*opt != 0)' > with '(*opt != '\0')' to adhere to the coding standards. > > Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> > --- > Changes in v2: > - Update the commit message to reflect the changes better > - replace (*opt) with (*opt != '\0') > Thanks! Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> regards, dan carpenter
On Wed, Mar 20, 2024 at 11:39:43PM +0530, Chandra Pratap wrote: > Replace '(opt != NULL)' with '(opt)' and '(*opt != 0)' > with '(*opt != '\0')' to adhere to the coding standards. > > Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> > --- > Changes in v2: > - Update the commit message to reflect the changes better > - replace (*opt) with (*opt != '\0') > > drivers/staging/sm750fb/sm750.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c > index 04c1b32a22c5..0391235c5666 100644 > --- a/drivers/staging/sm750fb/sm750.c > +++ b/drivers/staging/sm750fb/sm750.c > @@ -926,7 +926,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src) > goto NO_PARAM; > } > > - while ((opt = strsep(&src, ":")) != NULL && *opt != 0) { > + while ((opt = strsep(&src, ":")) && *opt != '\0') { Why 2 spaces? Please fix in a new version. thanks, greg k-h
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 04c1b32a22c5..0391235c5666 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -926,7 +926,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src) goto NO_PARAM; } - while ((opt = strsep(&src, ":")) != NULL && *opt != 0) { + while ((opt = strsep(&src, ":")) && *opt != '\0') { dev_info(&sm750_dev->pdev->dev, "opt=%s\n", opt); dev_info(&sm750_dev->pdev->dev, "src=%s\n", src); @@ -1147,7 +1147,7 @@ static int __init lynxfb_setup(char *options) * strsep() updates @options to pointer after the first found token * it also returns the pointer ahead the token. */ - while ((opt = strsep(&options, ":")) != NULL) { + while ((opt = strsep(&options, ":"))) { /* options that mean for any lynx chips are configured here */ if (!strncmp(opt, "noaccel", strlen("noaccel"))) { g_noaccel = 1;
Replace '(opt != NULL)' with '(opt)' and '(*opt != 0)' with '(*opt != '\0')' to adhere to the coding standards. Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> --- Changes in v2: - Update the commit message to reflect the changes better - replace (*opt) with (*opt != '\0') drivers/staging/sm750fb/sm750.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)