Skip to content

Commit ec1fdc2

Browse files
Kyle McMartinKyle McMartin
authored andcommitted
[PARISC] OS_ID_LINUX == 0x0006
We were assigned an OS_ID of 0x0006. Consistently use OS_ID_LINUX instead of using the magic number. Also update the OS_ID_ defines in asm/pdc.h to reflect this. Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
1 parent a9d2d38 commit ec1fdc2

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎arch/parisc/kernel/firmware.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,9 @@ int pdc_model_info(struct pdc_model *model)
407407
* pdc_model_sysmodel - Get the system model name.
408408
* @name: A char array of at least 81 characters.
409409
*
410-
* Get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L)
410+
* Get system model name from PDC ROM (e.g. 9000/715 or 9000/778/B160L).
411+
* Using OS_ID_HPUX will return the equivalent of the 'modelname' command
412+
* on HP/UX.
411413
*/
412414
int pdc_model_sysmodel(char *name)
413415
{

‎arch/parisc/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ extern void eisa_init(void);
303303

304304
static int __init parisc_init(void)
305305
{
306-
u32 osid = (0x0006 << 16);
306+
u32 osid = (OS_ID_LINUX << 16);
307307

308308
parisc_proc_mkdir();
309309
parisc_init_resources();

‎drivers/parisc/pdc_stable.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ pdcs_osdep1_write(struct subsystem *entry, const char *buf, size_t count)
884884
if (!entry || !buf || !count)
885885
return -EINVAL;
886886

887-
if (unlikely(pdcs_osid != 0x0006))
887+
if (unlikely(pdcs_osid != OS_ID_LINUX))
888888
return -EPERM;
889889

890890
if (count > 16)
@@ -926,7 +926,7 @@ pdcs_osdep2_write(struct subsystem *entry, const char *buf, size_t count)
926926
if (unlikely(pdcs_size <= 224))
927927
return -ENOSYS;
928928

929-
if (unlikely(pdcs_osid != 0x0006))
929+
if (unlikely(pdcs_osid != OS_ID_LINUX))
930930
return -EPERM;
931931

932932
size = pdcs_size - 224;

‎include/asm-parisc/pdc.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,11 @@ typedef struct {
278278
/* constants for OS (NVM...) */
279279
#define OS_ID_NONE 0 /* Undefined OS ID */
280280
#define OS_ID_HPUX 1 /* HP-UX OS */
281-
#define OS_ID_LINUX OS_ID_HPUX /* just use the same value as hpux */
282281
#define OS_ID_MPEXL 2 /* MPE XL OS */
283282
#define OS_ID_OSF 3 /* OSF OS */
284283
#define OS_ID_HPRT 4 /* HP-RT OS */
285284
#define OS_ID_NOVEL 5 /* NOVELL OS */
286-
#define OS_ID_NT 6 /* NT OS */
285+
#define OS_ID_LINUX 6 /* Linux */
287286

288287

289288
/* constants for PDC_CHASSIS */

0 commit comments

Comments
 (0)