-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linux: cp project and device device tree, silence errors #1491
Conversation
Is loop really necessary? What about just redirecting error to null? |
Necessary? No it's absolutely not, but it's the usual method we've used elsewhere so it is at least consistent. :) As I say it's probably overkill, but it is also perhaps a little bit more "correct" than copying and ignoring/throwing away the error. Chewitt raised the initial error, so I'll let him decide if he wants this or not, or prefers ignoring the error in which case it can be refactored along those lines while also handling common project files. |
I just mentioned this because when reading such code it takes more time to think what it does and when something is copied. With one liner cp it is clear immediately. KISS way :) |
I do agree the one liner is clearer, however I guess it's a choice between brevity (which may cover up potential errors) and being verbose (but safe). In the past we've tended towards the latter, and I think on the whole it's something I'd favour as I really don't like failing silently unless it's absolutely essential. |
Well, I think I agree with this. Especially after remembering cp issue with wildcard on 2 folders few days back :-) Some helper function for such copy would be useful too - loop_cp with two arguments. |
Yes, I think there are a number of places where some helper functions would be useful, this being one such example, particularly as a helper function would automatically handle projects and devices. It's something I intend to tackle. To that end I'd suggest keeping this PR as is, and eventually this type of code will hopefully disappear. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks :)
This gets rid of the following errors when building the kernel:
Currently the only projects or devices with dts files are Slice and Slice3:
With this PR we:
Perhaps this is overkill for a largely cosmetic issue, but #2 above might prove useful.