The patch number 9261 was added via Steven Toth <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Steven Toth  <[EMAIL PROTECTED]>
xc5000: Checkpatch compliance


xc5000: Checkpatch compliance

Priority: normal

Signed-off-by: Steven Toth <[EMAIL PROTECTED]>


---

 linux/drivers/media/common/tuners/xc5000.c |   73 ++++++++++-----------
 linux/drivers/media/common/tuners/xc5000.h |    8 +-
 2 files changed, 41 insertions(+), 40 deletions(-)

diff -r e01359e49639 -r 47436fd5f6c4 linux/drivers/media/common/tuners/xc5000.c
--- a/linux/drivers/media/common/tuners/xc5000.c        Thu Oct 16 19:28:32 
2008 -0400
+++ b/linux/drivers/media/common/tuners/xc5000.c        Thu Oct 16 19:29:38 
2008 -0400
@@ -43,7 +43,7 @@ static DEFINE_MUTEX(xc5000_list_mutex);
 static DEFINE_MUTEX(xc5000_list_mutex);
 static LIST_HEAD(hybrid_tuner_instance_list);
 
-#define dprintk(level,fmt, arg...) if (debug >= level) \
+#define dprintk(level, fmt, arg...) if (debug >= level) \
        printk(KERN_INFO "%s: " fmt, "xc5000", ## arg)
 
 #define XC5000_DEFAULT_FIRMWARE "dvb-fe-xc5000-1.1.fw"
@@ -138,11 +138,11 @@ struct xc5000_priv {
    immediately the length of the following transaction.
 
 */
-typedef struct {
+struct XC_TV_STANDARD {
        char *Name;
        u16 AudioMode;
        u16 VideoMode;
-} XC_TV_STANDARD;
+};
 
 /* Tuner standards */
 #define MN_NTSC_PAL_BTSC       0
@@ -169,7 +169,7 @@ typedef struct {
 #define FM_Radio_INPUT2        21
 #define FM_Radio_INPUT1        22
 
-static XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
+static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
        {"M/N-NTSC/PAL-BTSC", 0x0400, 0x8020},
        {"M/N-NTSC/PAL-A2",   0x0600, 0x8020},
        {"M/N-NTSC/PAL-EIAJ", 0x0440, 0x8020},
@@ -183,7 +183,7 @@ static XC_TV_STANDARD XC5000_Standard[MA
        {"D/K-PAL-NICAM",     0x0E80, 0x8009},
        {"D/K-PAL-MONO",      0x1478, 0x8009},
        {"D/K-SECAM-A2 DK1",  0x1200, 0x8009},
-       {"D/K-SECAM-A2 L/DK3",0x0E00, 0x8009},
+       {"D/K-SECAM-A2 L/DK3", 0x0E00, 0x8009},
        {"D/K-SECAM-A2 MONO", 0x1478, 0x8009},
        {"L-SECAM-NICAM",     0x8E82, 0x0009},
        {"L'-SECAM-NICAM",    0x8E82, 0x4009},
@@ -307,9 +307,10 @@ static int xc_load_i2c_sequence(struct d
        unsigned int len, pos, index;
        u8 buf[XC_MAX_I2C_WRITE_LENGTH];
 
-       index=0;
-       while ((i2c_sequence[index]!=0xFF) || (i2c_sequence[index+1]!=0xFF)) {
-               len = i2c_sequence[index]* 256 + i2c_sequence[index+1];
+       index = 0;
+       while ((i2c_sequence[index] != 0xFF) ||
+               (i2c_sequence[index + 1] != 0xFF)) {
+               len = i2c_sequence[index] * 256 + i2c_sequence[index+1];
                if (len == 0x0000) {
                        /* RESET command */
                        result = xc_reset(fe);
@@ -329,15 +330,17 @@ static int xc_load_i2c_sequence(struct d
                        buf[1] = i2c_sequence[index + 1];
                        pos = 2;
                        while (pos < len) {
-                               if ((len - pos) > XC_MAX_I2C_WRITE_LENGTH - 2) {
-                                       nbytes_to_send = 
XC_MAX_I2C_WRITE_LENGTH;
-                               } else {
+                               if ((len - pos) > XC_MAX_I2C_WRITE_LENGTH - 2)
+                                       nbytes_to_send =
+                                               XC_MAX_I2C_WRITE_LENGTH;
+                               else
                                        nbytes_to_send = (len - pos + 2);
+                               for (i = 2; i < nbytes_to_send; i++) {
+                                       buf[i] = i2c_sequence[index + pos +
+                                               i - 2];
                                }
-                               for (i=2; i<nbytes_to_send; i++) {
-                                       buf[i] = i2c_sequence[index + pos + i - 
2];
-                               }
-                               result = xc_send_i2c_data(priv, buf, 
nbytes_to_send);
+                               result = xc_send_i2c_data(priv, buf,
+                                       nbytes_to_send);
 
                                if (result != XC_RESULT_SUCCESS)
                                        return result;
@@ -386,8 +389,7 @@ static int xc_SetSignalSource(struct xc5
        dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode,
                rf_mode == XC_RF_MODE_AIR ? "ANTENNA" : "CABLE");
 
-       if ((rf_mode != XC_RF_MODE_AIR) && (rf_mode != XC_RF_MODE_CABLE))
-       {
+       if ((rf_mode != XC_RF_MODE_AIR) && (rf_mode != XC_RF_MODE_CABLE)) {
                rf_mode = XC_RF_MODE_CABLE;
                printk(KERN_ERR
                        "%s(), Invalid mode, defaulting to CABLE",
@@ -579,13 +581,13 @@ static int xc5000_readregs(struct xc5000
                .flags = I2C_M_RD, .buf = buf, .len = len };
 
        if (i2c_transfer(priv->i2c_props.adap, &msg, 1) != 1) {
-               printk(KERN_ERR "xc5000 I2C read failed (len=%i)\n",(int)len);
+               printk(KERN_ERR "xc5000 I2C read failed (len=%i)\n", (int)len);
                return -EREMOTEIO;
        }
        return 0;
 }
 
-static int xc5000_fwupload(struct dvb_frontend* fe)
+static int xc5000_fwupload(struct dvb_frontend *fe)
 {
        struct xc5000_priv *priv = fe->tuner_priv;
        const struct firmware *fw;
@@ -595,7 +597,8 @@ static int xc5000_fwupload(struct dvb_fr
        printk(KERN_INFO "xc5000: waiting for firmware upload (%s)...\n",
                XC5000_DEFAULT_FIRMWARE);
 
-       ret = request_firmware(&fw, XC5000_DEFAULT_FIRMWARE, 
&priv->i2c_props.adap->dev);
+       ret = request_firmware(&fw, XC5000_DEFAULT_FIRMWARE,
+               &priv->i2c_props.adap->dev);
        if (ret) {
                printk(KERN_ERR "xc5000: Upload failed. (file not found?)\n");
                ret = XC_RESULT_RESET_FAILURE;
@@ -611,7 +614,7 @@ static int xc5000_fwupload(struct dvb_fr
                ret = XC_RESULT_RESET_FAILURE;
        } else {
                printk(KERN_INFO "xc5000: firmware upload\n");
-               ret = xc_load_i2c_sequence(fe,  fw->data );
+               ret = xc_load_i2c_sequence(fe,  fw->data);
        }
 
 out:
@@ -670,7 +673,7 @@ static int xc5000_set_params(struct dvb_
 
        dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency);
 
-       switch(params->u.vsb.modulation) {
+       switch (params->u.vsb.modulation) {
        case VSB_8:
        case VSB_16:
                dprintk(1, "%s() VSB modulation\n", __func__);
@@ -767,42 +770,42 @@ static int xc5000_set_analog_params(stru
        /* FIX ME: Some video standards may have several possible audio
                   standards. We simply default to one of them here.
         */
-       if(params->std & V4L2_STD_MN) {
+       if (params->std & V4L2_STD_MN) {
                /* default to BTSC audio standard */
                priv->video_standard = MN_NTSC_PAL_BTSC;
                goto tune_channel;
        }
 
-       if(params->std & V4L2_STD_PAL_BG) {
+       if (params->std & V4L2_STD_PAL_BG) {
                /* default to NICAM audio standard */
                priv->video_standard = BG_PAL_NICAM;
                goto tune_channel;
        }
 
-       if(params->std & V4L2_STD_PAL_I) {
+       if (params->std & V4L2_STD_PAL_I) {
                /* default to NICAM audio standard */
                priv->video_standard = I_PAL_NICAM;
                goto tune_channel;
        }
 
-       if(params->std & V4L2_STD_PAL_DK) {
+       if (params->std & V4L2_STD_PAL_DK) {
                /* default to NICAM audio standard */
                priv->video_standard = DK_PAL_NICAM;
                goto tune_channel;
        }
 
-       if(params->std & V4L2_STD_SECAM_DK) {
+       if (params->std & V4L2_STD_SECAM_DK) {
                /* default to A2 DK1 audio standard */
                priv->video_standard = DK_SECAM_A2DK1;
                goto tune_channel;
        }
 
-       if(params->std & V4L2_STD_SECAM_L) {
+       if (params->std & V4L2_STD_SECAM_L) {
                priv->video_standard = L_SECAM_NICAM;
                goto tune_channel;
        }
 
-       if(params->std & V4L2_STD_SECAM_LC) {
+       if (params->std & V4L2_STD_SECAM_LC) {
                priv->video_standard = LC_SECAM_NICAM;
                goto tune_channel;
        }
@@ -810,7 +813,7 @@ tune_channel:
 tune_channel:
        ret = xc_SetSignalSource(priv, priv->rf_mode);
        if (ret != XC_RESULT_SUCCESS) {
-       printk(KERN_ERR
+               printk(KERN_ERR
                        "xc5000: xc_SetSignalSource(%d) failed\n",
                        priv->rf_mode);
                return -EREMOTEIO;
@@ -882,7 +885,7 @@ static int xc_load_fw_and_init_tuner(str
         * I2C transactions until calibration is complete.  This way we
         * don't have to rely on clock stretching working.
         */
-       xc_wait( 100 );
+       xc_wait(100);
 
        /* Default to "CABLE" mode */
        ret |= xc_write_reg(priv, XREG_SIGNALSOURCE, XC_RF_MODE_CABLE);
@@ -904,15 +907,13 @@ static int xc5000_sleep(struct dvb_front
         */
 
        ret = xc_shutdown(priv);
-       if(ret != XC_RESULT_SUCCESS) {
+       if (ret != XC_RESULT_SUCCESS) {
                printk(KERN_ERR
                        "xc5000: %s() unable to shutdown tuner\n",
                        __func__);
                return -EREMOTEIO;
-       }
-       else {
+       } else
                return XC_RESULT_SUCCESS;
-       }
 }
 
 static int xc5000_init(struct dvb_frontend *fe)
@@ -1008,7 +1009,7 @@ struct dvb_frontend *xc5000_attach(struc
        if (xc5000_readreg(priv, XREG_PRODUCT_ID, &id) != 0)
                goto fail;
 
-       switch(id) {
+       switch (id) {
        case XC_PRODUCT_ID_FW_LOADED:
                printk(KERN_INFO
                        "xc5000: Successfully identified at address 0x%02x\n",
diff -r e01359e49639 -r 47436fd5f6c4 linux/drivers/media/common/tuners/xc5000.h
--- a/linux/drivers/media/common/tuners/xc5000.h        Thu Oct 16 19:28:32 
2008 -0400
+++ b/linux/drivers/media/common/tuners/xc5000.h        Thu Oct 16 19:29:38 
2008 -0400
@@ -45,17 +45,17 @@ struct xc5000_config {
 
 #if defined(CONFIG_MEDIA_TUNER_XC5000) || \
     (defined(CONFIG_MEDIA_TUNER_XC5000_MODULE) && defined(MODULE))
-extern struct dvb_frontend* xc5000_attach(struct dvb_frontend *fe,
+extern struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
                                          struct i2c_adapter *i2c,
                                          struct xc5000_config *cfg);
 #else
-static inline struct dvb_frontend* xc5000_attach(struct dvb_frontend *fe,
+static inline struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
                                                 struct i2c_adapter *i2c,
                                                 struct xc5000_config *cfg)
 {
        printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
        return NULL;
 }
-#endif // CONFIG_MEDIA_TUNER_XC5000
+#endif
 
-#endif // __XC5000_H__
+#endif


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/47436fd5f6c4e4edf4d29fb2930233e18288676b

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to