[PATCH 3/3] drivers: nubus: Fix use of * in comment block in nubus.c
From: Sayyad Abid
Date: Wed Oct 02 2024 - 09:29:19 EST
This change help make the comment blocks reader friendly
by adding * on each comment line indicating a continuous
block of comment
Signed-off-by: Sayyad Abid <sayyad.abid16@xxxxxxxxx>
---
drivers/nubus/nubus.c | 87 ++++++++++++++++++++++++-------------------
1 file changed, 49 insertions(+), 38 deletions(-)
diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c
index 77da1d14a1db..501c830c3c40 100644
--- a/drivers/nubus/nubus.c
+++ b/drivers/nubus/nubus.c
@@ -24,7 +24,8 @@
/* Constants */
/* This is, of course, the size in bytelanes, rather than the size in
- actual bytes */
+ * actual bytes
+ */
#define FORMAT_BLOCK_SIZE 20
#define ROM_DIR_OFFSET 0x24
@@ -42,27 +43,27 @@ module_param_named(populate_procfs, nubus_populate_procfs, bool, 0);
LIST_HEAD(nubus_func_rsrcs);
/* Meaning of "bytelanes":
-
- The card ROM may appear on any or all bytes of each long word in
- NuBus memory. The low 4 bits of the "map" value found in the
- format block (at the top of the slot address space, as well as at
- the top of the MacOS ROM) tells us which bytelanes, i.e. which byte
- offsets within each longword, are valid. Thus:
-
- A map of 0x0f, as found in the MacOS ROM, means that all bytelanes
- are valid.
-
- A map of 0xf0 means that no bytelanes are valid (We pray that we
- will never encounter this, but stranger things have happened)
-
- A map of 0xe1 means that only the MSB of each long word is actually
- part of the card ROM. (We hope to never encounter NuBus on a
- little-endian machine. Again, stranger things have happened)
-
- A map of 0x78 means that only the LSB of each long word is valid.
-
- Etcetera, etcetera. Hopefully this clears up some confusion over
- what the following code actually does. */
+ *
+ * The card ROM may appear on any or all bytes of each long word in
+ * NuBus memory. The low 4 bits of the "map" value found in the
+ *format block (at the top of the slot address space, as well as at
+ *the top of the MacOS ROM) tells us which bytelanes, i.e. which byte
+ * offsets within each longword, are valid. Thus:
+ *
+ * A map of 0x0f, as found in the MacOS ROM, means that all bytelanes
+ * are valid.
+ *
+ * A map of 0xf0 means that no bytelanes are valid (We pray that we
+ * will never encounter this, but stranger things have happened)
+ *
+ * A map of 0xe1 means that only the MSB of each long word is actually
+ * part of the card ROM. (We hope to never encounter NuBus on a
+ * little-endian machine. Again, stranger things have happened)
+ * A map of 0x78 means that only the LSB of each long word is valid.
+ *
+ * Etcetera, etcetera. Hopefully this clears up some confusion over
+ * what the following code actually does.
+ */
static inline int not_useful(void *p, int map)
{
@@ -133,9 +134,10 @@ static void nubus_move(unsigned char **ptr, int len, int map)
/* Now, functions to read the sResource tree */
/* Each sResource entry consists of a 1-byte ID and a 3-byte data
- field. If that data field contains an offset, then obviously we
- have to expand it from a 24-bit signed number to a 32-bit signed
- number. */
+ * field. If that data field contains an offset, then obviously we
+ * have to expand it from a 24-bit signed number to a 32-bit signed
+ * number.
+ */
static inline long nubus_expand32(long foo)
{
@@ -158,14 +160,16 @@ unsigned char *nubus_dirptr(const struct nubus_dirent *nd)
unsigned char *p = nd->base;
/* Essentially, just step over the bytelanes using whatever
- offset we might have found */
+ * offset we might have found
+ */
nubus_move(&p, nubus_expand32(nd->data), nd->mask);
/* And return the value */
return p;
}
/* These two are for pulling resource data blocks (i.e. stuff that's
- pointed to with offsets) out of the card ROM. */
+ * pointed to with offsets) out of the card ROM.
+ */
void nubus_get_rsrc_mem(void *dest, const struct nubus_dirent *dirent,
unsigned int len)
@@ -253,7 +257,8 @@ int nubus_get_board_dir(const struct nubus_board *board,
dir->mask = board->lanes;
/* Now dereference it (the first directory is always the board
- directory) */
+ * directory)
+ */
if (nubus_readdir(dir, &ent) == -1)
return -1;
if (nubus_get_subdir(&ent, dir) == -1)
@@ -339,8 +344,9 @@ nubus_find_rsrc(struct nubus_dir *dir, unsigned char rsrc_type,
EXPORT_SYMBOL(nubus_find_rsrc);
/* Initialization functions - decide which slots contain stuff worth
- looking at, and print out lots and lots of information from the
- resource blocks. */
+ * looking at, and print out lots and lots of information from the
+ * resource blocks.
+ */
static int __init nubus_get_block_rsrc_dir(struct nubus_board *board,
struct proc_dir_entry *procdir,
@@ -542,7 +548,8 @@ nubus_get_functional_resource(struct nubus_board *board, int slot,
case NUBUS_RESID_DRVRDIR:
{
/* MacOS driver. If we were NetBSD we might
- use this :-) */
+ * use this :-)
+ */
pr_debug(" driver directory offset: 0x%06x\n",
ent.data);
nubus_get_block_rsrc_dir(board, dir.procdir, &ent);
@@ -551,8 +558,9 @@ nubus_get_functional_resource(struct nubus_board *board, int slot,
case NUBUS_RESID_MINOR_BASEOS:
{
/* We will need this in order to support
- multiple framebuffers. It might be handy
- for Ethernet as well */
+ * multiple framebuffers. It might be handy
+ * for Ethernet as well
+ */
u32 base_offset;
nubus_get_rsrc_mem(&base_offset, &ent, 4);
@@ -651,8 +659,9 @@ static int __init nubus_get_board_resource(struct nubus_board *board, int slot,
{
unsigned short nbtdata[4];
/* This type is always the same, and is not
- useful except insofar as it tells us that
- we really are looking at a board resource. */
+ * useful except insofar as it tells us that
+ * we really are looking at a board resource.
+ */
nubus_get_rsrc_mem(nbtdata, &ent, 8);
pr_debug(" type: [cat 0x%x type 0x%x sw 0x%x hw 0x%x]\n",
nbtdata[0], nbtdata[1], nbtdata[2], nbtdata[3]);
@@ -849,12 +858,14 @@ static void __init nubus_probe_slot(int slot)
dp = *rp;
/* The last byte of the format block consists of two
- nybbles which are "mirror images" of each other.
- These show us the valid bytelanes */
+ * nybbles which are "mirror images" of each other.
+ * These show us the valid bytelanes
+ */
if ((((dp >> 4) ^ dp) & 0x0F) != 0x0F)
continue;
/* Check that this value is actually *on* one of the
- bytelanes it claims are valid! */
+ * bytelanes it claims are valid!
+ */
if (not_useful(rp, dp))
continue;
--
2.39.5