summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/comedi_fops.c
AgeCommit message (Collapse)Author
2012-05-09staging: comedi: refactor sysfs files in comedi_fops.cH Hartley Sweeten
Refactor the sysfs attributes and functions to remove the need for the forward declarations and use the DEVICE_ATTR macro to define them. Instead of individually creating sysfs device attribute files, wrap them in an attribute_group and use the sysfs_create_group function to create them. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-24drivers/staging/comedi/comedi_fops.c: add missing vfreeJulia Lawall
aux_free is freed on all other exits from the function. By removing the return, we can benefit from the vfree already at the end of the function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18Drivers: Staging: Comedi: comedi_fops: Fixed a code style issueBenedikt Bergenthal
Fixed a code style issue. Signed-off-by: Benedikt Bergenthal <benedikt@kdrennert.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13staging: comedi: Add kernel config for default buffer sizesIan Abbott
Allow the default values for the module parameters for the default initial buffer size and default maximum buffer size to be specified in the kernel configuration. I'm not sure what the defaults for the defaults for the defaults should be, but 64 KiB seems to small, so I used values suggested by Bernd Porr, which are 2048 KiB for the default initial buffer size and 20480 for the default maximum buffer size. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Cc: Bernd Porr <berndporr@f2s.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-13staging: comedi: Add module parameters for default buffer sizeIan Abbott
For comedi subdevices that support asynchronous transfer commands, the initial buffer size and maximum buffer size for the transfer are both set to 64 KiB when the comedi device is "attached" to the hardware device. For many applications with reasonable fast sample rates and slow user-space (e.g. Python) these sizes are a bit too small. A task with CAP_SYS_ADMIN privileges can change the maximum buffer size for a comedi subdevice with an ioctl call or by writing to a device attribute file in sysfs, but that's not very convenient. For comedi devices attached during system startup, this could be done by a start-up script, but for hot-plugged devices it would require scripts run by udev rules, etc. Rather than use hardwired values, this patch introduces a couple of module parameters to set the defaults for the initial buffer size (comedi_default_buf_size_kb) and maximum buffer size (comedi_default_buf_maxsize_kb). These values are applied in place of the previous hard-wired values when the comedi device is "attached". The module parameter values are in units of KiB for consistency with the existing device attribute files. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: comedi: don't hijack hardware device private dataIan Abbott
comedi_auto_config() associates a Comedi minor device number with an auto-configured hardware device and comedi_auto_unconfig() disassociates it. Currently, these use the hardware device's private data pointer to point to some allocated storage holding the minor device number. This is a bit of a waste of the hardware device's private data pointer, preventing it from being used for something more useful by the low-level comedi device drivers. For example, it would make more sense if comedi_usb_auto_config() was passed a pointer to the struct usb_interface instead of the struct usb_device, but this cannot be done currently because the low-level comedi drivers already use the private data pointer in the struct usb_interface for something more useful. This patch stops the comedi core hijacking the hardware device's private data pointer. Instead, comedi_auto_config() stores a pointer to the hardware device's struct device in the struct comedi_device_file_info associated with the minor device number, and comedi_auto_unconfig() calls new function comedi_find_board_minor() to recover the minor device number associated with the hardware device. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging: comedi: don't disable IRQ for comedi_file_info_table_lockIan Abbott
None of the functions that acquire the comedi_file_info_table_lock spin-lock need to disable interrupts. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-01-12module_param: make bool parameters really bool (drivers & misc)Rusty Russell
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-12-16staging: comedi_fops.c whitespace fixesFlorian Schmaus
Changed whitespaces in comedi/*.c to tabs where necessary. All .c files within comedi now have no obvious style problems as reported by checkpatch.pl Signed-off-by: Florian Schmaus <fschmaus@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-10Merge 3.2-rc5 into staging-nextGreg Kroah-Hartman
This resolves the conflict in the drivers/staging/iio/industrialio-core.c file due to two different changes made to resolve the same problem. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging: comedi: comedi_fops: Removed int overflow checkFlorian Schmaus
This became unnecessary with the previous commit. Improved the readability of the remaining check, by using UINT_MAX. Signed-off-by: Florian Schmaus <fschmaus@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08staging: comedi: comedi_fops: Replace deprecated strict_strtoul with kstrtouintFlorian Schmaus
As reported by checkpatch.pl strict_strtoul should be replaced. It was replaced with kstrtouint since async->max_bufsize is an unsigned int anyway. Signed-off-by: Florian Schmaus <fschmaus@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27Staging: comedi: fix integer overflow in do_insnlist_ioctl()Xi Wang
There is a potential integer overflow in do_insnlist_ioctl() if userspace passes in a large insnlist.n_insns. The call to kmalloc() would allocate a small buffer, leading to a memory corruption. The bug was reported by Dan Carpenter <dan.carpenter@oracle.com> and Haogang Chen <haogangchen@gmail.com>. The patch was suggested by Ian Abbott <abbotti@mev.co.uk> and Lars-Peter Clausen <lars@metafoo.de>. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: Haogang Chen <haogangchen@gmail.com>. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27Revert "Staging: comedi: integer overflow in do_insnlist_ioctl()"Greg Kroah-Hartman
This reverts commit e384a41141949843899affcf51f4e6e646c1fe9f. It's not the correct way to solve this issue. Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27Staging: comedi: integer overflow in do_insnlist_ioctl()Dan Carpenter
There is an integer overflow here that could cause memory corruption on 32 bit systems. insnlist.n_insns could be a very high value size calculation for kmalloc() could overflow resulting in a smaller "insns" than expected. In the for (i = 0; i < insnlist.n_insns; i++) {... loop we would read past the end of the buffer, possibly corrupting memory as well. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27Staging: comedi: fix signal handling in read and writeFederico Vaga
After sleeping on a wait queue, signal_pending(current) should be checked (not before sleeping). Acked-by: Alessandro Rubini <rubini@gnudd.com> Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27Staging: comedi: fix mmap_countFederico Vaga
In comedi_fops, mmap_count is decremented at comedi_vm_ops->close but it is not incremented at comedi_vm_ops->open. This may result in a negative counter. The patch introduces the open method to keep the counter consistent. The bug was triggerd by this sample code: mmap(0, ...., comedi_fd); fork(); exit(0); Acked-by: Alessandro Rubini <rubini@gnudd.com> Signed-off-by: Federico Vaga <federico.vaga@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-27staging: comedi: fix oops for USB DAQ devices.Bernd Porr
This fixes kernel oops when an USB DAQ device is plugged out while it's communicating with the userspace software. Signed-off-by: Bernd Porr <berndporr@f2s.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23Staging: comedi: Fixed coding style issues.Mark Pearson
comedi_fops.c : A forward decleration was declared as extern although it is a function private to this file. Changed the decleration to static. Signed-off-by: Mark Pearson <markpearson_de@yahoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-06staging: comedi: remove COMEDI_DEVICE_CREATE macro, expand all callersPavel Roskin
This is no longer needed as the code is now in the main kernel tree. Signed-off-by: Pavel Roskin <proski@gnu.org> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05staging: comedi: fix infoleak to userspaceVasiliy Kulikov
driver_name and board_name are pointers to strings, not buffers of size COMEDI_NAMELEN. Copying COMEDI_NAMELEN bytes of a string containing less than COMEDI_NAMELEN-1 bytes would leak some unrelated bytes. Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28staging: remove unnecessary codeGreg Dietsche
Compile tested. remove unnecessary code that matches this coccinelle pattern if (...) return ret; return ret; Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu> Acked-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-01-21staging: comedi: Make INSN_BITS behavior consistent across driversIan Abbott
Most comedi hardware drivers that support the INSN_BITS instruction ignore the base channel (specified by insn->chanspec) and assume it is 0. The base channel is supposed to affect how the mask (in data[0]) and bits (in data[1]) are treated. Bit 0 applies to the base channel, bit 1 applies to base channel plus 1, etc. For subdevices with no more than 32 channels, this patch modifies the chanspec and data before presenting it to the hardware driver, and modifies the data bits read back by the hardware driver (into data[1]). This makes it appear to the hardware driver that the base channel was set to 0. For subdevices with more than 32 channels, the instruction is left unmodified, as it is assumed that the hardware driver takes note of the base channel in this case in order to provide access beyond channel 31. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-28Merge 'staging-next' to Linus's treeGreg Kroah-Hartman
This merges the staging-next tree to Linus's tree and resolves some conflicts that were present due to changes in other trees that were affected by files here. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15llseek: automatically add .llseek fopArnd Bergmann
All file_operations should get a .llseek operation so we can make nonseekable_open the default for future file operations without a .llseek pointer. The three cases that we can automatically detect are no_llseek, seq_lseek and default_llseek. For cases where we can we can automatically prove that the file offset is always ignored, we use noop_llseek, which maintains the current behavior of not returning an error from a seek. New drivers should normally not use noop_llseek but instead use no_llseek and call nonseekable_open at open time. Existing drivers can be converted to do the same when the maintainer knows for certain that no user code relies on calling seek on the device file. The generated code is often incorrectly indented and right now contains comments that clarify for each added line why a specific variant was chosen. In the version that gets submitted upstream, the comments will be gone and I will manually fix the indentation, because there does not seem to be a way to do that using coccinelle. Some amount of new code is currently sitting in linux-next that should get the same modifications, which I will do at the end of the merge window. Many thanks to Julia Lawall for helping me learn to write a semantic patch that does all this. ===== begin semantic patch ===== // This adds an llseek= method to all file operations, // as a preparation for making no_llseek the default. // // The rules are // - use no_llseek explicitly if we do nonseekable_open // - use seq_lseek for sequential files // - use default_llseek if we know we access f_pos // - use noop_llseek if we know we don't access f_pos, // but we still want to allow users to call lseek // @ open1 exists @ identifier nested_open; @@ nested_open(...) { <+... nonseekable_open(...) ...+> } @ open exists@ identifier open_f; identifier i, f; identifier open1.nested_open; @@ int open_f(struct inode *i, struct file *f) { <+... ( nonseekable_open(...) | nested_open(...) ) ...+> } @ read disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ read_no_fpos disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { ... when != off } @ write @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ write_no_fpos @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { ... when != off } @ fops0 @ identifier fops; @@ struct file_operations fops = { ... }; @ has_llseek depends on fops0 @ identifier fops0.fops; identifier llseek_f; @@ struct file_operations fops = { ... .llseek = llseek_f, ... }; @ has_read depends on fops0 @ identifier fops0.fops; identifier read_f; @@ struct file_operations fops = { ... .read = read_f, ... }; @ has_write depends on fops0 @ identifier fops0.fops; identifier write_f; @@ struct file_operations fops = { ... .write = write_f, ... }; @ has_open depends on fops0 @ identifier fops0.fops; identifier open_f; @@ struct file_operations fops = { ... .open = open_f, ... }; // use no_llseek if we call nonseekable_open //////////////////////////////////////////// @ nonseekable1 depends on !has_llseek && has_open @ identifier fops0.fops; identifier nso ~= "nonseekable_open"; @@ struct file_operations fops = { ... .open = nso, ... +.llseek = no_llseek, /* nonseekable */ }; @ nonseekable2 depends on !has_llseek @ identifier fops0.fops; identifier open.open_f; @@ struct file_operations fops = { ... .open = open_f, ... +.llseek = no_llseek, /* open uses nonseekable */ }; // use seq_lseek for sequential files ///////////////////////////////////// @ seq depends on !has_llseek @ identifier fops0.fops; identifier sr ~= "seq_read"; @@ struct file_operations fops = { ... .read = sr, ... +.llseek = seq_lseek, /* we have seq_read */ }; // use default_llseek if there is a readdir /////////////////////////////////////////// @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier readdir_e; @@ // any other fop is used that changes pos struct file_operations fops = { ... .readdir = readdir_e, ... +.llseek = default_llseek, /* readdir is present */ }; // use default_llseek if at least one of read/write touches f_pos ///////////////////////////////////////////////////////////////// @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read.read_f; @@ // read fops use offset struct file_operations fops = { ... .read = read_f, ... +.llseek = default_llseek, /* read accesses f_pos */ }; @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, ... + .llseek = default_llseek, /* write accesses f_pos */ }; // Use noop_llseek if neither read nor write accesses f_pos /////////////////////////////////////////////////////////// @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; identifier write_no_fpos.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, .read = read_f, ... +.llseek = noop_llseek, /* read and write both use no f_pos */ }; @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write_no_fpos.write_f; @@ struct file_operations fops = { ... .write = write_f, ... +.llseek = noop_llseek, /* write uses no f_pos */ }; @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; @@ struct file_operations fops = { ... .read = read_f, ... +.llseek = noop_llseek, /* read uses no f_pos */ }; @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; @@ struct file_operations fops = { ... +.llseek = noop_llseek, /* no read or write fn */ }; ===== End semantic patch ===== Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Julia Lawall <julia@diku.dk> Cc: Christoph Hellwig <hch@infradead.org>
2010-09-05staging: comedi: check return code of put_userVasiliy Kulikov
Function put_user may fail. Check for it. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-17Staging: comedi: Allow 'open' driver method to failIan Abbott
Some comedi drivers should return an error from their 'open' method when something goes wrong. Change the prototype of the 'open' method in 'struct comedi_device' to allow this, and change the drivers that use it. Propagate any error to the 'open' file operation. The corresponding 'close' method won't be called when the 'open' method fails, so drivers failing the 'open' need to clean up any mess they created. The dt9812 and serial2002 drivers can now return an error on 'open'. The jr3_pci driver also uses the 'open' method but doesn't fail it. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04Staging: comedi: For COMEDI_BUFINFO, check access to commandIan Abbott
Don't allow COMEDI_BUFINFO ioctl if some other file object has locked the subdevice or has an active command. If there is no active command, just report back the last buffer position. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04Staging: comedi: COMEDI_BUFINFO with no async - report no bytes read or writtenIan Abbott
When the COMEDI_BUFINFO ioctl is used on a subdevice without asynchronous streaming command support, set 'bytes_read = 0' and 'bytes_written = 0' in the buffer info returned back to the user. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04Staging: comedi: don't write to buffer if command finishedIan Abbott
For write(), any data copied to the data buffer after the previously set up streaming acquisition command has finished won't be used, but a non-empty write() does not currently return 0 (or -EPIPE on error) after the command has finished until the data buffer has been filled up. Change this behavior to return 0 (or -EPIPE) any time after the command has finished, without bothering to fill up the buffer with more useless data. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-14Staging: comedi: Fix long line lengths in comedi_fops.cMark
This patch fixes lots of long line lengths in comedi_fops.c found by checkpatch.pl Signed-off-by: Mark Rankilor <reodge@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: comedi: __user markup on comedi_fops.cGreg Kroah-Hartman
Hm, what a mess. I tried to properly mark up the __user pointers, but for some of these structures, we use them both in the kernel, and across the user/kernel boundry, which isn't ok. So we end up generating a few new sparse warnings in places we were not before, but the large majority of things are now properly tagged in the fops file. The whole ioctl interface needs to be carefully looked at in the future. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: comedi: make comedi_free_board_minor local to comedi coreGreg Kroah-Hartman
No one outside of the comedi core calls this function, so don't export it to the world. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: comedi: make comedi_alloc_board_minor local to comedi coreGreg Kroah-Hartman
No one outside of the comedi core calls this function, so create an internal.h file to put the prototype in, and don't export it to the world. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: comedi: make comedi_set_subdevice_runflags() staticGreg Kroah-Hartman
No one calls this anymore, except the core comedi code, so mark it static and don't export it. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: comedi: rename check_chanlist to comedi_check_chanlistGreg Kroah-Hartman
It's a global function, so properly name it and move the export to where the function is located at. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: comedi: more EXPORT_SYMBOL movementGreg Kroah-Hartman
This moves the markings to the comedi_fops.c file, where they belong. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: comedi: added log level to printk's in comedi_fops.cMark Rankilor
This patches comedi_fops.c to add kernel log level to some printk calls Signed-off-by: Mark Rankilor <reodge@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11Staging: comedi: fix whitespace coding style issues in comedi_fops.cPieter De Praetere
Solves warnings found by the checkpatch.pl tool: spaces before tabs. Signed-off-by: Pieter De Praetere <pieterc.depraetere@ugent.be> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-04Staging: comedi: comedi_fops.c: Checkpatch cleanupAndrea Gelmini
ERROR: do not initialise externals to 0 or NULL +int comedi_num_legacy_minors = 0; WARNING: braces {} are not necessary for single statement blocks + if (s->subdev_flags & SDF_CMD_READ) { + kill_fasync(&dev->async_queue, SIGIO, POLL_IN); + } WARNING: braces {} are not necessary for single statement blocks + if (s->subdev_flags & SDF_CMD_WRITE) { + kill_fasync(&dev->async_queue, SIGIO, POLL_OUT); + } Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11Staging: comedi: remove check for HAVE_COMPAT_IOCTLShawn Bohrer
All new kernels have support for compat_ioctl so remove the check and support for older kernels. Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11staging: comedi: Remove check for HAVE_UNLOCKED_IOCTLShawn Bohrer
All new kernels have unlocked_ioctl so we don't need to check. Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-10-09Staging: comedi: Corrected type of a printk argument in resize_async_buffer().Ian Abbott
Signed-off-by: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15Staging: Comedi: Lindent changes to comdi driver in staging treeMithlesh Thukral
Lindent changes to comdi driver in staging tree. This patch is followed by the checkpatch.pl error fixes. Did not make them part of this patch as the patch size is already huge. Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-08-14Networking: use CAP_NET_ADMIN when deciding to call request_moduleEric Paris
The networking code checks CAP_SYS_MODULE before using request_module() to try to load a kernel module. While this seems reasonable it's actually weakening system security since we have to allow CAP_SYS_MODULE for things like /sbin/ip and bluetoothd which need to be able to trigger module loads. CAP_SYS_MODULE actually grants those binaries the ability to directly load any code into the kernel. We should instead be protecting modprobe and the modules on disk, rather than granting random programs the ability to load code directly into the kernel. Instead we are going to gate those networking checks on CAP_NET_ADMIN which still limits them to root but which does not grant those processes the ability to load arbitrary code into the kernel. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Acked-by: Paul Moore <paul.moore@hp.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: James Morris <jmorris@namei.org>
2009-06-19Staging: comedi: remove some RT code that lingeredGreg Kroah-Hartman
This removes some pieces of RT code that was part of the main code paths. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19Staging: comedi: remove RT codeGreg Kroah-Hartman
This removes the unused RT code from the comedi subsystem. A lot of drivers needed to then include interrupt.h on their own, as they were picking it up through the comedi_rt.h inclusion. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19Staging: comedi: remove comedi-specific wrappersGreg Kroah-Hartman
There are a number of comedi "wrappers" for some RT functions that are about to go away. This patch removes all of the wrapper calls within the comedi drivers and core in order to prepare for removing the RT comedi code. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19Staging: comedi: Added sysfs attribute files for setting and querying ↵Frank Mori Hess
subdevice buffer sizes. Signed-off-by: Frank Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>