summaryrefslogtreecommitdiffstats
path: root/common.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: Replace license blurb with kernel-style SPDX markersAndrew Jeffery2018-03-241-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was roughly achieved by the following shell script: $ git ls-files | grep '\.[ch]p*$' | while read F; do EXT=${F##*.}; cat spdx.$EXT <(sed '/^\/\*$/,/^ \*\/$/d' $F) > ${F}.tmp; mv ${F}.tmp $F; done With the following context: $ cat spdx.c // SPDX-License-Identifier: Apache-2.0 // Copyright (C) 2018 IBM Corp. $ cat spdx.h /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright (C) 2018 IBM Corp. */ $ ls -l spdx.* -rw-r--r-- 1 andrew andrew 71 Feb 27 12:02 spdx.c lrwxrwxrwx 1 andrew andrew 6 Feb 27 12:02 spdx.cpp -> spdx.c -rw-r--r-- 1 andrew andrew 77 Feb 27 12:02 spdx.h lrwxrwxrwx 1 andrew andrew 6 Feb 27 12:02 spdx.hpp -> spdx.h The `sed` invocation catches a lot of function documentation, so the hunks were manually added to avoid removing information that we want to keep. Change-Id: I63e49ca2593aa0db0568c7a63bfdead388642e76 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* common: Improve readability and utility of MSG_*() macrosAndrew Jeffery2018-03-191-0/+11
| | | | | | | | Ensures we can't dereference NULL if a logger hasn't been set, and cleans up the MSG_*() macros for readability. Change-Id: I9808d8fe7672613e90c705686d1eaf1e2edef38a Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* common: Ensure helpers are endian-safeAndrew Jeffery2018-03-191-2/+4
| | | | | | | | | | | The specification states that all multibyte values communicated via mbox are little-endian[0]. Do the conversions in the helpers to enforce this property. [0] https://github.com/openbmc/mboxbridge/blob/master/Documentation/mbox_protocol.md#information Change-Id: I9f96281c439fd666cb1c9ae643454569d61f7a81 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* Make the code compatible with c++ compilerRatan Gupta2017-06-021-0/+4
| | | | | | | | | | | | | | | if we write "int i;" in header file, c compiler treats as a tentative definition while c++ compiler treats as a definition. so when two cpp file includes the same header file then during linking time compiler says that there are multiple definitions. so to overcome this problem we are declaring it as extern and defining it in the corresponding c file. Change-Id: I91378c4c587414edf35f8313f2497268be36e2f4 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* common: Move get_dev_mtd() to mtd.cAndrew Jeffery2017-04-261-37/+0
| | | | | | | | Allows tests to link in alternative implementations of get_dev_mtd() without losing other functions available in common.c. Change-Id: I606a83aa9bc59b5fbab1fb11ee1e2574c7f6d127 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* First commitCyril Bur2017-01-101-0/+107
OpenPOWER on IntegriCloud