Re: [PATCH] regmap: debugfs: Fix compilation warning

From: Vincent Stehlé
Date: Thu Jan 24 2013 - 05:12:20 EST


On 01/23/2013 04:58 PM, Mark Brown wrote:
> On Tue, Jan 22, 2013 at 11:07:04AM +0100, Vincent Stehlé wrote:
>
>> Do you think there is a way to "mark" the list_for_each_entry()
>> as iterating at least once? an __attribute__ maybe?
>
> No - but are you sure that's true?

If you mean "am I sure the loop iterates at least once", then yes, as
we have an explicit check just before the concerned list_for_each_entry():

/*
* This should never happen; we return above if we fail to
* allocate and we should never be in this code if there are
* no registers at all.
*/
if (list_empty(&map->debugfs_off_cache)) {
WARN_ON(list_empty(&map->debugfs_off_cache));
return base;
}

Best regards,

V.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/