* [PATCH] Staging: speakup: i18n: Use x instead of x != NULL.
@ 2016-09-14 9:29 Sandhya Bankar
2016-09-14 9:33 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Sandhya Bankar @ 2016-09-14 9:29 UTC (permalink / raw)
To: outreachy-kernel
Use x instead of x != NULL.
The patch removes the explicit NULL comparisons.This patch is detected by checkpatch.pl.
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/speakup/i18n.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
index 8960079..41b56d6 100644
--- a/drivers/staging/speakup/i18n.c
+++ b/drivers/staging/speakup/i18n.c
@@ -407,9 +407,9 @@ static char *next_specifier(char *input)
int found = 0;
char *next_percent = input;
- while ((next_percent != NULL) && !found) {
+ while ((next_percent) && !found) {
next_percent = strchr(next_percent, '%');
- if (next_percent != NULL) {
+ if (next_percent) {
/* skip over doubled percent signs */
while ((next_percent[0] == '%')
&& (next_percent[1] == '%'))
--
1.8.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: speakup: i18n: Use x instead of x != NULL.
2016-09-14 9:29 [PATCH] Staging: speakup: i18n: Use x instead of x != NULL Sandhya Bankar
@ 2016-09-14 9:33 ` Julia Lawall
2016-09-14 9:38 ` Vaishali Thakkar
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2016-09-14 9:33 UTC (permalink / raw)
To: Sandhya Bankar; +Cc: outreachy-kernel
On Wed, 14 Sep 2016, Sandhya Bankar wrote:
> Use x instead of x != NULL.
> The patch removes the explicit NULL comparisons.This patch is detected by checkpatch.pl.
Please always put at least one space after the end of a sentence, if i is
followed by another one.
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
> ---
> drivers/staging/speakup/i18n.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
> index 8960079..41b56d6 100644
> --- a/drivers/staging/speakup/i18n.c
> +++ b/drivers/staging/speakup/i18n.c
> @@ -407,9 +407,9 @@ static char *next_specifier(char *input)
> int found = 0;
> char *next_percent = input;
>
> - while ((next_percent != NULL) && !found) {
> + while ((next_percent) && !found) {
You could really drop the parentheses at the same time. They were not
necessary before, but they are even less necessary when only a single
variable is involved.
julia
> next_percent = strchr(next_percent, '%');
> - if (next_percent != NULL) {
> + if (next_percent) {
> /* skip over doubled percent signs */
> while ((next_percent[0] == '%')
> && (next_percent[1] == '%'))
> --
> 1.8.2.3
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160914092903.GA2663%40sandhya.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: speakup: i18n: Use x instead of x != NULL.
2016-09-14 9:33 ` [Outreachy kernel] " Julia Lawall
@ 2016-09-14 9:38 ` Vaishali Thakkar
0 siblings, 0 replies; 3+ messages in thread
From: Vaishali Thakkar @ 2016-09-14 9:38 UTC (permalink / raw)
To: Julia Lawall; +Cc: Sandhya Bankar, outreachy-kernel
On Wed, Sep 14, 2016 at 3:03 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Wed, 14 Sep 2016, Sandhya Bankar wrote:
>
>> Use x instead of x != NULL.
>> The patch removes the explicit NULL comparisons.This patch is detected by checkpatch.pl.
Again line with more than 80 characters. Also, this should come as v2. Changes
should be written under ---. Please look at other patches and tutorial
about sending
revised patches.
> Please always put at least one space after the end of a sentence, if i is
> followed by another one.
>
>>
>> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
>> ---
>> drivers/staging/speakup/i18n.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c
>> index 8960079..41b56d6 100644
>> --- a/drivers/staging/speakup/i18n.c
>> +++ b/drivers/staging/speakup/i18n.c
>> @@ -407,9 +407,9 @@ static char *next_specifier(char *input)
>> int found = 0;
>> char *next_percent = input;
>>
>> - while ((next_percent != NULL) && !found) {
>> + while ((next_percent) && !found) {
>
> You could really drop the parentheses at the same time. They were not
> necessary before, but they are even less necessary when only a single
> variable is involved.
>
> julia
>
>> next_percent = strchr(next_percent, '%');
>> - if (next_percent != NULL) {
>> + if (next_percent) {
>> /* skip over doubled percent signs */
>> while ((next_percent[0] == '%')
>> && (next_percent[1] == '%'))
>> --
>> 1.8.2.3
>>
>> --
>> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160914092903.GA2663%40sandhya.
>> For more options, visit https://groups.google.com/d/optout.
>>
--
Vaishali
http://vaishalithakkar.in/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-14 9:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-14 9:29 [PATCH] Staging: speakup: i18n: Use x instead of x != NULL Sandhya Bankar
2016-09-14 9:33 ` [Outreachy kernel] " Julia Lawall
2016-09-14 9:38 ` Vaishali Thakkar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.