summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-11-19staging/lustre/lnet: coding style fix for lstcon_test_addAmir Shehata
To make the function a bit easier to read. This is coding style fix part of original Lustre commit in external tree. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3093 Lustre-change: http://review.whamcloud.com/6092 Signed-off-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19staging/lustre/lnet: constify name argument of ↵Amir Shehata
lstcon_group_find/lstcon_batch_find This is part of original Lustre commit in external tree. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3093 Lustre-change: http://review.whamcloud.com/6092 Signed-off-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19staging/lustre/lnet: remove extra space in lstcon_rpc_trans_abortAmir Shehata
This is coding style fix part of original Lustre commit in external tree. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3093 Lustre-change: http://review.whamcloud.com/6092 Signed-off-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19staging/lustre/lnet: coding style fix for lst_test_add_ioctlAmir Shehata
To make the function a bit easier to read. This is coding style fix part of original Lustre commit in external tree. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3093 Lustre-change: http://review.whamcloud.com/6092 Signed-off-by: Amir Shehata <amir.shehata@intel.com> Reviewed-by: Isaac Huang <he.huang@intel.com> Reviewed-by: Liang Zhen <liang.zhen@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19drivers/staging/lustre: indent lustre_ldlm_flags_valsPeng Tao
To follow kernel's "no spaces at the start of a line" rule. Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-19staging/lustre/hsm: Implementation of exclusive openJinshan Xiong
Proposed way to do exclusive open: 0. First of all, we have to perform most of the work in kernel space; 1. Client exclusively opens the file with IT_RELEASE_OPEN. 1.1 exclusive open means the open will fail if the file is being opened by somebody else; 2. the MDT will handle IT_RELEASE as follows: 2.1 Revoke OPEN_LOCK on this file, just request EX mode of MDS_INODELOCK_OPEN lock and release it; 2.2 Acquire a rwsem, say open_rwsem, with write mode before trying to the file; for the normal open, it should acquire read mode of open_rwsem; 2.3 Check if the file is already being opened by others, if not return with -EBUSY; 2.4 Check if the file can be released; 2.5 Set a special flag in struct mdt_file_data to mark this open is exclusive; 2.5 Release open rwsem. >From now on, if the file is opened by others, it will mark mdt_file_data that the exclusive open is broken. 3. Client: if IT_RELEASE_OPEN is finished successfully, and do followings: 3.1 Acquire full PW or EX extent lock to flush dirty cache; 3.2 Pack the handle of layout lock, data version and other attars; 3.3 Close the file with IT_RELEASE_CLOSE. 4. Back to MDT to handle IT_RELEASE CLOSE: 4.1 Grab the open_rwsem 4.2 Check if the exclusive open has ever been broken, in that case, the RELEASE process will fail; 4.3 Verify the data version matches archive; 4.4 Grab EX layout lock 4.5 Swap the layout 4.6 Release EX layout lock 4.7 Close the exclusive open Basically we avoid granting EX layout lock back to client and introduce exclusive open so that we know it if the file has ever being accessed. I hope this can simplify things a little bit. Also, exclusive open can be used to implement file lease. In this patch, a framework of lease is implemented. However, only exclusive lease is supported right now. To apply a lease, MDS_OPEN_LEASE must be set to open the file, EX mode open lock is returned to the client side to hold a lease. From that time on, if this file is opened again by other processes, the open lock will be revoked so the client who holds the lease will know the lease is already broken by checking that open lock. To release a lease, normal close is used. The client will revoke the open lock before sending CLOSE request. Lease can be applied in two ways. ll_lease_open()/close() can be called directly if the lease holder is in kernel space; or if the lease holder lives in user space, it has to open the file first and then use ioctl() with command LL_IOC_SET_LEASE to apply a lease. The lease holder has to poll the lease status itself. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2919 Lustre-change: http://review.whamcloud.com/6730 Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com> Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging:dwc2:hcd_queue.c : cleanups to the microframe scheduler codeHimangi Saraogi
This patch takes up the task mentioned in the TODO file of dwc2 to cleanup the microframe scheduler code. The while(!done) loops have been replaced with appropriate for loops and unnecessary variables like done and ret have been removed. Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging/lustre/lov: convert magic to host-endian in lov_dump_lmm()John L. Hammond
In lov_dump_lmm(), convert the lmm_magic from little-endian to host-endian byte order before the switch statement, as the other lov_dump_xxx() and lov_verify_xxx() functions already do. Remove the unused macro LMM_ASSERT(). Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3297 Lustre-change: http://review.whamcloud.com/6290 Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Li Wei <wei.g.li@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging/lustre/llog: fix return value of llog_alloc_handleLi Xi
llog_open() calls llog_alloc_handle() taking NULL as the error return value. But llog_alloc_handle() returns ERR_PTR(-ENOMEM) instead when error. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3470 Lustre-change: http://review.whamcloud.com/6644 Signed-off-by: Li Xi <pkuelelixi@gmail.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging/lustre/autoconf: remove LIBCFS_HAVE_IS_COMPAT_TASK testJames Simmons
is_compat_task has been defined on all arches since v2.6.29. We can remove the test and dead code. Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2800 Lustre-change: http://review.whamcloud.com/5393 Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging/lustre/autoconf: remove vectored fops testsJames Simmons
file_operations.readv/writev have been removed since v2.6.19 We can remove the test and the dead code. Lustre-change: http://review.whamcloud.com/5343 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2800 Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: James Simmons <uja.ornl@gmail.com> Reviewed-by: Bob Glossman <bob.glossman@intel.com> Reviewed-by: Christopher J. Morrone <chris.morrone.llnl@gmail.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging/lustre/llite: use correct FID in ll_och_fill()John L. Hammond
When ll_intent_file_open() is called on a file with a stale dentry, ll_och_fill() may incorrectly use the FID from the struct ll_inode_info rather than the FID from the response body (which is the correct FID for the close). Fix this, remove the ll_inode_info parameter from ll_och_fill(), and move the call to ll_ioepoch_open() from ll_och_fill() to ll_local_open(). Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3233 Lustre-change: http://review.whamcloud.com/6695 Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-by: Fan Yong <fan.yong@intel.com> Reviewed-by: Mike Pershin <mike.pershin@intel.com> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging/lustre: remove llog_server.cPeng Tao
It is only used by server. Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging/lustre: remove lu_target.hPeng Tao
It is only needed by server code. Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-15staging/lustre/llite: restore ll_fiemapPeng Tao
It was removed by coan by mistake when first porting the code. Signed-off-by: Peng Tao <bergwolf@gmail.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: fix checkpatch issue regarding pointer coding styleKristina Martsenko
Fix the following checkpatch error: ERROR: "(foo*)" should be "(foo *)" Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Reviewed-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: ptlrpc: fix label indentationKristina Martsenko
Fix the following type of checkpatch warning to comply with coding style: WARNING: labels should not be indented Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: ptlrpc: fix indentationKristina Martsenko
Fix the following type of checkpatch warning to comply with coding style: WARNING: suspect code indent for conditional statements Also join a debug string split across lines, as it was on the same lines as the other changes anyway. And reformat some comments in the kernel coding style for the same reason. Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: ptlrpc: remove whitespace before a newlineKristina Martsenko
Fix the following type of checkpatch warning: WARNING: unnecessary whitespace before a quoted newline Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: ptlrpc: convert spaces to tabsKristina Martsenko
Fix the following type of checkpatch warning to comply with coding style: WARNING: please, no spaces at the start of a line Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: ptlrpc: remove an unnecessary semicolonKristina Martsenko
Remove an unnecessary semicolon and remove a space before another one to comply with coding style. Fix the following type of checkpatch warning: WARNING: space prohibited before semicolon Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: ptlrpc: clean up whitespace around bracesKristina Martsenko
Fix the following types of checkpatch errors to comply with coding style: ERROR: space required after that close brace '}' ERROR: space required before the open brace '{' Also change "if (x == 0)" into "if (!x)" on one line, to avoid introducing new checkpatch issues. Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: ptlrpc: clean up whitespace around parenthesesKristina Martsenko
Fix the following types of checkpatch errors and warnings to comply with coding style: ERROR: space required before the open parenthesis '(' ERROR: space prohibited after that open parenthesis '(' ERROR: space prohibited before that close parenthesis ')' WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: lustre: ptlrpc: pack_generic: clean up whitespace around parenthesesKristina Martsenko
Fix the following types of checkpatch errors and warnings in pack_generic.c to comply with coding style: ERROR: space required before the open parenthesis '(' ERROR: space prohibited before that close parenthesis ')' WARNING: space prohibited between function name and open parenthesis '(' Signed-off-by: Kristina Martsenko <kristina.martsenko@gmail.com> Reviewed-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: ced401: ced_ioc: fix a blank/tab codingstyle issue.Joachim Adi Schuetz
Fixed a coding style issue - removed a blank before a tab. Signed-off-by: Joachim Adolf Schuetz <jas@catbull.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12mm/staging: remove unnecessary inclusion of bootmem.hGrygorii Strashko
Clean-up to remove depedency with bootmem headers. Cc: Yinghai Lu <yinghai@kernel.org> Cc: Tejun Heo <tj@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: William Hubbs <w.d.hubbs@gmail.com> Cc: Chris Brannon <chris@the-brannons.com> Cc: Kirk Reiser <kirk@reisers.ca> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12Staging: silicom: Remove unnecessary variable from get_bypass_info()Rupert Muchembled
Remove unnecessary variable ioctl from get_bypass_info(). As a consequence, this patch removes an assignment to ioctl in an if condition, reported by checkpatch.pl. Signed-off-by: Rupert Muchembled <rupert@rmuch.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12Staging: silicom: Remove unnecessary variable from do_cmd()Rupert Muchembled
Remove unnecessary variable ioctl from do_cmd(). As a consequence, this patch removes an assignment to ioctl in an if condition, reported by checkpatch.pl. Signed-off-by: Rupert Muchembled <rupert@rmuch.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: vt6656: main_usb.c ether_crc use kernel codeMalcolm Priestley
use ether_crc already in kernel and remove local version. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: vt6656: cleanup device_init_registersMalcolm Priestley
White space and formatting clean up. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging; vt6656: device_init_registers Change vnt_cmd_card_int and ↵Malcolm Priestley
vnt_rsp_card_int to off stack Move structures to vnt_private and convert to pointers in device_init_registers. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: vt6656: Replace typedef struct _RSP_CARD_INIT.Malcolm Priestley
Replace with struct vnt_rsp_card_rsp init_rsp in device_init_registers. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: vt6656: Replace typedef struct _CMD_CARD_INITMalcolm Priestley
Replace with struct vnt_cmd_card_init init_cmd in device_init_registers. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: vt6656: device.h Remove typedef enum __device_init_type.Malcolm Priestley
Since typedef enum __device_init_type is only ever called in one state. Remove the typedef from main_usb.c:device_init_registers and replace with macro values. The other values may be needed later. Apply cold value to sInitCmd.byInitClass. Remove if braces and correct formatting within. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12drm/imx: directly call drm_put_dev in ->removeDaniel Vetter
Again no apparent user of the driver data field. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging/olpc_docn: reorder the lock sequence to avoid potential dead lockGu Zheng
The lock sequence of dcon_blank_fb(fb_info->lock ---> console_lock) is against with the one of console_callback(console_lock ---> fb_info->lock), it'll lead to a potential dead lock, so reorder the lock sequence of dcon_blank_fb to avoid the potential dead lock. Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: ozwpan: remove unneeded __GFP_ZERO to kzalloc() at ↵Jie Liu
oz_elt_stream_create() Get rid of the needless __GFP_ZERO flag for kzalloc() at oz_elt_stream_create(). Signed-off-by: Jie Liu <jeff.liu@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12Staging: ft1000: ft1000_download: fixed coding style issuesAldo Iljazi
Fixed the following coding style issues: Lines 84-91,99-106,275,514: Replaced spaces at the start of the lines with tabs. Lines 205,271: Inserted spaces after the commas. Lines 275,1060,1065: Indented the code with tabs instead of spaces. Line 275: Inserted spaces around '=' and '<', also moved the trailing statement on the next line. Line 512: Removed space between function name and open parenthesis. Line 839: Removed space after '&'. Line 853: Removed space after '&'. Signed-off-by: Aldo Iljazi <mail@aldo.io> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12Staging: ft1000: boot.h: fixed a few styling issuesAldo Iljazi
Fixed the following styling issues: Line 30: Removed space before open square bracket '[' Lines 31 to 155: Moved the commas that were in the start of the lines, to the end of the lines. Inserted spaces after the commas. Inserted a one tab indentation to each line. Signed-off-by: Aldo Iljazi <mail@aldo.io> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: android: Fix typo in android/sync.hMasanari Iida
Correct spelling typo in android/sync.h Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12drivers: staging: speakup: serialio: only use platform specific ↵Chen Gang
SERIAL_PORT_DFNS. If SERIAL_PORT_DFNS isn't present by platform, it need be defined to "nothing", like the 8250 serial driver does it. All related macros also need be removed: IRQF_SHARED is defined in "linux/interrupt.h", others will be defined when related architecture has SERIAL_PORT_DFNS. Or it will cause issue (for arc, with allmodconfig): CC [M] drivers/staging/speakup/serialio.o drivers/staging/speakup/serialio.c:12:2: error: initializer element is not constant SERIAL_PORT_DFNS ^ drivers/staging/speakup/serialio.c:12:2: error: (near initialization for 'rs_table[0].baud_base') drivers/staging/speakup/serialio.c:12:2: error: initializer element is not constant drivers/staging/speakup/serialio.c:12:2: error: (near initialization for 'rs_table[1].baud_base') drivers/staging/speakup/serialio.c:12:2: error: initializer element is not constant drivers/staging/speakup/serialio.c:12:2: error: (near initialization for 'rs_table[2].baud_base') drivers/staging/speakup/serialio.c:12:2: error: initializer element is not constant drivers/staging/speakup/serialio.c:12:2: error: (near initialization for 'rs_table[3].baud_base') Signed-off-by: Chen Gang <gang.chen@asianux.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12lustre/fld: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERODuan Jiong
This patch fixes coccinelle error regarding usage of IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO. Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: comedi: protect buffer from being freed while mmappedIan Abbott
If a comedi device is automatically detached by `comedi_auto_unconfig()` any data buffers associated with subdevices that support asynchronous commands will be freed. If the buffer is mmapped at the time, bad things are likely to happen! Prevent this by moving some of the buffer details from `struct comedi_async` into a new, dynamically allocated, and kref-counted `struct comedi_buf_map`. This holds a list of pages, a reference count, and enough information to free the pages. The new member `buf_map` of `struct comedi_async` points to a `struct comedi_buf_map` when the buffer size is non-zero. Provide a new helper function `comedi_buf_is_mapped()` to check whether an a buffer is mmapped. If it is mmapped, the buffer is not allowed to be resized and the device is not allowed to be manually detached by the `COMEDI_DEVCONFIG` ioctl. Provide helper functions `comedi_buf_map_get()` and `comedi_buf_map_put()` to manipulate the reference count of the `struct comedi_buf_map`, which will be freed along with its contents via the 'release' callback of the `kref_put()` call. The reference count is manipulated by the vma operations and the mmap file operation. Now, when the comedi device is automatically detached, the buffer will be effectively freed by calling `comedi_buf_alloc()` with a new buffer size of 0. That calls local function `__comedi_buf_free()` which calls `comedi_buf_map_put()` on the `buf_map` member to free it. It won't actually be freed until the final 'put'. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: comedi: make determination of read or write subdevice saferIan Abbott
`comedi_read_subdevice()` and `comedi_write_subdevice()` respectively determine the read and write subdevice to use for a comedi device, depending on a minor device number passed in. The comedi device has a main "board" minor device number and may also have dynamically assigned, subdevice-specific minor device numbers, in a range of numbers shared by all comedi devices. If the minor device number is within the range of subdevice-specific minor device numbers, both functions call `comedi_subdevice_from_minor()` to determine what subdevice is associated with the minor device number (if any) and then check the subdevice belongs to the comedi device. Since the subdevice might belong to a different comedi device, the check is not protected against the subdevice being freed. Perform the check in `comedi_subdevice_from_minor()` instead, where it is protected against the subdevice being freed. Make it return `NULL` if the subdevice does not belong to the device. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: comedi: remove comedi_dev_from_minor()Ian Abbott
The `comedi_dev_from_minor()` function is no longer used, so remove it. Calls to it have either been replaced by calls to `comedi_dev_get_from_minor()` or by using the `private_data` member of the open file object. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: comedi: use file->private_data in file operationsIan Abbott
Since the `struct comedi_device` should now be protected from being freed while an open file object is using it, use the `private_data` member of the `struct file` to point to it. Set it in `comedi_open()` and use it in the other file operation handlers instead of calling `comedi_dev_from_minor()` and checking the result. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: comedi: kcomedilib: protect against device detachmentIan Abbott
The functions in "kcomedilib" need to prevent the comedi device being detached during their operation. This can be done by acquiring either the main mutex or the "attach lock" semaphore in the `struct comedi_device`. Use the attach lock when merely checking whether the device is attached. Use the mutex when processing a comedi instruction. Also, don't bother trying to manipulate the module use count of low-level comedi driver in `comedi_open()` and `comedi_close()`. If the device gets detached while it is "open", we wouldn't be able to decrement the module use count anyway. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: comedi: kcomedilib: increment reference while device in useIan Abbott
Low-level comedi drivers that use the "kcomedilib" module (currently only the "comedi_bond" driver) call `comedi_open()` to "open" another comedi device (not as a file) and `comedi_close()` to "close" it. (Note: these are the functions exported by the "kcomedilib" module, not the identically named, statically linked functions in the core "comedi" module.) In `comedi_open()`, call `comedi_dev_get_from_minor()` instead of `comedi_dev_from_minor()` to get the pointer to the `struct comedi_device` being "opened". This increments its reference count to prevent it being freed. Call `comedi_dev_put()` if `comedi_open()` returns `NULL`, and also call it from `comedi_close()`. This decrements the reference count. Note that although we now protect against the `struct comedi_device` being freed, we do not yet protect against it being "detached" while it is being used. This will be addressed by a later patch. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: comedi: use refcount in sysfs attribute handlersIan Abbott
Call `comedi_dev_get_from_minor()` instead of `comedi_dev_from_minor()` in the sysfs attribute handler functions to increment the reference of the `struct comedi_device` during the operation. Call `comedi_dev_put()` to decrement the reference afterwards. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-12staging: comedi: use refcount while reading /proc/comediIan Abbott
In the seq_file 'show' handler for "/proc/comedi" - `comedi_read()` in "comedi/proc.c", call `comedi_dev_get_from_minor()` instead of `comedi_dev_from_minor()` to increment the reference counter for the `struct comedi_device` while it is being examined. Call `comedi_dev_put()` to decrement the reference afterwards. Also acquire the `attach_lock` rwsem while checking whether the device is attached. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>