We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5dc4a6 commit 49a6905Copy full SHA for 49a6905
i2c_smbus/i2c_smbus_linux.cpp
@@ -94,15 +94,7 @@ bool i2c_smbus_linux_detect()
94
}
95
96
// Loop through all entries in i2c-adapter list
97
- ent = readdir(dir);
98
-
99
- if(ent == NULL)
100
- {
101
- closedir(dir);
102
- return(false);
103
- }
104
105
- while(ent != NULL)
+ while((ent = readdir(dir)) != NULL)
106
{
107
if(ent->d_type == DT_DIR || ent->d_type == DT_LNK)
108
@@ -229,7 +221,6 @@ bool i2c_smbus_linux_detect()
229
221
230
222
if (test_fd < 0)
231
223
232
233
224
ret = false;
234
225
235
226
@@ -249,7 +240,6 @@ bool i2c_smbus_linux_detect()
249
240
250
241
251
242
252
253
243
254
244
closedir(dir);
255
245
0 commit comments