be16_to_cpup((u16 *)(out_mad->data + 40 + offset / 8))); 
be16_to_cpup((__be16 *)(out_mad->data + 40 + offset / 8))); 
static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr,				char *buf){	struct port_table_attribute *tab_attr =		container_of(attr, struct port_table_attribute, attr);	int offset = tab_attr->index & 0xffff;	int width  = (tab_attr->index >> 16) & 0xff;	struct ib_mad *in_mad  = NULL;	struct ib_mad *out_mad = NULL;	ssize_t ret;	if (!p->ibdev->process_mad)		return sprintf(buf, "N/A (no PMA)\n");	in_mad  = kmalloc(sizeof *in_mad, GFP_KERNEL);	out_mad = kmalloc(sizeof *in_mad, GFP_KERNEL);	if (!in_mad || !out_mad) {		ret = -ENOMEM;		goto out;	}	memset(in_mad, 0, sizeof *in_mad);	in_mad->mad_hdr.base_version  = 1;	in_mad->mad_hdr.mgmt_class    = IB_MGMT_CLASS_PERF_MGMT;	in_mad->mad_hdr.class_version = 1;	in_mad->mad_hdr.method        = IB_MGMT_METHOD_GET;	in_mad->mad_hdr.attr_id       = cpu_to_be16(0x12); /* PortCounters */	in_mad->data[41] = p->port_num;	/* PortSelect field */	if ((p->ibdev->process_mad(p->ibdev, IB_MAD_IGNORE_MKEY,		 p->port_num, NULL, NULL, in_mad, out_mad) &	     (IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY)) !=	    (IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY)) {		ret = -EINVAL;		goto out;	}	switch (width) {	case 4:		ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >>					    (offset % 4)) & 0xf);		break;	case 8:		ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]);		break;	case 16:		ret = sprintf(buf, "%u\n",			      be16_to_cpup((u16 *)(out_mad->data + 40 + offset / 8)));		break;	case 32:		ret = sprintf(buf, "%u\n",			      be32_to_cpup((u32 *)(out_mad->data + 40 + offset / 8)));		break;	default:		ret = 0;	}out:	kfree(in_mad);	kfree(out_mad);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/97f52eb438be7caebe026421545619d8a0c1398a/sysfs.c/clean/drivers/infiniband/core/sysfs.c