aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2018-08-21test_ida: Move ida_check_maxMatthew Wilcox2-28/+23
Convert to new API and move to kernel space. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21test_ida: Move ida_check_leafMatthew Wilcox2-27/+25
Convert to new API and move to kernel space. Take the opportunity to test the situation a little more thoroughly (ie at different offsets). Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21idr-test: Convert ida_check_nomem to new APIMatthew Wilcox1-6/+7
We can't move this test to kernel space because there's no way to force kmalloc to fail. But we can use the new API and check this works when the test is in userspace. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21ida: Start new test_ida moduleMatthew Wilcox7-7/+71
Start transitioning the IDA tests into kernel space. Framework heavily cribbed from test_xarray.c. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21target/iscsi: Allocate session IDs from an IDAMatthew Wilcox3-30/+10
Since the session is never looked up by ID, we can use the more space-efficient IDA instead of the IDR. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21iscsi target: fix session creation failure handlingMike Christie1-14/+21
The problem is that iscsi_login_zero_tsih_s1 sets conn->sess early in iscsi_login_set_conn_values. If the function fails later like when we alloc the idr it does kfree(sess) and leaves the conn->sess pointer set. iscsi_login_zero_tsih_s1 then returns -Exyz and we then call iscsi_target_login_sess_out and access the freed memory. This patch has iscsi_login_zero_tsih_s1 either completely setup the session or completely tear it down, so later in iscsi_target_login_sess_out we can just check for it being set to the connection. Cc: stable@vger.kernel.org Fixes: 0957627a9960 ("iscsi-target: Fix sess allocation leak in...") Signed-off-by: Mike Christie <mchristi@redhat.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21drm/vmwgfx: Convert to new IDA APIMatthew Wilcox1-29/+12
Reorder allocation to avoid an awkward lock/unlock/lock sequence. Simpler code due to being able to use ida_alloc_max(), even if we can't eliminate the driver's spinlock. Signed-off-by: Matthew Wilcox <willy@infradead.org> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2018-08-21dmaengine: Convert to new IDA APIMatthew Wilcox1-16/+7
Simpler and shorter code. Signed-off-by: Matthew Wilcox <willy@infradead.org> Acked-by: Vinod Koul <vkoul@kernel.org>
2018-08-21ppc: Convert vas ID allocation to new IDA APIMatthew Wilcox1-22/+4
Removes a custom spinlock and simplifies the code. Also fix an error where we could allocate one ID too many. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21media: Convert entity ID allocation to new IDA APIMatthew Wilcox1-11/+5
Removes a call to ida_pre_get(). Signed-off-by: Matthew Wilcox <willy@infradead.org> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-21ppc: Convert mmu context allocation to new IDA APIMatthew Wilcox1-40/+4
ida_alloc_range is the perfect fit for this use case. Eliminates a custom spinlock, a call to ida_pre_get and a local check for the allocated ID exceeding a maximum. Signed-off-by: Matthew Wilcox <willy@infradead.org> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
2018-08-21Convert net_namespace to new IDA APIMatthew Wilcox1-10/+6
Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21cb710: Convert to new IDA APIMatthew Wilcox1-18/+5
Eliminates the custom spinlock and the call to ida_pre_get. Signed-off-by: Matthew Wilcox <willy@infradead.org> Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
2018-08-21rsxx: Convert to new IDA APIMatthew Wilcox1-16/+5
Eliminate the custom spinlock and the call to ida_pre_get. Also add a call to ida_free() in the card remove routine, which I believe fixes a bug in this driver. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21osd: Convert to new IDA APIMatthew Wilcox1-15/+7
Slightly simpler code. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21sd: Convert to new IDA APIMatthew Wilcox1-17/+4
Allows us to remove an explicit spinlock. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21devpts: Convert to new IDA APIMatthew Wilcox1-34/+13
ida_alloc_max() matches what this driver wants to do. Also removes a call to ida_pre_get(). We no longer need the protection of the mutex, so convert pty_count to an atomic_t and remove the mutex entirely. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21fs: Convert namespace IDAs to new APIMatthew Wilcox1-38/+12
We don't need to keep track of the starting value; the IDA is efficient. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21fs: Convert unnamed_dev_ida to new APIMatthew Wilcox1-43/+24
The new API is much easier for this user. Also add kerneldoc for get_anon_bdev(). Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21mtip32xx: Convert to new IDA APIMatthew Wilcox1-23/+6
Removes a use of ida_pre_get() and a personalised spinlock. Signed-off-by: Matthew Wilcox <willy@infradead.org> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
2018-08-21ida: Add new APIMatthew Wilcox2-42/+87
Add ida_alloc(), ida_alloc_min(), ida_alloc_max(), ida_alloc_range() and ida_free(). The ida_alloc_max() and ida_alloc_range() functions differ from ida_simple_get() in that they take an inclusive 'max' parameter instead of an exclusive 'end' parameter. Callers are about evenly split whether they'd like inclusive or exclusive parameters and 'max' is easier to document than 'end'. Change the IDA allocation to first attempt to allocate a bit using existing memory, and only allocate memory afterwards. Also change the behaviour of 'min' > INT_MAX from being a BUG() to returning -ENOSPC. Leave compatibility wrappers in place for ida_simple_get() and ida_simple_remove() to avoid changing all callers. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21ida: Lock the IDA in ida_destroyMatthew Wilcox1-6/+11
The user has no need to handle locking between ida_simple_get() and ida_simple_remove(). They shouldn't be forced to think about whether ida_destroy() might be called at the same time as any of their other IDA manipulation calls. Improve the documnetation while I'm in here. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21radix-tree: Fix UBSAN warningMatthew Wilcox1-1/+1
get_slot_offset() can be called with a NULL 'parent' argument. In this case, the calculated value will not be used, but calculating it is undefined. Rather than fixing the caller (__radix_tree_delete) to not call get_slot_offset(), make get_slot_offset() robust against being called with a NULL parent. Signed-off-by: Matthew Wilcox <willy@infradead.org>
2018-08-21radix tree test suite: Enable ubsanMatthew Wilcox2-11/+14
Add support for the undefined behaviour sanitizer and fix the bugs that ubsan pointed out. Nothing major, and all in the test suite, not the code. Signed-off-by: Matthew Wilcox <willy@infradead.org>