aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/panel
AgeCommit message (Collapse)Author
2014-12-02staging: panel: Move LCD-related state into struct lcdMariusz Gorski
Move more or less all LCD-related state into struct lcd in order to get better cohesion; use bool instead of int where it makes sense. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Remove more magic number comparisonMariusz Gorski
Use a defined value instead of magic number comparison for checking whether a module param value has been set. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Refactor LCD init codeMariusz Gorski
Rework lcd_init method to make it a little bit more clear about the precedence of the params, move LCD geometry and pins layout to the LCD struct and thus make the LCD-related module params effectively read-only. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Make two more module params read-onlyMariusz Gorski
Make keypad_type and lcd_type module params read-only. This step also starts making it more clear what is the precedence of device params coming from different sources (device profile, runtime module param values etc). Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Start making module params read-onlyMariusz Gorski
Start decoupling module params from the actual device state, both for lcd and keypad, by keeping the params read-only and moving the device state to related structs. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Use defined value or checking module params stateMariusz Gorski
Avoid magic number and use a comparison with a defined value instead that checks whether module param has been set by the user to some value at loading time. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Remove magic numbersMariusz Gorski
Get rid of magic numbers indicating that the value of a module param is not set. Use a defined value instead. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Call init function directlyMariusz Gorski
Remove useless function and let the kernel call the actual init function directly. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02staging: panel: Set default parport module param valueMariusz Gorski
Set default parport module param value to DEFAULT_PARPORT so that a if-block can be avoided. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: panel: Use better names for two defined valuesMariusz Gorski
Give DEFAULT_KEYPAD and DEFAULT_LCD defines better names, so that their meaning is emphasized. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-By: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: panel: Reorder module parameter declarationsMariusz Gorski
Change the order of the module parameter declarations so that it matches the Kconfig order. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-By: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: panel: Reorder DEFAULT_* values redefinesMariusz Gorski
Change the order of the DEFAULT_* values redefines so that it matches the Kconfig order. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-By: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26staging: panel: Reorder initial DEFAULT_* definesMariusz Gorski
Change the order of the initial DEFAULT_* defines so that it matches the Kconfig order. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Acked-By: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05staging: panel: Fix single-open policy race conditionMariusz Gorski
Fix the implementation of a single-open policy for both devices (lcd and keypad) by using atomic_t instead of plain ints. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03staging: panel: Remove outdated TODO taskMariusz Gorski
Remove Lindent task from TODO file as it's obsolete. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29staging: panel: Use designated initializersMariusz Gorski
Fix "warning: missing initializer [-Wmissing-field-initializers]" by using designated struct initializers. Signed-off-by: Mariusz Gorski <marius.gorski@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-10Staging: panel: fixed frivilous else statement warningVincent Heuken
Fixed one instance of the following checkpatch.pl warning in panel.c: WARNING: else is not generally useful after a break or return Signed-off-by: Vincent Heuken <me@vincentheuken.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25staging: panel: (coding style) Multiple assignmentsDominique van den Broeck
Style-only modifications to comply with checkpatch.pl --strict --file. . Breaks down compound assignments. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23staging: panel: (coding style) Line alignments and malloc sizeofDominique van den Broeck
Style-only modifications to comply with checkpatch.pl --strict --file. . Correctly realigns the lines that needed to be ; . Suppress useless blank rows ; . Fix sizeof() issues in various -malloc() functions. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23staging: panel: (coding style) Matching bracesDominique van den Broeck
Style-only modifications to comply with checkpatch.pl --strict --file. . Adds every missing brace in condition statements. Signed-off-by: Dominique van den Broeck <domdevlin@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23staging: panel: fix regression in lcd_writeBastien Armand
This patch fix a regression in lcd_write caused by commit 70a8c3eb8546cefe40fb0bc7991e8899b7b91075 Signed-off-by: Bastien Armand <armand.bastien@laposte.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18staging: panel: add blank lines after declarationsBastien Armand
This patch fixes "Missing a blank line after declarations" checkpatch warnings in panel.c. Signed-off-by: Bastien Armand <armand.bastien@laposte.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18staging: panel: fix sparse warnings in keypad_readBastien Armand
This patch fixes two sparse warnings related to keypad_read : warning: incorrect type in argument 1 (different address spaces) warning: incorrect type in initializer (incompatible argument 2 (different address spaces)) Signed-off-by: Bastien Armand <armand.bastien@laposte.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18staging: panel: fix sparse warnings in lcd_writeBastien Armand
This patch fixes two sparse warnings related to lcd_write : warning: incorrect type in argument 1 (different address spaces) warning: incorrect type in initializer (incompatible argument 2 (different address spaces)) lcd_write can be used from kernel space (in panel_lcd_print) or from user space. So we introduce the lcd_write_char function that will write a char to the device. We modify lcd_write and panel_lcd_print to use it. Finally we add __user annotation missing in lcd_write. Signed-off-by: Bastien Armand <armand.bastien@laposte.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-18staging: panel: replace del_timer by del_timer_syncJulia Lawall
Use del_timer_sync to ensure that the timer is stopped on all CPUs before the driver exists. This change was suggested by Thomas Gleixner. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ declarer name module_exit; identifier ex; @@ module_exit(ex); @@ identifier r.ex; @@ ex(...) { <... - del_timer + del_timer_sync (...) ...> } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27Staging: panel: Fix quoted string split across line in panel.cMonam Agarwal
This patch fixes the following checkpatch.pl warning in panel.c: WARNING: quoted string split across lines Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27Staging: panel: Fix space prohibited between function name and open paranthesisMonam Agarwal
This patch fixes the following checkpatch.pl issues in panel.c: WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09staging: panel: fix interruptible_sleep_on raceArnd Bergmann
interruptible_sleep_on is racy and going away. This replaces the one caller in the panel driver with the appropriate wait_event_interruptible variant. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: devel@driverdev.osuosl.org Cc: Willy Tarreau <willy@meta-x.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16Staging: Panel: panel: Fixed checkpatch line length warningsJake Champlin
Fixed 4 cases of line length issues with checkpatch. Checkpatch is now clean for panel.c. Signed-off-by: 'Jake Champlin <jake.champlin.27@gmail.com>' Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/panel: Mark local functions/structs static and add const if ↵Peter Huewe
applicable (fix sparse warnings) sparse complains about the following functions: panel.c:188:1: warning: symbol 'logical_inputs' was not declared. Should it be static? panel.c:569:6: warning: symbol 'old_keypad_profile' was not declared. Should it be static? panel.c:580:6: warning: symbol 'new_keypad_profile' was not declared. Should it be static? panel.c:593:6: warning: symbol 'nexcom_keypad_profile' was not declared. Should it be static? panel.c:672:6: warning: symbol 'pin_to_bits' was not declared. Should it be static? panel.c:1375:6: warning: symbol 'panel_lcd_print' was not declared. Should it be static? panel.c:1382:6: warning: symbol 'lcd_init' was not declared. Should it be static? panel.c:2181:5: warning: symbol 'panel_init' was not declared. Should it be static? Add the static keyword to silence these warnings and make sparse happy. If structs or function parameters are used readonly they are also marked as const. CC: David Howells <dhowells@redhat.com> Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-29staging: panel: pass correct lengths to keypad_send_key()Dan Carpenter
We changed the sizeof() statements in 429ccf058b "staging:panel: Fixed coding conventions." so that they could fit inside the 80 character line limit. Unfortunately, the new sizeof() statements are a smaller size. This reverts it. There isn't a nice way to stay within the 80 character limit without a re-work so I've gone over. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-21staging: Fix misspellings of "whether".Adam Buchbinder
"Whether" is spelled "wether" in several places. This fixes those that are in the staging tree. Signed-off-by: Adam Buchbinder <adam.buchbinder@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10Staging: panel: fix spinlock trylock failure on UPFengguang Wu
Use spin_lock_irq() to quiet warning: [ 8.232324] BUG: spinlock trylock failure on UP on CPU#0, reboot/85 [ 8.234138] lock: c161c760, .magic: dead4ead, .owner: reboot/85, .owner_cpu: 0 [ 8.236132] Pid: 85, comm: reboot Not tainted 3.4.0-rc7-00656-g82163ed #5 [ 8.237965] Call Trace: [ 8.238648] [<c13dfd20>] ? printk+0x18/0x1a [ 8.239827] [<c122a5e0>] spin_dump+0x80/0xd0 [ 8.241016] [<c122a652>] spin_bug+0x22/0x30 [ 8.242181] [<c122a93b>] do_raw_spin_trylock+0x5b/0x70 [ 8.243611] [<c13e8bae>] _raw_spin_trylock+0xe/0x60 [ 8.244975] [<c1392230>] ? keypad_send_key.constprop.9+0xe0/0xe0 ==> [ 8.246638] [<c13922ea>] panel_scan_timer+0xba/0x570 [ 8.248019] [<c1392230>] ? keypad_send_key.constprop.9+0xe0/0xe0 [ 8.249689] [<c102f6f5>] run_timer_softirq+0x1e5/0x370 [ 8.251191] [<c102f645>] ? run_timer_softirq+0x135/0x370 [ 8.252718] [<c1392230>] ? keypad_send_key.constprop.9+0xe0/0xe0 [ 8.254462] [<c102a592>] __do_softirq+0xc2/0x1c0 [ 8.255758] [<c102a4d0>] ? local_bh_enable_ip+0x130/0x130 [ 8.257228] <IRQ> [<c102a855>] ? irq_exit+0x65/0x70 [ 8.258647] [<c1013ff9>] ? smp_apic_timer_interrupt+0x49/0x80 [ 8.260226] [<c13e96c1>] ? apic_timer_interrupt+0x31/0x38 [ 8.261737] [<c12700e0>] ? drm_vm_open_locked+0x70/0xb0 [ 8.263166] [<c122489a>] ? delay_tsc+0x1a/0x30 [ 8.264452] [<c12248c9>] ? __delay+0x9/0x10 [ 8.265621] [<c12248ec>] ? __const_udelay+0x1c/0x20 ==> [ 8.266967] [<c139136c>] ? lcd_clear_fast_p8+0x9c/0xe0 [ 8.268386] [<c1391a66>] ? lcd_write+0x226/0x810 [ 8.269653] [<c1367900>] ? md_set_readonly+0xc0/0xc0 [ 8.271013] [<c122a9ed>] ? do_raw_spin_unlock+0x9d/0xe0 [ 8.272470] [<c1392a98>] ? panel_lcd_print+0x38/0x40 [ 8.273837] [<c1392ace>] ? panel_notify_sys+0x2e/0x60 [ 8.275224] [<c1046634>] ? notifier_call_chain+0x84/0xb0 [ 8.276754] [<c10469ce>] ? __blocking_notifier_call_chain+0x3e/0x60 [ 8.278576] [<c1046a0a>] ? blocking_notifier_call_chain+0x1a/0x20 [ 8.280267] [<c1036a14>] ? kernel_restart_prepare+0x14/0x40 [ 8.281901] [<c1036a8e>] ? kernel_restart+0xe/0x50 [ 8.283216] [<c1036ce9>] ? sys_reboot+0x149/0x1e0 [ 8.284532] [<c10b3fb3>] ? handle_pte_fault+0x93/0xd70 [ 8.285956] [<c1019e35>] ? do_page_fault+0x215/0x5e0 [ 8.287330] [<c101a113>] ? do_page_fault+0x4f3/0x5e0 [ 8.288704] [<c1045ac6>] ? up_read+0x16/0x30 [ 8.289890] [<c101a113>] ? do_page_fault+0x4f3/0x5e0 [ 8.291252] [<c10d4486>] ? iterate_supers+0x86/0xd0 [ 8.292615] [<c122a9ed>] ? do_raw_spin_unlock+0x9d/0xe0 [ 8.294049] [<c13e8dcd>] ? _raw_spin_unlock+0x1d/0x20 [ 8.295449] [<c10d44ab>] ? iterate_supers+0xab/0xd0 [ 8.296795] [<c10fb620>] ? __sync_filesystem+0xa0/0xa0 [ 8.298199] [<c13e9b03>] ? sysenter_do_call+0x12/0x37 [ 8.306899] Restarting system. [ 8.307747] machine restart Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13staging: panel: fix checkpatch warningsToshiaki Yamane
Now checkpatch clean. $ find drivers/staging/panel -name "*.[ch]"|xargs ./scripts/checkpatch.pl \ -f --terse --nosummary|cut -f3- -d":"|sort |uniq -c|sort -n 2 WARNING: Single statement macros should not use a do {} while (0) loop Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16staging: panel: Use pr_info(...) rather than printk(KERN_INFOToshiaki Yamane
-Added pr_fmt. -Converted printk(KERN_INFO to pr_info -Removed embedded message prefixes. Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16staging: panel: Use pr_err(...) rather than printk(KERN_ERR ...)Toshiaki Yamane
-Removed unnecessary OOM messages. -Removed embedded message prefixes. -Added __func__ to some pr_err messages. -Converted printk(KERN_ERR to pr_err -Refactored split printk strings onto a single line -Removed the space before the '!'. Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16staging: panel: Remove printk(KERN_DEBUG ...) located in the #if 0 blockToshiaki Yamane
Deleted #if 0 blocks Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10staging:panel:panel.c Fix typo in staging:panelJustin P. Mattock
The below patch fixes a typo I found while reading. Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Cc: Willy Tarreau <willy@meta-x.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-28Remove all #inclusions of asm/system.hDavid Howells
Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *` Signed-off-by: David Howells <dhowells@redhat.com>
2011-09-06staging: panel: Fixed checkpatch warning about simple_strtoul()Pelle Windestam
Fixed the checkpatch warning about sing simple_strtoul instead of kstrtoul() in panel.c. Signed-off-by: Pelle Windestam <iceaway@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05Remove unneeded version.h include from drivers/staging/panel/panel.cJesper Juhl
It was pointed out by 'make versioncheck' that include of linux/version.h is not needed in drivers/staging/panel/panel.c This patch removes it. Signed-off-by: Jesper Juhl <jj@chaosbits.net> 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-08-02staging: panel: fix error pathKulikov Vasiliy
panel_attach() poorly handles errors. On error unregister everything we have registered. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22Staging: panel: fix memory leakKulikov Vasiliy
panel_bind_key() must free allocated memory. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22staging: panel: change own pieces of code by strtoul()Andy Shevchenko
We have nice method simple_strtoul() to convert string to numbers which could be used here. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08Staging: use llseek in all file operationsArnd Bergmann
These could not be detected by the semantic patch. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2010-07-08Staging: panel: Prevent double-calling of parport_release - fix oops.Peter Huewe
This patch prevents the code from calling parport_release and parport_unregister_device twice with the same arguments - and thus fixes an oops. Rationale: After the first call the parport is already released and the handle isn't valid anymore and calling parport_release and parport_unregister_device twice isn't a good idea. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Cc: stable <stable@kernel.org> Acked-by: Willy Tarreau <w@1wt.eu>
2010-06-22staging:panel: Fixed coding conventions.Henri Häkkinen
Fixed coding convention issues as reported by checkpatch.pl tool on the file `panel.c'. Moved LCD special code handling from the function `lcd_write' into function `handle_lcd_special_code'. Also moved the handling of INPUT_ST_HIGH and INPUT_ST_FALLING states from the function `panel_process_input' into functions `input_state_high' and `input_state_falling'. Signed-off-by: Henri Häkkinen <henuxd@gmail.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-14Staging: Use kcalloc or kzallocJulia Lawall
Use kcalloc or kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,y,flags; statement S; type T; @@ x = - kmalloc + kcalloc ( - y * sizeof(T), + y, sizeof(T), flags); if (x == NULL) S -memset(x, 0, y * sizeof(T)); @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset(x, 0, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk>
2010-05-11Staging: panel: change asm/uaccess.h to linux/uaccess.hTakanori Suzuki
This patch replaces <asm/uaccess.h> with <linux/uaccess.h> to comply with the checkpatch.pl hint. Signed-off-by: Takanori Suzuki <mail.tks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>