Re: [PATCH v3 3/3] lib/vsprintf: add two device node flags

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

 



On Mon, Jan 20, 2020 at 07:38:29PM +0800, lijiazi wrote:
> Add two device node flags, and use OF_DEVICE_NODE_FLAG_MAX instead
> of sizeof("xxxx").

...

>  			tbuf[1] = of_node_check_flag(dn, OF_DETACHED) ? 'd' : '-';
>  			tbuf[2] = of_node_check_flag(dn, OF_POPULATED) ? 'P' : '-';
>  			tbuf[3] = of_node_check_flag(dn, OF_POPULATED_BUS) ? 'B' : '-';

> -			tbuf[4] = 0;

This is fine to leave untouched. See below.

> +			tbuf[4] = of_node_check_flag(dn, OF_OVERLAY) ? 'O' : '-';
> +			tbuf[5] = of_node_check_flag(dn, OF_OVERLAY_FREE_CSET) ? 'F' : '-';

These two should be part of patch 1, which in turn should be last in the series.

> +			tbuf[OF_DEVICE_NODE_FLAG_MAX] = 0;

This one also, but in a form of explicit number, if you afraid of problems
here, we may add something like

	BUILD_BUG_ON(OF_DEVICE_NODE_FLAG_MAX < ...);

where ... depends on amount of flags we print here.

-- 
With Best Regards,
Andy Shevchenko





[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