Commit 941a8204 authored by Ovidiu Toader's avatar Ovidiu Toader Committed by Mauro Carvalho Chehab

[media] staging/media/rtl2832u_sdr: fix coding style problems by adding blank lines

This minor patch fixes all WARNING:SPACING style warnings in rtl2832_sdr.c

The new version of the file pleases checkpatch.pl when run with "--ignore LONG_LINE".
Signed-off-by: default avatarOvidiu Toader <ovi@phas.ubc.ca>
Acked-by: default avatarAntti Palosaari <crope@iki.fi>
Reviewed-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 2abfeef6
...@@ -348,6 +348,7 @@ static unsigned int rtl2832_sdr_convert_stream(struct rtl2832_sdr_state *s, ...@@ -348,6 +348,7 @@ static unsigned int rtl2832_sdr_convert_stream(struct rtl2832_sdr_state *s,
/* convert u8 to u16 */ /* convert u8 to u16 */
unsigned int i; unsigned int i;
u16 *u16dst = dst; u16 *u16dst = dst;
for (i = 0; i < src_len; i++) for (i = 0; i < src_len; i++)
*u16dst++ = (src[i] << 8) | (src[i] >> 0); *u16dst++ = (src[i] << 8) | (src[i] >> 0);
dst_len = 2 * src_len; dst_len = 2 * src_len;
...@@ -359,6 +360,7 @@ static unsigned int rtl2832_sdr_convert_stream(struct rtl2832_sdr_state *s, ...@@ -359,6 +360,7 @@ static unsigned int rtl2832_sdr_convert_stream(struct rtl2832_sdr_state *s,
if (unlikely(time_is_before_jiffies(s->jiffies_next))) { if (unlikely(time_is_before_jiffies(s->jiffies_next))) {
#define MSECS 10000UL #define MSECS 10000UL
unsigned int samples = s->sample - s->sample_measured; unsigned int samples = s->sample - s->sample_measured;
s->jiffies_next = jiffies + msecs_to_jiffies(MSECS); s->jiffies_next = jiffies + msecs_to_jiffies(MSECS);
s->sample_measured = s->sample; s->sample_measured = s->sample;
dev_dbg(&s->udev->dev, dev_dbg(&s->udev->dev,
...@@ -560,11 +562,13 @@ static int rtl2832_sdr_alloc_urbs(struct rtl2832_sdr_state *s) ...@@ -560,11 +562,13 @@ static int rtl2832_sdr_alloc_urbs(struct rtl2832_sdr_state *s)
static void rtl2832_sdr_cleanup_queued_bufs(struct rtl2832_sdr_state *s) static void rtl2832_sdr_cleanup_queued_bufs(struct rtl2832_sdr_state *s)
{ {
unsigned long flags = 0; unsigned long flags = 0;
dev_dbg(&s->udev->dev, "%s:\n", __func__); dev_dbg(&s->udev->dev, "%s:\n", __func__);
spin_lock_irqsave(&s->queued_bufs_lock, flags); spin_lock_irqsave(&s->queued_bufs_lock, flags);
while (!list_empty(&s->queued_bufs)) { while (!list_empty(&s->queued_bufs)) {
struct rtl2832_sdr_frame_buf *buf; struct rtl2832_sdr_frame_buf *buf;
buf = list_entry(s->queued_bufs.next, buf = list_entry(s->queued_bufs.next,
struct rtl2832_sdr_frame_buf, list); struct rtl2832_sdr_frame_buf, list);
list_del(&buf->list); list_del(&buf->list);
...@@ -577,6 +581,7 @@ static void rtl2832_sdr_cleanup_queued_bufs(struct rtl2832_sdr_state *s) ...@@ -577,6 +581,7 @@ static void rtl2832_sdr_cleanup_queued_bufs(struct rtl2832_sdr_state *s)
static void rtl2832_sdr_release_sec(struct dvb_frontend *fe) static void rtl2832_sdr_release_sec(struct dvb_frontend *fe)
{ {
struct rtl2832_sdr_state *s = fe->sec_priv; struct rtl2832_sdr_state *s = fe->sec_priv;
dev_dbg(&s->udev->dev, "%s:\n", __func__); dev_dbg(&s->udev->dev, "%s:\n", __func__);
mutex_lock(&s->vb_queue_lock); mutex_lock(&s->vb_queue_lock);
...@@ -598,6 +603,7 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh, ...@@ -598,6 +603,7 @@ static int rtl2832_sdr_querycap(struct file *file, void *fh,
struct v4l2_capability *cap) struct v4l2_capability *cap)
{ {
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
dev_dbg(&s->udev->dev, "%s:\n", __func__); dev_dbg(&s->udev->dev, "%s:\n", __func__);
strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver)); strlcpy(cap->driver, KBUILD_MODNAME, sizeof(cap->driver));
...@@ -615,6 +621,7 @@ static int rtl2832_sdr_queue_setup(struct vb2_queue *vq, ...@@ -615,6 +621,7 @@ static int rtl2832_sdr_queue_setup(struct vb2_queue *vq,
unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[]) unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
{ {
struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq); struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq);
dev_dbg(&s->udev->dev, "%s: *nbuffers=%d\n", __func__, *nbuffers); dev_dbg(&s->udev->dev, "%s: *nbuffers=%d\n", __func__, *nbuffers);
/* Need at least 8 buffers */ /* Need at least 8 buffers */
...@@ -665,6 +672,7 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_state *s) ...@@ -665,6 +672,7 @@ static int rtl2832_sdr_set_adc(struct rtl2832_sdr_state *s)
u8 buf[4], u8tmp1, u8tmp2; u8 buf[4], u8tmp1, u8tmp2;
u64 u64tmp; u64 u64tmp;
u32 u32tmp; u32 u32tmp;
dev_dbg(&s->udev->dev, "%s: f_adc=%u\n", __func__, s->f_adc); dev_dbg(&s->udev->dev, "%s: f_adc=%u\n", __func__, s->f_adc);
if (!test_bit(POWER_ON, &s->flags)) if (!test_bit(POWER_ON, &s->flags))
...@@ -988,6 +996,7 @@ static int rtl2832_sdr_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -988,6 +996,7 @@ static int rtl2832_sdr_start_streaming(struct vb2_queue *vq, unsigned int count)
{ {
struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq); struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq);
int ret; int ret;
dev_dbg(&s->udev->dev, "%s:\n", __func__); dev_dbg(&s->udev->dev, "%s:\n", __func__);
if (!s->udev) if (!s->udev)
...@@ -1036,6 +1045,7 @@ static int rtl2832_sdr_start_streaming(struct vb2_queue *vq, unsigned int count) ...@@ -1036,6 +1045,7 @@ static int rtl2832_sdr_start_streaming(struct vb2_queue *vq, unsigned int count)
static void rtl2832_sdr_stop_streaming(struct vb2_queue *vq) static void rtl2832_sdr_stop_streaming(struct vb2_queue *vq)
{ {
struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq); struct rtl2832_sdr_state *s = vb2_get_drv_priv(vq);
dev_dbg(&s->udev->dev, "%s:\n", __func__); dev_dbg(&s->udev->dev, "%s:\n", __func__);
mutex_lock(&s->v4l2_lock); mutex_lock(&s->v4l2_lock);
...@@ -1069,6 +1079,7 @@ static int rtl2832_sdr_g_tuner(struct file *file, void *priv, ...@@ -1069,6 +1079,7 @@ static int rtl2832_sdr_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v) struct v4l2_tuner *v)
{ {
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
dev_dbg(&s->udev->dev, "%s: index=%d type=%d\n", dev_dbg(&s->udev->dev, "%s: index=%d type=%d\n",
__func__, v->index, v->type); __func__, v->index, v->type);
...@@ -1095,6 +1106,7 @@ static int rtl2832_sdr_s_tuner(struct file *file, void *priv, ...@@ -1095,6 +1106,7 @@ static int rtl2832_sdr_s_tuner(struct file *file, void *priv,
const struct v4l2_tuner *v) const struct v4l2_tuner *v)
{ {
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
dev_dbg(&s->udev->dev, "%s:\n", __func__); dev_dbg(&s->udev->dev, "%s:\n", __func__);
if (v->index > 1) if (v->index > 1)
...@@ -1106,6 +1118,7 @@ static int rtl2832_sdr_enum_freq_bands(struct file *file, void *priv, ...@@ -1106,6 +1118,7 @@ static int rtl2832_sdr_enum_freq_bands(struct file *file, void *priv,
struct v4l2_frequency_band *band) struct v4l2_frequency_band *band)
{ {
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d index=%d\n", dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d index=%d\n",
__func__, band->tuner, band->type, band->index); __func__, band->tuner, band->type, band->index);
...@@ -1131,6 +1144,7 @@ static int rtl2832_sdr_g_frequency(struct file *file, void *priv, ...@@ -1131,6 +1144,7 @@ static int rtl2832_sdr_g_frequency(struct file *file, void *priv,
{ {
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
int ret = 0; int ret = 0;
dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d\n", dev_dbg(&s->udev->dev, "%s: tuner=%d type=%d\n",
__func__, f->tuner, f->type); __func__, f->tuner, f->type);
...@@ -1194,6 +1208,7 @@ static int rtl2832_sdr_enum_fmt_sdr_cap(struct file *file, void *priv, ...@@ -1194,6 +1208,7 @@ static int rtl2832_sdr_enum_fmt_sdr_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f) struct v4l2_fmtdesc *f)
{ {
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
dev_dbg(&s->udev->dev, "%s:\n", __func__); dev_dbg(&s->udev->dev, "%s:\n", __func__);
if (f->index >= NUM_FORMATS) if (f->index >= NUM_FORMATS)
...@@ -1209,6 +1224,7 @@ static int rtl2832_sdr_g_fmt_sdr_cap(struct file *file, void *priv, ...@@ -1209,6 +1224,7 @@ static int rtl2832_sdr_g_fmt_sdr_cap(struct file *file, void *priv,
struct v4l2_format *f) struct v4l2_format *f)
{ {
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
dev_dbg(&s->udev->dev, "%s:\n", __func__); dev_dbg(&s->udev->dev, "%s:\n", __func__);
f->fmt.sdr.pixelformat = s->pixelformat; f->fmt.sdr.pixelformat = s->pixelformat;
...@@ -1223,6 +1239,7 @@ static int rtl2832_sdr_s_fmt_sdr_cap(struct file *file, void *priv, ...@@ -1223,6 +1239,7 @@ static int rtl2832_sdr_s_fmt_sdr_cap(struct file *file, void *priv,
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
struct vb2_queue *q = &s->vb_queue; struct vb2_queue *q = &s->vb_queue;
int i; int i;
dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__, dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__,
(char *)&f->fmt.sdr.pixelformat); (char *)&f->fmt.sdr.pixelformat);
...@@ -1248,6 +1265,7 @@ static int rtl2832_sdr_try_fmt_sdr_cap(struct file *file, void *priv, ...@@ -1248,6 +1265,7 @@ static int rtl2832_sdr_try_fmt_sdr_cap(struct file *file, void *priv,
{ {
struct rtl2832_sdr_state *s = video_drvdata(file); struct rtl2832_sdr_state *s = video_drvdata(file);
int i; int i;
dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__, dev_dbg(&s->udev->dev, "%s: pixelformat fourcc %4.4s\n", __func__,
(char *)&f->fmt.sdr.pixelformat); (char *)&f->fmt.sdr.pixelformat);
...@@ -1317,6 +1335,7 @@ static int rtl2832_sdr_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -1317,6 +1335,7 @@ static int rtl2832_sdr_s_ctrl(struct v4l2_ctrl *ctrl)
struct dvb_frontend *fe = s->fe; struct dvb_frontend *fe = s->fe;
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret; int ret;
dev_dbg(&s->udev->dev, dev_dbg(&s->udev->dev,
"%s: id=%d name=%s val=%d min=%d max=%d step=%d\n", "%s: id=%d name=%s val=%d min=%d max=%d step=%d\n",
__func__, ctrl->id, ctrl->name, ctrl->val, __func__, ctrl->id, ctrl->name, ctrl->val,
...@@ -1330,6 +1349,7 @@ static int rtl2832_sdr_s_ctrl(struct v4l2_ctrl *ctrl) ...@@ -1330,6 +1349,7 @@ static int rtl2832_sdr_s_ctrl(struct v4l2_ctrl *ctrl)
/* Round towards the closest legal value */ /* Round towards the closest legal value */
s32 val = s->f_adc + s->bandwidth->step / 2; s32 val = s->f_adc + s->bandwidth->step / 2;
u32 offset; u32 offset;
val = clamp(val, s->bandwidth->minimum, val = clamp(val, s->bandwidth->minimum,
s->bandwidth->maximum); s->bandwidth->maximum);
offset = val - s->bandwidth->minimum; offset = val - s->bandwidth->minimum;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment