Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1738063 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-09-23 21:50 +0200 |
| Last post | 2017-09-23 21:50 +0200 |
| Articles | 3 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/3] [media] camss-csid: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-23 21:50 +0200
[PATCH 3/3] [media] camss-csid: Adjust a null pointer check in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-23 21:50 +0200
[PATCH 2/3] [media] camss-csid: Reduce the scope for a variable in csid_set_power() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-23 21:50 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-23 21:50 +0200 |
| Subject | [PATCH 0/3] [media] camss-csid: Fine-tuning for three function implementations |
| Message-ID | <usYB4-7fq-9@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Sat, 23 Sep 2017 21:24:56 +0200 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Use common error handling code in csid_set_power() Reduce the scope for a variable in csid_set_power() Adjust a null pointer check in two functions .../media/platform/qcom/camss-8x16/camss-csid.c | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.14.1
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-23 21:50 +0200 |
| Subject | [PATCH 3/3] [media] camss-csid: Adjust a null pointer check in two functions |
| Message-ID | <usYB4-7fq-13@gated-at.bofh.it> |
| In reply to | #1738063 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Sat, 23 Sep 2017 21:10:02 +0200 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written "!format" Thus fix the affected source code places. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/media/platform/qcom/camss-8x16/camss-csid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss-8x16/camss-csid.c b/drivers/media/platform/qcom/camss-8x16/camss-csid.c index ffda0fbfe4d8..e546f97fa68c 100644 --- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c +++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c @@ -653,4 +653,4 @@ static int csid_get_format(struct v4l2_subdev *sd, - if (format == NULL) + if (!format) return -EINVAL; fmt->format = *format; @@ -677,4 +677,4 @@ static int csid_set_format(struct v4l2_subdev *sd, - if (format == NULL) + if (!format) return -EINVAL; csid_try_format(csid, cfg, fmt->pad, &fmt->format, fmt->which); -- 2.14.1
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-09-23 21:50 +0200 |
| Subject | [PATCH 2/3] [media] camss-csid: Reduce the scope for a variable in csid_set_power() |
| Message-ID | <usYB4-7fq-15@gated-at.bofh.it> |
| In reply to | #1738063 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 23 Sep 2017 21:00:30 +0200
Move the definition for the local variable "dev" into an if branch
so that the corresponding setting will only be performed if it was
selected by the parameter "on" of this function.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/platform/qcom/camss-8x16/camss-csid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/camss-8x16/camss-csid.c b/drivers/media/platform/qcom/camss-8x16/camss-csid.c
index 92d4dc6b4a66..ffda0fbfe4d8 100644
--- a/drivers/media/platform/qcom/camss-8x16/camss-csid.c
+++ b/drivers/media/platform/qcom/camss-8x16/camss-csid.c
@@ -317,10 +317,10 @@ static int csid_reset(struct csid_device *csid)
static int csid_set_power(struct v4l2_subdev *sd, int on)
{
struct csid_device *csid = v4l2_get_subdevdata(sd);
- struct device *dev = to_device_index(csid, csid->id);
int ret;
if (on) {
+ struct device *dev = to_device_index(csid, csid->id);
u32 hw_version;
ret = regulator_enable(csid->vdda);
--
2.14.1
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web