/* * getopt.c */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include #include #include #include "getopt.h" /** * ncp_getopt - option parser * @caller: name of the caller, for error messages * @options: the options string * @opts: an array of &struct option entries controlling parser operations * @optopt: output; will contain the current option * @optarg: output; will contain the value (if one exists) * @value: output; may be NULL; will be overwritten with the integer value * of the current argument. * * Helper to parse options on the format used by mount ("a=b,c=d,e,f"). * Returns opts->val if a matching entry in the 'opts' array is found, * 0 when no more tokens are found, -1 if an error is encountered. */ int ncp_getopt(const char *caller, char **options, const struct ncp_option *opts, char **optopt, char **optarg, unsigned long *value) { char *token; char *val; do { if ((token = strsep(options, ",")) == NULL) return 0; } while (*token == '\0'); if (optopt) *optopt = token; if ((val = strchr (token, '=')) != NULL) { *val++ = 0; } *optarg = val; for (; opts->name; opts++) { if (!strcmp(opts->name, token)) { if (!val) { if (opts->has_arg & OPT_NOPARAM) { return opts->val; } pr_info("%s: the %s option requires an argument\n", caller, token); return -EINVAL; } if (opts->has_arg & OPT_INT) { int rc = kstrtoul(val, 0, value); if (rc) { pr_info("%s: invalid numeric value in %s=%s\n", caller, token, val); return rc; } return opts->val; } if (opts->has_arg & OPT_STRING) { return opts->val; } pr_info("%s: unexpected argument %s to the %s option\n", caller, val, token); return -EINVAL; } } pr_info("%s: Unrecognized mount option %s\n", caller, token); return -EOPNOTSUPP; } .git/commit/include/scsi/srp.h?id=7a7b5df84b6b4e5d599c7289526eed96541a0654'>commitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-01-30 11:26:38 +0100
committerJiri Kosina <jkosina@suse.cz>2017-01-31 12:59:32 +0100
commit7a7b5df84b6b4e5d599c7289526eed96541a0654 (patch)
treecf7514c7ddf4410fe37ca9099a2785e1cf08fa7d /include/scsi/srp.h
parent877a021e08ccb6434718c0cc781fdf943c884cc0 (diff)
HID: cp2112: fix sleep-while-atomic
A recent commit fixing DMA-buffers on stack added a shared transfer buffer protected by a spinlock. This is broken as the USB HID request callbacks can sleep. Fix this up by replacing the spinlock with a mutex. Fixes: 1ffb3c40ffb5 ("HID: cp2112: make transfer buffers DMA capable") Cc: stable <stable@vger.kernel.org> # 4.9 Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'include/scsi/srp.h')
7-02-04
net: ipv6: Allow shorthand delete of all nexthops in multipath routeDavid Ahern1-1/+3
2017-02-03net: remove support for per driver ndo_busy_poll()Eric Dumazet2-5/+0
2017-02-03Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-nextDavid S. Miller11-40/+60
2017-02-03sched: cls_flower: expose priority to offloading netdeviceJiri Pirko1-0/+1
2017-02-03lib: Introduce priority array area managerJiri Pirko1-0/+76
2017-02-03list: introduce list_for_each_entry_from_reverse helperJiri Pirko1-0/+13
2017-02-03trace: rename trace_print_hex_seq arg and add kdocDaniel Borkmann2-3/+3
2017-02-03bridge: uapi: add per vlan tunnel infoRoopa Prabhu3-0/+13
2017-02-03vxlan: support fdb and learning in COLLECT_METADATA modeRoopa Prabhu1-0/+1
2017-02-03ip_tunnels: new IP_TUNNEL_INFO_BRIDGE flag for ip_tunnel_info modeRoopa Prabhu1-0/+1
2017-02-03net/sched: act_ife: Change to use ife moduleYotam Gigi2-10/+1
2017-02-03net: Introduce ife encapsulation moduleYotam Gigi3-0/+70
2017-02-03net/sched: act_ife: Unexport ife_tlv_meta_encodeYotam Gigi1-2/+0
2017-02-03tcp: add tcp_mss_clamp() helperEric Dumazet1-0/+9
2017-02-02net: add LINUX_MIB_PFMEMALLOCDROP counterEric Dumazet1-0/+1
2017-02-02net: phy: marvell: Add support for 88e1545 PHYAndrew Lunn1-0/+1
2017-02-02unix: add ioctl to open a unix socket file with O_PATHAndrey Vagin1-0/+2
2017-02-02net: phy: Marvell: Add mv88e6390 internal PHYAndrew Lunn1-0/+6
2017-02-02Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller9-30/+40
2017-02-02netfilter: allow logging from non-init namespacesMichal Kubeček1-0/+3
2017-02-02ipvs: free ip_vs_dest structs when refcnt=0David Windsor1-1/+1
2017-02-02netfilter: merge ctinfo into nfct pointer storage areaFlorian Westphal2-17/+15
2017-02-02netfilter: guarantee 8 byte minalign for template addressesFlorian Westphal1-0/+2
2017-02-02netfilter: add and use nf_ct_set helperFlorian Westphal2-2/+9
2017-02-02skbuff: add and use skb_nfct helperFlorian Westphal2-4/+11
2017-02-02netfilter: reduce direct skb->nfct usageFlorian Westphal1-3/+6
2017-02-02netfilter: conntrack: no need to pass ctinfo to error handlerFlorian Westphal1-1/+1