[coreboot-gerrit] Patch set updated for coreboot: libpayload: Revive ffs()

Julius Werner (jwerner@chromium.org) gerrit at coreboot.org
Wed Sep 9 18:45:23 CET 2015


Julius Werner (jwerner at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11591

-gerrit

commit 88c1be0ae8509c55ce490d08dcafdf4b7c4c2f0b
Author: Nico Huber <nico.huber at secunet.com>
Date:   Tue Sep 8 17:14:08 2015 +0200

    libpayload: Revive ffs()
    
    Revive ffs() in a more fancy way (that is more likely to be accepted).
    We dropped it in
      7a8a4ab lib: Unify log2() and related functions
    but there is at least one user: flashrom.
    
    Change-Id: I4e3fc15816b778e640bceea0d89cd9624d271c2e
    Signed-off-by: Nico Huber <nico.huber at secunet.com>
    Signed-off-by: Julius Werner <jwerner at chromium.org>
---
 payloads/libpayload/include/strings.h | 37 +++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/payloads/libpayload/include/strings.h b/payloads/libpayload/include/strings.h
new file mode 100644
index 0000000..e25a823
--- /dev/null
+++ b/payloads/libpayload/include/strings.h
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the libpayload project.
+ *
+ * Copyright (C) 2011 secunet Security Networks AG
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _STRINGS_H
+#define _STRINGS_H
+
+#include <libpayload.h>
+
+static inline int ffs(int i) { return __ffs(i) + 1; }
+
+#endif



More information about the coreboot-gerrit mailing list