Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729281 > unrolled thread

[PATCH 3/3] [media] s5p-mfc: Adjust a null pointer check in four functions

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-09-08 23:00 +0200
Last post2017-09-12 22:40 +0200
Articles 7 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] [media] s5p-mfc: Adjust a null pointer check in four  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-08 23:00 +0200
    Re: [PATCH 3/3] [media] s5p-mfc: Adjust a null pointer check in  four functions Sylwester Nawrocki <s.nawrocki@samsung.com> - 2017-09-11 11:30 +0200
      Re: [media] s5p-mfc: Adjust a null pointer check in four functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-11 21:30 +0200
        Re: [media] s5p-mfc: Adjust a null pointer check in four functions Sylwester Nawrocki <s.nawrocki@samsung.com> - 2017-09-12 15:30 +0200
          Re: [media] s5p-mfc: Adjust a null pointer check in four functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-12 17:10 +0200
            Re: [media] s5p-mfc: Adjust a null pointer check in four functions Sylwester Nawrocki <s.nawrocki@samsung.com> - 2017-09-12 19:50 +0200
              Re: [media] s5p-mfc: Adjust a null pointer check in four functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-12 22:40 +0200

#1729281 — [PATCH 3/3] [media] s5p-mfc: Adjust a null pointer check in four functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-08 23:00 +0200
Subject[PATCH 3/3] [media] s5p-mfc: Adjust a null pointer check in four functions
Message-ID<unyxA-3Kx-3@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Sep 2017 22:37:00 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written …

Thus fix the affected source code places.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index abfb70b07032..cf68aed59e0d 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -470,7 +470,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev,
 {
 	mfc_err("Interrupt Error: %08x\n", err);
 
-	if (ctx != NULL) {
+	if (ctx) {
 		/* Error recovery is dependent on the state of context */
 		switch (ctx->state) {
 		case MFCINST_RES_CHANGE_INIT:
@@ -508,7 +508,7 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx,
 {
 	struct s5p_mfc_dev *dev;
 
-	if (ctx == NULL)
+	if (!ctx)
 		return;
 	dev = ctx->dev;
 	if (ctx->c_ops->post_seq_start) {
@@ -562,7 +562,7 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx,
 	struct s5p_mfc_buf *src_buf;
 	struct s5p_mfc_dev *dev;
 
-	if (ctx == NULL)
+	if (!ctx)
 		return;
 	dev = ctx->dev;
 	s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
@@ -1289,7 +1289,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
 		return PTR_ERR(dev->regs_base);
 
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (res == NULL) {
+	if (!res) {
 		dev_err(&pdev->dev, "failed to get irq resource\n");
 		return -ENOENT;
 	}
-- 
2.14.1

[toc] | [next] | [standalone]


#1730229 — Re: [PATCH 3/3] [media] s5p-mfc: Adjust a null pointer check in four functions

FromSylwester Nawrocki <s.nawrocki@samsung.com>
Date2017-09-11 11:30 +0200
SubjectRe: [PATCH 3/3] [media] s5p-mfc: Adjust a null pointer check in four functions
Message-ID<uotct-10h-1@gated-at.bofh.it>
In reply to#1729281
On 09/08/2017 10:53 PM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>

> Date: Fri, 8 Sep 2017 22:37:00 +0200
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit

Can you resend with that 4 lines removed? Are you using git send-email
for sending patches?

--
Thanks,
Sylwester

[toc] | [prev] | [next] | [standalone]


#1730486 — Re: [media] s5p-mfc: Adjust a null pointer check in four functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-11 21:30 +0200
SubjectRe: [media] s5p-mfc: Adjust a null pointer check in four functions
Message-ID<uoCz7-7At-3@gated-at.bofh.it>
In reply to#1730229
>> Date: Fri, 8 Sep 2017 22:37:00 +0200
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
> 
> Can you resend with that 4 lines removed?

* Do you care to preserve an information like the author date?

* Would you like to support special characters in the commit message?


> Are you using git send-email for sending patches?

Not so far.

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1730856 — Re: [media] s5p-mfc: Adjust a null pointer check in four functions

FromSylwester Nawrocki <s.nawrocki@samsung.com>
Date2017-09-12 15:30 +0200
SubjectRe: [media] s5p-mfc: Adjust a null pointer check in four functions
Message-ID<uoTqi-1O7-5@gated-at.bofh.it>
In reply to#1730486
On 09/11/2017 09:21 PM, SF Markus Elfring wrote:
>>> Date: Fri, 8 Sep 2017 22:37:00 +0200
>>> MIME-Version: 1.0
>>> Content-Type: text/plain; charset=UTF-8
>>> Content-Transfer-Encoding: 8bit
>>
>> Can you resend with that 4 lines removed?
> 
> * Do you care to preserve an information like the author date?

In this case not, but actually the Date line is not an issue.  Anyway
the patch is malformed, please try to save your posted patch and apply
with git am and see how finally the commit message looks like.

> * Would you like to support special characters in the commit message?

I can't see any need for special characters in the patch itself.
Please submit the patch in a way that it can be applied properly with
patchwork client (or git am).

>> Are you using git send-email for sending patches?
> 
> Not so far.

I would suggest switching to git send-email, then issues like
above could be easily avoided.

--
Regards,
Sylwester

[toc] | [prev] | [next] | [standalone]


#1730896 — Re: [media] s5p-mfc: Adjust a null pointer check in four functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-12 17:10 +0200
SubjectRe: [media] s5p-mfc: Adjust a null pointer check in four functions
Message-ID<uoUZ4-2RK-13@gated-at.bofh.it>
In reply to#1730856
>> * Do you care to preserve an information like the author date?
>
> In this case not, but actually the Date line is not an issue.

Thanks for your information.

It seems then that you quoted a line too much.


> Anyway the patch is malformed, …

I have got doubts for this view because the file was automatically generated
by the command “git format-patch” also for the discussed three update steps.

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1731126 — Re: [media] s5p-mfc: Adjust a null pointer check in four functions

FromSylwester Nawrocki <s.nawrocki@samsung.com>
Date2017-09-12 19:50 +0200
SubjectRe: [media] s5p-mfc: Adjust a null pointer check in four functions
Message-ID<uoXtW-4mv-15@gated-at.bofh.it>
In reply to#1730896
On 09/12/2017 05:00 PM, SF Markus Elfring wrote:
>>> * Do you care to preserve an information like the author date?
>> In this case not, but actually the Date line is not an issue.
> Thanks for your information.
> 
> It seems then that you quoted a line too much.
>  
>> Anyway the patch is malformed, …
 >
> I have got doubts for this view because the file was automatically generated
> by the command “git format-patch” also for the discussed three update steps.

Generating patch is only part of the story, it seems the patch is not sent
properly and tags which should be in SMTP header end up in the message
body. I think there would not be such issues if you have used git format-patch
+ git send-email.

I normally do amend things like this while applying, I will do that this time 
as well. It's already too much time wasted for such a dubious patch.

-- 
Thanks,
Sylwester

[toc] | [prev] | [next] | [standalone]


#1731227 — Re: [media] s5p-mfc: Adjust a null pointer check in four functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-12 22:40 +0200
SubjectRe: [media] s5p-mfc: Adjust a null pointer check in four functions
Message-ID<up08q-66t-13@gated-at.bofh.it>
In reply to#1731126
> Generating patch is only part of the story,

I can follow this view in principle.


> it seems the patch is not sent properly

I got an other impression.


> and tags which should be in SMTP header end up in the message body.

I agree that extra message fields were presented by the git software for
a reason.
You might have got other opinions about the original reason (than me).


> I think there would not be such issues if you have used git
> format-patch + git send-email.

I have got also doubts about your corresponding expectations when you
would find
the proposed commit message itself acceptable (besides the small source
code changes).


> I normally do amend things like this while applying,

That is interesting.


> I will do that this time as well.

Such an action can also be nice.


> It's already too much time wasted for such a dubious patch.

A bit of time is needed to resolve a temporary disagreement.

Regards,
Markus

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web