On Fri, Feb 17, 2006 at 04:57:14PM -0800, Roland Dreier wrote:
> +int hipz_count_adapters(void)
> +{
> + int num = 0;
> + struct device_node *dn = NULL;
> +
> + EDEB_EN(7, "");
> +
> + while ((dn = of_find_node_by_name(dn, "lhca"))) {
> + num++;
> + }
The { } are not needed here.
> +
> + of_node_put(dn);
> +
> + if (num == 0) {
> + EDEB_ERR(4, "No lhca node name was found in the"
> + " Open Firmware device tree.");
> + return -ENODEV;
> + }
> +
> + EDEB(6, " ... found %x adapter(s)", num);
> +
> + EDEB_EX(7, "num=%x", num);
> +
> + return num;
> +}
> +
> +int hipz_probe_adapters(char **adapter_list)
> +{
> + int ret = 0;
> + int num = 0;
> + struct device_node *dn = NULL;
> + char *loc;
> +
> + EDEB_EN(7, "adapter_list=%p", adapter_list);
> +
> + while ((dn = of_find_node_by_name(dn, "lhca"))) {
> + loc = get_property(dn, "ibm,loc-code", NULL);
> + if (loc == NULL) {
> + EDEB_ERR(4, "No ibm,loc-code property for"
> + " lhca Open Firmware device tree node.");
> + ret = -ENODEV;
> + goto probe_adapters0;
> + }
> +
> + adapter_list[num] = loc;
> + EDEB(6, " ... found adapter[%x] with loc-code: %s", num, loc);
> + num++;
> + }
> +
> + probe_adapters0:
> + of_node_put(dn);
Please use tabs everywhere.
Hm, wait, that's a label. Put it where it belongs, over on the left
please.
thanks,
greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]