2024-03-03 19:21:04

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 0/9] staging: media: av7110: These patches address various code style and formatting issues in the av7110 driver

The following patches fix a number of code style issues identified by
checkpatch in the av7110 driver.

Jonathan Bergh (9):
staging: media: av7110: Fix formatting problem where trailing statements
should be on a new line
staging: media: av7110: Remove braces for single line statement blocks
staging: media: av7110: Remove spaces between function name and
opening parenthesis
staging: media: av7110: Fix formatting of pointers to meet coding
style guidelines
staging: media: av7110: Fix block comments to meet code style
guidelines
staging: media: av7110: Remove extra whitespace before opening '['s
staging: media: av7110: Remove extra whitespace before ','
staging: media: av7110: Ensure whitespace ahead of opening brace '{'
staging: media: av7110: Ensure newline after variable declarations

drivers/staging/media/av7110/sp8870.c | 136 +++++++++++++-------------
1 file changed, 70 insertions(+), 66 deletions(-)

--
2.40.1



2024-03-03 19:21:18

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 1/9] staging: media: av7110: Fix formatting problem where trailing statements should be on a new line

This patch makes the following change:
* Ensures trailing statements are always on a new line as per kernel
code style guidelines

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index abf5c72607b6..83685443976d 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -248,7 +248,8 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
// set tuner parameters
if (fe->ops.tuner_ops.set_params) {
fe->ops.tuner_ops.set_params(fe);
- if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
+ if (fe->ops.i2c_gate_ctrl)
+ fe->ops.i2c_gate_ctrl(fe, 0);
}

// sample rate correction bit [23..17]
@@ -296,7 +297,8 @@ static int sp8870_init (struct dvb_frontend* fe)
const struct firmware *fw = NULL;

sp8870_wake_up(state);
- if (state->initialised) return 0;
+ if (state->initialised)
+ return 0;
state->initialised = 1;

dprintk ("%s\n", __func__);
@@ -549,7 +551,8 @@ struct dvb_frontend* sp8870_attach(const struct sp8870_config* config,

/* allocate memory for the internal state */
state = kzalloc(sizeof(struct sp8870_state), GFP_KERNEL);
- if (state == NULL) goto error;
+ if (state == NULL)
+ goto error;

/* setup the state */
state->config = config;
@@ -557,7 +560,8 @@ struct dvb_frontend* sp8870_attach(const struct sp8870_config* config,
state->initialised = 0;

/* check if the demod is there */
- if (sp8870_readreg(state, 0x0200) < 0) goto error;
+ if (sp8870_readreg(state, 0x0200) < 0)
+ goto error;

/* create dvb_frontend */
memcpy(&state->frontend.ops, &sp8870_ops, sizeof(struct dvb_frontend_ops));
--
2.40.1


2024-03-03 19:21:30

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 2/9] staging: media: av7110: Remove braces for single line statement blocks

This patch fixes the following issues:
* Removes braces for single statement conditional code blocks

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index 83685443976d..2c30582191d4 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -529,11 +529,10 @@ static int sp8870_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
{
struct sp8870_state* state = fe->demodulator_priv;

- if (enable) {
+ if (enable)
return sp8870_writereg(state, 0x206, 0x001);
- } else {
+ else
return sp8870_writereg(state, 0x206, 0x000);
- }
}

static void sp8870_release(struct dvb_frontend* fe)
--
2.40.1


2024-03-03 19:21:47

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 3/9] staging: media: av7110: Remove spaces between function name and opening parenthesis

This patch fixes the following code formatting issue:
* Removes extra whitespace between function name and opening parenthesis

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 42 +++++++++++++--------------
1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index 2c30582191d4..1f6c02744b6c 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -50,21 +50,21 @@ static int debug;
/* starting point for firmware in file 'Sc_main.mc' */
#define SP8870_FIRMWARE_OFFSET 0x0A

-static int sp8870_writereg (struct sp8870_state* state, u16 reg, u16 data)
+static int sp8870_writereg(struct sp8870_state* state, u16 reg, u16 data)
{
u8 buf [] = { reg >> 8, reg & 0xff, data >> 8, data & 0xff };
struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 4 };
int err;

- if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) {
- dprintk ("%s: writereg error (err == %i, reg == 0x%02x, data == 0x%02x)\n", __func__, err, reg, data);
+ if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
+ dprintk("%s: writereg error (err == %i, reg == 0x%02x, data == 0x%02x)\n", __func__, err, reg, data);
return -EREMOTEIO;
}

return 0;
}

-static int sp8870_readreg (struct sp8870_state* state, u16 reg)
+static int sp8870_readreg(struct sp8870_state* state, u16 reg)
{
int ret;
u8 b0 [] = { reg >> 8 , reg & 0xff };
@@ -72,7 +72,7 @@ static int sp8870_readreg (struct sp8870_state* state, u16 reg)
struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 2 },
{ .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 2 } };

- ret = i2c_transfer (state->i2c, msg, 2);
+ ret = i2c_transfer(state->i2c, msg, 2);

if (ret != 2) {
dprintk("%s: readreg error (ret == %i)\n", __func__, ret);
@@ -82,7 +82,7 @@ static int sp8870_readreg (struct sp8870_state* state, u16 reg)
return (b1[0] << 8 | b1[1]);
}

-static int sp8870_firmware_upload (struct sp8870_state* state, const struct firmware *fw)
+static int sp8870_firmware_upload(struct sp8870_state* state, const struct firmware *fw)
{
struct i2c_msg msg;
const char *fw_buf = fw->data;
@@ -91,7 +91,7 @@ static int sp8870_firmware_upload (struct sp8870_state* state, const struct firm
int tx_len;
int err = 0;

- dprintk ("%s: ...\n", __func__);
+ dprintk("%s: ...\n", __func__);

if (fw->size < SP8870_FIRMWARE_SIZE + SP8870_FIRMWARE_OFFSET)
return -EINVAL;
@@ -117,19 +117,19 @@ static int sp8870_firmware_upload (struct sp8870_state* state, const struct firm
msg.flags = 0;
msg.buf = tx_buf;
msg.len = tx_len + 2;
- if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) {
+ if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
printk("%s: firmware upload failed!\n", __func__);
- printk ("%s: i2c error (err == %i)\n", __func__, err);
+ printk("%s: i2c error (err == %i)\n", __func__, err);
return err;
}
fw_pos += tx_len;
}

- dprintk ("%s: done!\n", __func__);
+ dprintk("%s: done!\n", __func__);
return 0;
};

-static void sp8870_microcontroller_stop (struct sp8870_state* state)
+static void sp8870_microcontroller_stop(struct sp8870_state* state)
{
sp8870_writereg(state, 0x0F08, 0x000);
sp8870_writereg(state, 0x0F09, 0x000);
@@ -138,7 +138,7 @@ static void sp8870_microcontroller_stop (struct sp8870_state* state)
sp8870_writereg(state, 0x0F00, 0x000);
}

-static void sp8870_microcontroller_start (struct sp8870_state* state)
+static void sp8870_microcontroller_start(struct sp8870_state* state)
{
sp8870_writereg(state, 0x0F08, 0x000);
sp8870_writereg(state, 0x0F09, 0x000);
@@ -155,7 +155,7 @@ static int sp8870_read_data_valid_signal(struct sp8870_state* state)
return (sp8870_readreg(state, 0x0D02) > 0);
}

-static int configure_reg0xc05 (struct dtv_frontend_properties *p, u16 *reg0xc05)
+static int configure_reg0xc05(struct dtv_frontend_properties *p, u16 *reg0xc05)
{
int known_parameters = 1;

@@ -291,7 +291,7 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
return 0;
}

-static int sp8870_init (struct dvb_frontend* fe)
+static int sp8870_init(struct dvb_frontend* fe)
{
struct sp8870_state* state = fe->demodulator_priv;
const struct firmware *fw = NULL;
@@ -301,7 +301,7 @@ static int sp8870_init (struct dvb_frontend* fe)
return 0;
state->initialised = 1;

- dprintk ("%s\n", __func__);
+ dprintk("%s\n", __func__);


/* request the firmware, this will block until someone uploads it */
@@ -350,11 +350,11 @@ static int sp8870_read_status(struct dvb_frontend *fe,

*fe_status = 0;

- status = sp8870_readreg (state, 0x0200);
+ status = sp8870_readreg(state, 0x0200);
if (status < 0)
return -EIO;

- signal = sp8870_readreg (state, 0x0303);
+ signal = sp8870_readreg(state, 0x0303);
if (signal < 0)
return -EIO;

@@ -368,7 +368,7 @@ static int sp8870_read_status(struct dvb_frontend *fe,
return 0;
}

-static int sp8870_read_ber (struct dvb_frontend* fe, u32 * ber)
+static int sp8870_read_ber(struct dvb_frontend* fe, u32 * ber)
{
struct sp8870_state* state = fe->demodulator_priv;
int ret;
@@ -403,13 +403,13 @@ static int sp8870_read_signal_strength(struct dvb_frontend* fe, u16 * signal)

*signal = 0;

- ret = sp8870_readreg (state, 0x306);
+ ret = sp8870_readreg(state, 0x306);
if (ret < 0)
return -EIO;

tmp = ret << 8;

- ret = sp8870_readreg (state, 0x303);
+ ret = sp8870_readreg(state, 0x303);
if (ret < 0)
return -EIO;

@@ -421,7 +421,7 @@ static int sp8870_read_signal_strength(struct dvb_frontend* fe, u16 * signal)
return 0;
}

-static int sp8870_read_uncorrected_blocks (struct dvb_frontend* fe, u32* ublocks)
+static int sp8870_read_uncorrected_blocks(struct dvb_frontend* fe, u32* ublocks)
{
struct sp8870_state* state = fe->demodulator_priv;
int ret;
--
2.40.1


2024-03-03 19:21:58

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 4/9] staging: media: av7110: Fix formatting of pointers to meet coding style guidelines

This patch fixes the following code formatting issue:
* Ensure "foo* bar" is formatted as "foo *bar" as per code style rules

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 60 +++++++++++++--------------
1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index 1f6c02744b6c..5857fc8b0962 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -28,9 +28,9 @@

struct sp8870_state {

- struct i2c_adapter* i2c;
+ struct i2c_adapter *i2c;

- const struct sp8870_config* config;
+ const struct sp8870_config *config;

struct dvb_frontend frontend;

@@ -50,7 +50,7 @@ static int debug;
/* starting point for firmware in file 'Sc_main.mc' */
#define SP8870_FIRMWARE_OFFSET 0x0A

-static int sp8870_writereg(struct sp8870_state* state, u16 reg, u16 data)
+static int sp8870_writereg(struct sp8870_state *state, u16 reg, u16 data)
{
u8 buf [] = { reg >> 8, reg & 0xff, data >> 8, data & 0xff };
struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 4 };
@@ -64,7 +64,7 @@ static int sp8870_writereg(struct sp8870_state* state, u16 reg, u16 data)
return 0;
}

-static int sp8870_readreg(struct sp8870_state* state, u16 reg)
+static int sp8870_readreg(struct sp8870_state *state, u16 reg)
{
int ret;
u8 b0 [] = { reg >> 8 , reg & 0xff };
@@ -82,7 +82,7 @@ static int sp8870_readreg(struct sp8870_state* state, u16 reg)
return (b1[0] << 8 | b1[1]);
}

-static int sp8870_firmware_upload(struct sp8870_state* state, const struct firmware *fw)
+static int sp8870_firmware_upload(struct sp8870_state *state, const struct firmware *fw)
{
struct i2c_msg msg;
const char *fw_buf = fw->data;
@@ -129,7 +129,7 @@ static int sp8870_firmware_upload(struct sp8870_state* state, const struct firmw
return 0;
};

-static void sp8870_microcontroller_stop(struct sp8870_state* state)
+static void sp8870_microcontroller_stop(struct sp8870_state *state)
{
sp8870_writereg(state, 0x0F08, 0x000);
sp8870_writereg(state, 0x0F09, 0x000);
@@ -138,7 +138,7 @@ static void sp8870_microcontroller_stop(struct sp8870_state* state)
sp8870_writereg(state, 0x0F00, 0x000);
}

-static void sp8870_microcontroller_start(struct sp8870_state* state)
+static void sp8870_microcontroller_start(struct sp8870_state *state)
{
sp8870_writereg(state, 0x0F08, 0x000);
sp8870_writereg(state, 0x0F09, 0x000);
@@ -150,7 +150,7 @@ static void sp8870_microcontroller_start(struct sp8870_state* state)
sp8870_readreg(state, 0x0D01);
}

-static int sp8870_read_data_valid_signal(struct sp8870_state* state)
+static int sp8870_read_data_valid_signal(struct sp8870_state *state)
{
return (sp8870_readreg(state, 0x0D02) > 0);
}
@@ -226,7 +226,7 @@ static int configure_reg0xc05(struct dtv_frontend_properties *p, u16 *reg0xc05)
return 0;
}

-static int sp8870_wake_up(struct sp8870_state* state)
+static int sp8870_wake_up(struct sp8870_state *state)
{
// enable TS output and interface pins
return sp8870_writereg(state, 0xC18, 0x00D);
@@ -235,7 +235,7 @@ static int sp8870_wake_up(struct sp8870_state* state)
static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;
int err;
u16 reg0xc05;

@@ -291,9 +291,9 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)
return 0;
}

-static int sp8870_init(struct dvb_frontend* fe)
+static int sp8870_init(struct dvb_frontend *fe)
{
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;
const struct firmware *fw = NULL;

sp8870_wake_up(state);
@@ -344,7 +344,7 @@ static int sp8870_init(struct dvb_frontend* fe)
static int sp8870_read_status(struct dvb_frontend *fe,
enum fe_status *fe_status)
{
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;
int status;
int signal;

@@ -368,9 +368,9 @@ static int sp8870_read_status(struct dvb_frontend *fe,
return 0;
}

-static int sp8870_read_ber(struct dvb_frontend* fe, u32 * ber)
+static int sp8870_read_ber(struct dvb_frontend *fe, u32 *ber)
{
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;
int ret;
u32 tmp;

@@ -395,9 +395,9 @@ static int sp8870_read_ber(struct dvb_frontend* fe, u32 * ber)
return 0;
}

-static int sp8870_read_signal_strength(struct dvb_frontend* fe, u16 * signal)
+static int sp8870_read_signal_strength(struct dvb_frontend *fe, u16 *signal)
{
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;
int ret;
u16 tmp;

@@ -421,9 +421,9 @@ static int sp8870_read_signal_strength(struct dvb_frontend* fe, u16 * signal)
return 0;
}

-static int sp8870_read_uncorrected_blocks(struct dvb_frontend* fe, u32* ublocks)
+static int sp8870_read_uncorrected_blocks(struct dvb_frontend *fe, u32 *ublocks)
{
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;
int ret;

*ublocks = 0;
@@ -453,7 +453,7 @@ static int switches;
static int sp8870_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;

/*
The firmware of the sp8870 sometimes locks up after setting frontend parameters.
@@ -509,15 +509,15 @@ static int sp8870_set_frontend(struct dvb_frontend *fe)
return 0;
}

-static int sp8870_sleep(struct dvb_frontend* fe)
+static int sp8870_sleep(struct dvb_frontend *fe)
{
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;

// tristate TS output and disable interface pins
return sp8870_writereg(state, 0xC18, 0x000);
}

-static int sp8870_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)
+static int sp8870_get_tune_settings(struct dvb_frontend *fe, struct dvb_frontend_tune_settings *fesettings)
{
fesettings->min_delay_ms = 350;
fesettings->step_size = 0;
@@ -525,9 +525,9 @@ static int sp8870_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend
return 0;
}

-static int sp8870_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
+static int sp8870_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;

if (enable)
return sp8870_writereg(state, 0x206, 0x001);
@@ -535,18 +535,18 @@ static int sp8870_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
return sp8870_writereg(state, 0x206, 0x000);
}

-static void sp8870_release(struct dvb_frontend* fe)
+static void sp8870_release(struct dvb_frontend *fe)
{
- struct sp8870_state* state = fe->demodulator_priv;
+ struct sp8870_state *state = fe->demodulator_priv;
kfree(state);
}

static const struct dvb_frontend_ops sp8870_ops;

-struct dvb_frontend* sp8870_attach(const struct sp8870_config* config,
- struct i2c_adapter* i2c)
+struct dvb_frontend *sp8870_attach(const struct sp8870_config *config,
+ struct i2c_adapter *i2c)
{
- struct sp8870_state* state = NULL;
+ struct sp8870_state *state = NULL;

/* allocate memory for the internal state */
state = kzalloc(sizeof(struct sp8870_state), GFP_KERNEL);
--
2.40.1


2024-03-03 19:22:11

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 5/9] staging: media: av7110: Fix block comments to meet code style guidelines

This patch does the following things:
* Ensure * for block comments are aligned

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index 5857fc8b0962..65795c5a01f9 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
- Driver for Spase SP8870 demodulator
-
- Copyright (C) 1999 Juergen Peitz
-
-
-*/
+ * Driver for Spase SP8870 demodulator
+ *
+ * Copyright (C) 1999 Juergen Peitz
+ *
+ *
+ */
/*
* This driver needs external firmware. Please use the command
* "<kerneldir>/scripts/get_dvb_firmware alps_tdlb7" to
@@ -456,11 +456,11 @@ static int sp8870_set_frontend(struct dvb_frontend *fe)
struct sp8870_state *state = fe->demodulator_priv;

/*
- The firmware of the sp8870 sometimes locks up after setting frontend parameters.
- We try to detect this by checking the data valid signal.
- If it is not set after MAXCHECKS we try to recover the lockup by setting
- the frontend parameters again.
- */
+ * The firmware of the sp8870 sometimes locks up after setting frontend parameters.
+ * We try to detect this by checking the data valid signal.
+ * If it is not set after MAXCHECKS we try to recover the lockup by setting
+ * the frontend parameters again.
+ */

int err = 0;
int valid = 0;
--
2.40.1


2024-03-03 19:22:34

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 6/9] staging: media: av7110: Remove extra whitespace before opening '['s

This patch makes the following change:
* Removes extra whitespace before opening square brackets '['

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index 65795c5a01f9..a5a652c0b363 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -52,7 +52,7 @@ static int debug;

static int sp8870_writereg(struct sp8870_state *state, u16 reg, u16 data)
{
- u8 buf [] = { reg >> 8, reg & 0xff, data >> 8, data & 0xff };
+ u8 buf[] = { reg >> 8, reg & 0xff, data >> 8, data & 0xff };
struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 4 };
int err;

@@ -67,9 +67,9 @@ static int sp8870_writereg(struct sp8870_state *state, u16 reg, u16 data)
static int sp8870_readreg(struct sp8870_state *state, u16 reg)
{
int ret;
- u8 b0 [] = { reg >> 8 , reg & 0xff };
- u8 b1 [] = { 0, 0 };
- struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 2 },
+ u8 b0[] = { reg >> 8 , reg & 0xff };
+ u8 b1[] = { 0, 0 };
+ struct i2c_msg msg[] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 2 },
{ .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 2 } };

ret = i2c_transfer(state->i2c, msg, 2);
--
2.40.1


2024-03-03 19:22:42

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 7/9] staging: media: av7110: Remove extra whitespace before ','

This patch fixes the following code style issue:
* Removes extra whitespace before comma ',' in parameter list

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index a5a652c0b363..8afddf61e52b 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -67,7 +67,7 @@ static int sp8870_writereg(struct sp8870_state *state, u16 reg, u16 data)
static int sp8870_readreg(struct sp8870_state *state, u16 reg)
{
int ret;
- u8 b0[] = { reg >> 8 , reg & 0xff };
+ u8 b0[] = { reg >> 8, reg & 0xff };
u8 b1[] = { 0, 0 };
struct i2c_msg msg[] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 2 },
{ .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 2 } };
--
2.40.1


2024-03-03 19:22:57

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 8/9] staging: media: av7110: Ensure whitespace ahead of opening brace '{'

This patch addresses the following code style issue:
* Ensure a single whitespace ahead of an opening brace '{'

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index 8afddf61e52b..a3c7660c5092 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -107,7 +107,7 @@ static int sp8870_firmware_upload(struct sp8870_state *state, const struct firmw

// do firmware upload
fw_pos = SP8870_FIRMWARE_OFFSET;
- while (fw_pos < SP8870_FIRMWARE_SIZE + SP8870_FIRMWARE_OFFSET){
+ while (fw_pos < SP8870_FIRMWARE_SIZE + SP8870_FIRMWARE_OFFSET) {
tx_len = (fw_pos <= SP8870_FIRMWARE_SIZE + SP8870_FIRMWARE_OFFSET - 252) ? 252 : SP8870_FIRMWARE_SIZE + SP8870_FIRMWARE_OFFSET - fw_pos;
// write register 0xCF0A
tx_buf[0] = 0xCF;
--
2.40.1


2024-03-03 19:23:13

by Jonathan Bergh

[permalink] [raw]
Subject: [PATCH 9/9] staging: media: av7110: Ensure newline after variable declarations

This patch makes the following change:
* Ensure a newline after variable declarations

Signed-off-by: Jonathan Bergh <[email protected]>
---
drivers/staging/media/av7110/sp8870.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/av7110/sp8870.c b/drivers/staging/media/av7110/sp8870.c
index a3c7660c5092..f652c8d7d2ee 100644
--- a/drivers/staging/media/av7110/sp8870.c
+++ b/drivers/staging/media/av7110/sp8870.c
@@ -538,6 +538,7 @@ static int sp8870_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
static void sp8870_release(struct dvb_frontend *fe)
{
struct sp8870_state *state = fe->demodulator_priv;
+
kfree(state);
}

--
2.40.1


2024-04-24 09:34:20

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH 0/9] staging: media: av7110: These patches address various code style and formatting issues in the av7110 driver

Hi Jonathan,

On 03/03/2024 20:20, Jonathan Bergh wrote:
> The following patches fix a number of code style issues identified by
> checkpatch in the av7110 driver.
>
> Jonathan Bergh (9):
> staging: media: av7110: Fix formatting problem where trailing statements
> should be on a new line
> staging: media: av7110: Remove braces for single line statement blocks
> staging: media: av7110: Remove spaces between function name and
> opening parenthesis
> staging: media: av7110: Fix formatting of pointers to meet coding
> style guidelines
> staging: media: av7110: Fix block comments to meet code style
> guidelines
> staging: media: av7110: Remove extra whitespace before opening '['s
> staging: media: av7110: Remove extra whitespace before ','
> staging: media: av7110: Ensure whitespace ahead of opening brace '{'
> staging: media: av7110: Ensure newline after variable declarations
>
> drivers/staging/media/av7110/sp8870.c | 136 +++++++++++++-------------
> 1 file changed, 70 insertions(+), 66 deletions(-)
>

I'm sorry, but I will reject this series. This is an old driver that is
not under active development.

It is not worth the review effort I have to put into reviewing these
cleanup patches.

As the TODO file says:

- Cleanup patches for the drivers here won't be accepted.

I mentioned that before, so I'm not sure why you post another version
of cleanup patches.

Regards,

Hans