All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] asm/opal-api: Assign numbers to OPAL_MSG macros of enum opal_msg_type
@ 2015-08-31 23:22 Vipin K Parashar
  2015-09-01  4:17 ` Stewart Smith
  2016-04-11 12:35 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Vipin K Parashar @ 2015-08-31 23:22 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: stewart, mpe, Vipin K Parashar

This patch assigns numbers to OPAL_MSG macros of enum opal_msg_type
to prevent accidental insertion of any new value in between and thus
break OPAL API. This is also helpful while backporting mainline kernel
changes to distros which run downlevel kernel and thus don't have all
OPAL messages defined, avoiding unnecessary bugs due to enum values
order mismatch.

Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/opal-api.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
index e9e4c52..b53f9b3 100644
--- a/arch/powerpc/include/asm/opal-api.h
+++ b/arch/powerpc/include/asm/opal-api.h
@@ -352,15 +352,15 @@ enum OpalLPCAddressType {
 };
 
 enum opal_msg_type {
-	OPAL_MSG_ASYNC_COMP = 0,	/* params[0] = token, params[1] = rc,
+	OPAL_MSG_ASYNC_COMP	= 0,	/* params[0] = token, params[1] = rc,
 					 * additional params function-specific
 					 */
-	OPAL_MSG_MEM_ERR,
-	OPAL_MSG_EPOW,
-	OPAL_MSG_SHUTDOWN,		/* params[0] = 1 reboot, 0 shutdown */
-	OPAL_MSG_HMI_EVT,
-	OPAL_MSG_DPO,
-	OPAL_MSG_PRD,
+	OPAL_MSG_MEM_ERR	= 1,
+	OPAL_MSG_EPOW		= 2,
+	OPAL_MSG_SHUTDOWN	= 3,	/* params[0] = 1 reboot, 0 shutdown */
+	OPAL_MSG_HMI_EVT	= 4,
+	OPAL_MSG_DPO		= 5,
+	OPAL_MSG_PRD		= 6,
 	OPAL_MSG_TYPE_MAX,
 };
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] asm/opal-api: Assign numbers to OPAL_MSG macros of enum opal_msg_type
  2015-08-31 23:22 [PATCH] asm/opal-api: Assign numbers to OPAL_MSG macros of enum opal_msg_type Vipin K Parashar
@ 2015-09-01  4:17 ` Stewart Smith
  2016-04-11 12:35 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Stewart Smith @ 2015-09-01  4:17 UTC (permalink / raw)
  To: Vipin K Parashar, linuxppc-dev; +Cc: mpe, Vipin K Parashar

Vipin K Parashar <vipin@linux.vnet.ibm.com> writes:
> This patch assigns numbers to OPAL_MSG macros of enum opal_msg_type
> to prevent accidental insertion of any new value in between and thus
> break OPAL API. This is also helpful while backporting mainline kernel
> changes to distros which run downlevel kernel and thus don't have all
> OPAL messages defined, avoiding unnecessary bugs due to enum values
> order mismatch.
>
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>

Merging corresponding firmware patch now.

Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: asm/opal-api: Assign numbers to OPAL_MSG macros of enum opal_msg_type
  2015-08-31 23:22 [PATCH] asm/opal-api: Assign numbers to OPAL_MSG macros of enum opal_msg_type Vipin K Parashar
  2015-09-01  4:17 ` Stewart Smith
@ 2016-04-11 12:35 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2016-04-11 12:35 UTC (permalink / raw)
  To: Vipin K Parashar, linuxppc-dev; +Cc: stewart, Vipin K Parashar

On Mon, 2015-31-08 at 23:22:43 UTC, Vipin K Parashar wrote:
> This patch assigns numbers to OPAL_MSG macros of enum opal_msg_type
> to prevent accidental insertion of any new value in between and thus
> break OPAL API. This is also helpful while backporting mainline kernel
> changes to distros which run downlevel kernel and thus don't have all
> OPAL messages defined, avoiding unnecessary bugs due to enum values
> order mismatch.
> 
> Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/b3d79eaa6c97b04965fa479652

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-11 12:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-31 23:22 [PATCH] asm/opal-api: Assign numbers to OPAL_MSG macros of enum opal_msg_type Vipin K Parashar
2015-09-01  4:17 ` Stewart Smith
2016-04-11 12:35 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.