241
* Per the criteria passed via nvram_remove_partition(), should this
242
* partition be removed? 1=remove, 0=keep
244
static int nvram_can_remove_partition(struct nvram_partition *part,
245
const char *name, int sig, const char *exceptions[])
247
if (part->header.signature != sig)
250
if (strncmp(name, part->header.name, 12))
252
} else if (exceptions) {
254
for (except = exceptions; *except; except++) {
255
if (!strncmp(*except, part->header.name, 12))
241
263
* nvram_remove_partition - Remove one or more partitions in nvram
242
264
* @name: name of the partition to remove, or NULL for a
243
265
* signature only match
244
266
* @sig: signature of the partition(s) to remove
267
* @exceptions: When removing all partitions with a matching signature,
247
int __init nvram_remove_partition(const char *name, int sig)
271
int __init nvram_remove_partition(const char *name, int sig,
272
const char *exceptions[])
249
274
struct nvram_partition *part, *prev, *tmp;
252
277
list_for_each_entry(part, &nvram_partitions, partition) {
253
if (part->header.signature != sig)
255
if (name && strncmp(name, part->header.name, 12))
278
if (!nvram_can_remove_partition(part, name, sig, exceptions))
258
281
/* Make partition a free partition */