Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e711f968 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jason Gunthorpe
Browse files

IB/srp: replace custom implementation of hex2bin()



There is no need to have a duplication of the generic library, i.e.
hex2bin().

Replace the open coded variant.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 1b19b951
Loading
Loading
Loading
Loading
+3 −10
Original line number Original line Diff line number Diff line
@@ -3110,7 +3110,6 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
{
{
	char *options, *sep_opt;
	char *options, *sep_opt;
	char *p;
	char *p;
	char dgid[3];
	substring_t args[MAX_OPT_ARGS];
	substring_t args[MAX_OPT_ARGS];
	int opt_mask = 0;
	int opt_mask = 0;
	int token;
	int token;
@@ -3162,16 +3161,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
				goto out;
				goto out;
			}
			}


			for (i = 0; i < 16; ++i) {
			ret = hex2bin(target->orig_dgid.raw, p, 16);
				strlcpy(dgid, p + i * 2, sizeof(dgid));
				if (sscanf(dgid, "%hhx",
					   &target->orig_dgid.raw[i]) < 1) {
					ret = -EINVAL;
			kfree(p);
			kfree(p);
			if (ret < 0)
				goto out;
				goto out;
				}
			}
			kfree(p);
			break;
			break;


		case SRP_OPT_PKEY:
		case SRP_OPT_PKEY: