Re: [PATCH v3 3/8] ACPI: Prepare for constifying acpi_get_next_subnode() fwnode argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 2017-07-21 at 14:39 +0300, Sakari Ailus wrote:
> Make local variables const (head) or add new variables; adev was used
> for
> two purposes: to refer the root device node and its children. The two
> purposes are separated by this patch.
> 
> This is preparation for making fwnode arguments const for fwnode ops.
> Don't constify the argument itself quite yet as this is used as a
> callback
> function.

>  		if (child) {
> -			adev = to_acpi_device_node(child);
> -			next = adev->node.next;
> +			child_adev = to_acpi_device_node(child);
> +			next = child_adev->node.next;
>  			if (next == head) {
>  				child = NULL;
>  				goto nondev;
>  			}
> -			adev = list_entry(next, struct acpi_device,
> node);
> +			child_adev = list_entry(next, struct
> acpi_device, node);


Isn't it 

list_first_entry_or_null() ?


-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux