Skip to content

Commit fa84902

Browse files
committed
Tidy up parsing for LimitDevAccess setting
Signed-off-by: Steve Linsell <stevenx.linsell@intel.com>
1 parent 505ea39 commit fa84902

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

qat_parseconf.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,14 @@ int confCryptoFindKeyValue(char *fileName,
213213
{
214214
FILE *conffile;
215215
int inSection = 0;
216-
int found = 0;
217-
int sectionFound = 0;
216+
int found = CONF_FIND_KEY_FAILED;
218217
char lineBuffer[CONF_MAX_LINE_LENGTH] = { 0 };
219218
int lineBufferLength = 0;
220219
char *strippedLineBuffer = NULL;
221220

222221
if (strlen(fileName) > CONF_MAX_PATH) {
223222
fprintf(stderr, "Invaid Configuration File Name Length\n");
224-
return 0;
223+
return found;
225224
}
226225
if ((conffile = fopen(fileName, "r")) != NULL) {
227226
while (!feof(conffile)) {
@@ -271,7 +270,7 @@ int confCryptoFindKeyValue(char *fileName,
271270
* It is the section we want so set the flag
272271
*/
273272
inSection = 1;
274-
sectionFound = 1;
273+
found = CONF_FIND_KEY_SECTION_FOUND;
275274
}
276275
}
277276
} else { /* It's not a section name so assume it is a
@@ -291,7 +290,7 @@ int confCryptoFindKeyValue(char *fileName,
291290
* Found the parameter we are looking for set
292291
* flag and break out of loop
293292
*/
294-
found = 1;
293+
found = CONF_FIND_KEY_KEY_FOUND;
295294
break;
296295
}
297296
}
@@ -303,7 +302,7 @@ int confCryptoFindKeyValue(char *fileName,
303302
} else {
304303
fprintf(stderr, "Unable to open file %s\n", fileName);
305304
}
306-
return found + sectionFound;
305+
return found;
307306
}
308307

309308
#define DH89XXCC_NAME "dh89xxcc"
@@ -404,7 +403,7 @@ int getDevices(unsigned int dev_mask[], int *upstream_flag)
404403
closedir(kernel);
405404
}
406405
if (!found) {
407-
WARN("No running QA devices detected \n");
406+
WARN("No running Intel(R) Quickassist devices detected\n");
408407
return 0;
409408
}
410409
return 1;
@@ -442,6 +441,7 @@ int checkLimitDevAccessValue(int *limitDevAccess, char *section_name)
442441
/* if the SHIM section was found in the config file but no
443442
LimitDevAccess setting,
444443
LimitDevAccess is set to 0 */
444+
WARN("No LimitDevAccess setting in SHIM section - defaulting to 0\n");
445445
*limitDevAccess = 0;
446446
return 1;
447447
} else if (status == CONF_FIND_KEY_KEY_FOUND) {

0 commit comments

Comments
 (0)