History

[media] lirc_dev: merge three if statements in only one

The three if statements check the same thing, merge them in only one statement.

Andi Shyti committed 10 years ago

Commit 14db9fc1 parent 6ab86d21 file · +3 −8Browse files

Unified · Split

drivers/media/rc/lirc_dev.c+3−8
@@ -270,15 +270,10 @@ static int lirc_allocate_driver(struct lirc_driver *d) · 269 unmodified lines
270270 dev_err(d->dev, "add_to_buf not set\n");
271271 return -EBADRQC;
272272 }
273− } else if (!(d->fops && d->fops->read) && !d->rbuf) {
274− dev_err(d->dev, "fops->read and rbuf are NULL!\n");
273+ } else if (!d->rbuf && !(d->fops && d->fops->read &&
274+ d->fops->poll && d->fops->unlocked_ioctl)) {
275+ dev_err(d->dev, "undefined read, poll, ioctl\n");
275276 return -EBADRQC;
276− } else if (!d->rbuf) {
277− if (!(d->fops && d->fops->read && d->fops->poll &&
278− d->fops->unlocked_ioctl)) {
279− dev_err(d->dev, "undefined read, poll, ioctl\n");
280− return -EBADRQC;
281− }
282277 }
283278
284279 mutex_lock(&lirc_dev_lock);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t