Commit 0053ca3e authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

streamline returning

return the line, stop closing explicitly (closes when out of scope),
don't else after return
parent cec20e3d
......@@ -208,19 +208,16 @@ public:
QString fdtGetValue(const QString &fdtNode)
{
QString fdtNodeValue;
const QFileInfo targetNode(QLatin1String("/proc/device-tree/") + fdtNode);
if (targetNode.exists() && targetNode.isFile()) {
QFile fdtNodeFile(targetNode.filePath());
if (!fdtNodeFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning("Devicetree: could not retrieve value from node %s\n", qUtf8Printable(fdtNode));
return {};
} else {
fdtNodeValue = fdtNodeFile.readLine();
fdtNodeFile.close();
}
return fdtNodeFile.readLine();
}
return fdtNodeValue;
return {};
}
#endif // Q_OS_LINUX || Q_OS_ANDROID
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment