usb: gadget: printer: Remove pnp_string static buffer

pnp string is usually much shorter than 1k so let's stop wasting 1k of
memory for its buffer and make it dynamically alocated.
This also removes 1k len limitation for pnp_string and
adds a new line after string content if required.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Krzysztof Opasiak
2016-12-21 09:48:45 +01:00
committed by Felipe Balbi
parent 00b6c62eb7
commit fdc01cc286
3 changed files with 62 additions and 28 deletions

View File

@@ -18,12 +18,11 @@
#include <linux/usb/composite.h>
#define PNP_STRING_LEN 1024
struct f_printer_opts {
struct usb_function_instance func_inst;
int minor;
char pnp_string[PNP_STRING_LEN];
char *pnp_string;
bool pnp_string_allocated;
unsigned q_len;
/*