lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110705160132.GA7214@kroah.com>
Date:	Tue, 5 Jul 2011 09:01:32 -0700
From:	Greg KH <greg@...ah.com>
To:	"K. Y. Srinivasan" <kys@...rosoft.com>
Cc:	gregkh@...e.de, linux-kernel@...r.kernel.org,
	devel@...uxdriverproject.org, virtualization@...ts.osdl.org,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	Hank Janssen <hjanssen@...rosoft.com>
Subject: Re: [PATCH 07/77] Staging: hv: vmbus: Introduce a function to map
 the dev_type guid to a name

On Thu, Jun 16, 2011 at 01:16:40PM -0700, K. Y. Srinivasan wrote:
> In preparation for introducing machinery to support autoloading vmbus 
> drivers, introduce a function to map the dev_type guid to a human readable name.

"Human readable"?

<snip>

> +static const char *blk_dev_type = "hv_block";
> +static const char *net_dev_type = "hv_net";
> +static const char *scsi_dev_type = "hv_scsi";
> +static const char *mouse_dev_type = "hv_mouse";
> +static const char *util_dev_type = "hv_util";

It looks like these are the module names, which aren't the most "human
readable" around.

> +/*
> + * Map the dev_type guid to a human readable string for setting
> + * up module aliases. The indices used in this function are based on
> + * the table defined earlier - supported_device_classes[]
> + */
> +const char *hv_get_devtype_name(const struct hv_guid *type)
> +{
> +	int i;
> +
> +	for (i = 0; i < MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++) {
> +		if (!memcmp(type, supported_device_classes[i].data,
> +				sizeof(struct hv_guid))) {
> +			switch (i) {
> +			case 0:
> +				return scsi_dev_type;
> +			case 1:
> +				return net_dev_type;
> +			case 2:
> +				return mouse_dev_type;
> +			case 3:
> +				return blk_dev_type;
> +			}
> +		}
> +	}
> +	/*
> +	 * Currently the util driver is used
> +	 * to handle all these devices.
> +	 */
> +	return util_dev_type;
> +}

Ok, you create a function to return a string, but I'm really afraid of
what you are going to do in the next patch with this...

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ