Skip to content

Commit

Permalink
clang fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
klogg committed Sep 11, 2024
1 parent 316878f commit 8271aaa
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 27 deletions.
5 changes: 1 addition & 4 deletions bridge/it66121_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,10 +898,7 @@ static int __init it66121_probe(void)
return 0;
}

static const struct i2c_device_id it66121_ids[] = {
{ "it66121", 0 },
{ }
};
static const struct i2c_device_id it66121_ids[] = { { "it66121", 0 }, {} };
MODULE_DEVICE_TABLE(i2c, it66121_ids);

static struct i2c_driver it66121_driver = {
Expand Down
2 changes: 1 addition & 1 deletion fl2000.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void fl2000_streaming_destroy(struct usb_interface *interface);
/* ... and interface */
int fl2000_streaming_mode_set(struct usb_device *usb_dev, int pixels, u32 bytes_pix);
void fl2000_streaming_compress(struct usb_device *usb_dev, void *src, unsigned int height,
unsigned int width, unsigned int pitch);
unsigned int width, unsigned int pitch);
int fl2000_streaming_enable(struct usb_device *usb_dev);
void fl2000_streaming_disable(struct usb_device *usb_dev);

Expand Down
6 changes: 4 additions & 2 deletions fl2000_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ int fl2000_drm_init(struct usb_device *usb_dev)
/* We support vblanks */
ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
if (ret) {
dev_err(&usb_dev->dev, "Failed to initialize %d vblank(s) (%d)", drm->mode_config.num_crtc, ret);
dev_err(&usb_dev->dev, "Failed to initialize %d vblank(s) (%d)",
drm->mode_config.num_crtc, ret);
drm_mode_config_cleanup(drm);
drm_dev_put(drm);
return ret;
Expand All @@ -607,7 +608,8 @@ int fl2000_drm_init(struct usb_device *usb_dev)
drm_encoder_helper_add(&drm_if->pipe.encoder, &fl2000_encoder_funcs);

/* Register supported HDMI bridge as a component with match by name */
component_match_add(&usb_dev->dev, &match, component_compare_dev_name, fl2000_supported_bridge);
component_match_add(&usb_dev->dev, &match, component_compare_dev_name,
fl2000_supported_bridge);
if (!match) {
dev_err(&usb_dev->dev, "Cannot find supported HDMI bridge!");
drm_mode_config_cleanup(drm);
Expand Down
22 changes: 12 additions & 10 deletions fl2000_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@

#define USB_DRIVER_NAME "fl2000_usb"

#define FL2000_USB_VENDOR 0x1D5C
#define FL2000_USB_VENDOR 0x1D5C
#define FL2000_USB_PRODUCT 0x2000
#define FL2000_USB_INTERFACE(ifnum, table) \
{ USB_DEVICE_INTERFACE_NUMBER(FL2000_USB_VENDOR, FL2000_USB_PRODUCT, ifnum), \
.driver_info = (kernel_ulong_t)&(table) }
#define FL2000_USB_INTERFACE(ifnum, table) \
{ \
USB_DEVICE_INTERFACE_NUMBER(FL2000_USB_VENDOR, FL2000_USB_PRODUCT, ifnum), \
.driver_info = (kernel_ulong_t) & (table) \
}

struct fl2000_if_api
{
int(*create)(struct usb_interface *interface);
void(*destroy)(struct usb_interface *interface);
struct fl2000_if_api {
int (*create)(struct usb_interface *interface);
void (*destroy)(struct usb_interface *interface);
};

static int fl2000_avcontrol_create(struct usb_interface *interface)
Expand All @@ -28,7 +29,8 @@ static int fl2000_avcontrol_create(struct usb_interface *interface)
/* This seem to be needed to workaround buggy implementation of EPs */
ret = usb_set_interface(usb_dev, FL2000_USBIF_AVCONTROL, 1);
if (ret) {
dev_err(&interface->dev, "Cannot set streaming interface for bulk transfers (%d)", ret);
dev_err(&interface->dev, "Cannot set streaming interface for bulk transfers (%d)",
ret);
return ret;
}

Expand Down Expand Up @@ -106,7 +108,7 @@ static int fl2000_probe(struct usb_interface *interface, const struct usb_device

static void fl2000_disconnect(struct usb_interface *interface)
{
const struct usb_device_id *id;;
const struct usb_device_id *id;
const struct fl2000_if_api *api;

id = usb_match_id(interface, fl2000_id_table);
Expand Down
7 changes: 4 additions & 3 deletions fl2000_interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ static void fl2000_intr_work(struct work_struct *work)
int ret;

/* Receive interrupt message */
ret = usb_interrupt_msg(usb_dev, usb_rcvintpipe(usb_dev, INTERRUPT_EP), &intr->buf, sizeof(intr->buf), NULL, 0);
ret = usb_interrupt_msg(usb_dev, usb_rcvintpipe(usb_dev, INTERRUPT_EP), &intr->buf,
sizeof(intr->buf), NULL, 0);
if (ret) {
dev_err(&interface->dev, "Sending interrupt message failed (%d)", ret);
/* TODO: Signal fault to system and start shutdown of usb_dev */
Expand All @@ -37,7 +38,7 @@ static void fl2000_intr_work(struct work_struct *work)
fl2000_drm_hotplug(usb_dev);
}

queue_work(intr->work_queue, &intr->work);
queue_work(intr->work_queue, &intr->work);
}

static void fl2000_intr_release(struct device *dev, void *res)
Expand Down Expand Up @@ -109,7 +110,7 @@ int fl2000_interrupt_create(struct usb_interface *interface)
}

intr->interface = interface;

/* This possibly involves reading I2C registers, etc. so better to schedule a work queue */
INIT_WORK(&intr->work, &fl2000_intr_work);
intr->work_queue = create_workqueue("fl2000_interrupt");
Expand Down
2 changes: 1 addition & 1 deletion fl2000_registers.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ int fl2000_regmap_init(struct usb_device *usb_dev)

regmap = devm_regmap_init(&usb_dev->dev, NULL, usb_dev, &fl2000_regmap_config);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
return PTR_ERR(regmap);

return 0;
}
Expand Down
15 changes: 9 additions & 6 deletions fl2000_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,18 @@ static int fl2000_send_stream(struct usb_device *usb_dev, struct fl2000_stream *
*/
if (list_empty(&stream->transmit_list)) {
if (list_empty(&stream->wait_list))
last_sb = list_last_entry(&stream->render_list, struct fl2000_stream_buf, list);
last_sb = list_last_entry(&stream->render_list,
struct fl2000_stream_buf, list);
else
last_sb = list_last_entry(&stream->wait_list, struct fl2000_stream_buf, list);
last_sb = list_last_entry(&stream->wait_list,
struct fl2000_stream_buf, list);
cur_sb = list_first_entry(&stream->render_list, struct fl2000_stream_buf,
list);
list);
if (cur_sb && last_sb) /* Both non-NULL */
memcpy(cur_sb->vaddr, last_sb->vaddr, stream->buf_size);
} else {
cur_sb = list_first_entry(&stream->transmit_list, struct fl2000_stream_buf, list);
cur_sb = list_first_entry(&stream->transmit_list, struct fl2000_stream_buf,
list);
}
list_move_tail(&cur_sb->list, &stream->wait_list);
spin_unlock(&stream->list_lock);
Expand All @@ -205,7 +208,7 @@ static int fl2000_send_stream(struct usb_device *usb_dev, struct fl2000_stream *
* transfer_buffer field of URB which is unused due to SGT
*/
usb_fill_bulk_urb(urb, usb_dev, usb_sndbulkpipe(usb_dev, STREAMING_EP), cur_sb,
(int)stream->buf_size, fl2000_data_completion, stream);
(int)stream->buf_size, fl2000_data_completion, stream);
urb->interval = 0;
urb->sg = cur_sb->sgt.sgl;
urb->num_sgs = cur_sb->sgt.nents;
Expand Down Expand Up @@ -294,7 +297,7 @@ static void fl2000_streaming_release(struct device *dev, void *res)
* @pitch: Image pitch
*/
void fl2000_streaming_compress(struct usb_device *usb_dev, void *src, unsigned int height,
unsigned int width, unsigned int pitch)
unsigned int width, unsigned int pitch)
{
struct fl2000_stream_buf *cur_sb;
void *dst;
Expand Down

0 comments on commit 8271aaa

Please sign in to comment.