Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mei: drop mei_io_cb_alloc_buf

mei_io_cb_alloc_buf have a single caller :mei_cl_alloc_cb. After amthif
stopped using it, the code can be integrated into the caller and the
function can be dropped.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexander Usyskin and committed by
Greg Kroah-Hartman
aab3b1a3 35eda92a

+6 -28
+6 -26
drivers/misc/mei/client.c
··· 420 420 } 421 421 422 422 /** 423 - * mei_io_cb_alloc_buf - allocate callback buffer 424 - * 425 - * @cb: io callback structure 426 - * @length: size of the buffer 427 - * 428 - * Return: 0 on success 429 - * -EINVAL if cb is NULL 430 - * -ENOMEM if allocation failed 431 - */ 432 - int mei_io_cb_alloc_buf(struct mei_cl_cb *cb, size_t length) 433 - { 434 - if (!cb) 435 - return -EINVAL; 436 - 437 - if (length == 0) 438 - return 0; 439 - 440 - cb->buf.data = kmalloc(length, GFP_KERNEL); 441 - if (!cb->buf.data) 442 - return -ENOMEM; 443 - cb->buf.size = length; 444 - return 0; 445 - } 446 - 447 - /** 448 423 * mei_cl_alloc_cb - a convenient wrapper for allocating read cb 449 424 * 450 425 * @cl: host client ··· 439 464 if (!cb) 440 465 return NULL; 441 466 442 - if (mei_io_cb_alloc_buf(cb, length)) { 467 + if (length == 0) 468 + return cb; 469 + 470 + cb->buf.data = kmalloc(length, GFP_KERNEL); 471 + if (!cb->buf.data) { 443 472 mei_io_cb_free(cb); 444 473 return NULL; 445 474 } 475 + cb->buf.size = length; 446 476 447 477 return cb; 448 478 }
-2
drivers/misc/mei/client.h
··· 85 85 struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl, enum mei_cb_file_ops type, 86 86 const struct file *fp); 87 87 void mei_io_cb_free(struct mei_cl_cb *priv_cb); 88 - int mei_io_cb_alloc_buf(struct mei_cl_cb *cb, size_t length); 89 - 90 88 91 89 /** 92 90 * mei_io_list_init - Sets up a queue list.