[PATCH] Styleguide fix: Removed un-needed whitespaces and formatting errors in drivers/tty

2022-02-06 Thread Ankit Kumar Pandey
There were lot of styleguide errors raised by checkpatch.pl against
drivers/tty/* which I have fixed. There is zero code change apart from
changes related to styleguide. checkpatch.pl returns 0 error for
style guide now.

---
 drivers/tty/amiserial.c| 285 ++---
 drivers/tty/ehv_bytechan.c |   5 +-
 drivers/tty/goldfish.c |   2 +
 3 files changed, 142 insertions(+), 150 deletions(-)

diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index 1e60dbef6..15917254e 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -12,13 +12,13 @@
  * (non hardware specific) changes to serial.c.
  *
  * The port is registered with the tty driver as minor device 64, and
- * therefore other ports should should only use 65 upwards.
+ * therefore other ports should only use 65 upwards.
  *
  * Richard Lucock 28/12/99
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
- *  Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 
- * 1998, 1999  Theodore Ts'o
+ *  Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997,
+ * 1998, 1999  Theodore Ts'o
  *
  */
 
@@ -78,8 +78,8 @@ struct serial_state {
int ignore_status_mask;
int timeout;
int quot;
-   int IER;/* Interrupt Enable Register */
-   int MCR;/* Modem control register */
+   int IER;/* Interrupt Enable Register */
+   int MCR;/* Modem control register */
int x_char; /* xon/xoff character */
 };
 
@@ -116,9 +116,9 @@ static struct serial_state serial_state;
 #define SER_CTS (1<<4)
 #define SER_DSR (1<<3)
 
-static __inline__ void rtsdtr_ctrl(int bits)
+static inline void rtsdtr_ctrl(int bits)
 {
-ciab.pra = ((bits & (SER_RTS | SER_DTR)) ^ (SER_RTS | SER_DTR)) | 
(ciab.pra & ~(SER_RTS | SER_DTR));
+   ciab.pra = ((bits & (SER_RTS | SER_DTR)) ^ (SER_RTS | SER_DTR)) | 
(ciab.pra & ~(SER_RTS | SER_DTR));
 }
 
 /*
@@ -175,7 +175,7 @@ static void rs_start(struct tty_struct *tty)
 
 static void receive_chars(struct serial_state *info)
 {
-int status;
+   int status;
int serdatr;
unsigned char ch, flag;
struct  async_icount *icount;
@@ -189,10 +189,10 @@ static void receive_chars(struct serial_state *info)
amiga_custom.intreq = IF_RBF;
mb();
 
-   if((serdatr & 0x1ff) == 0)
-   status |= UART_LSR_BI;
-   if(serdatr & SDR_OVRUN)
-   status |= UART_LSR_OE;
+   if ((serdatr & 0x1ff) == 0)
+   status |= UART_LSR_BI;
+   if (serdatr & SDR_OVRUN)
+   status |= UART_LSR_OE;
 
ch = serdatr & 0xff;
icount->rx++;
@@ -213,45 +213,44 @@ static void receive_chars(struct serial_state *info)
  /*
   * For statistics only
   */
- if (status & UART_LSR_BI) {
-   status &= ~(UART_LSR_FE | UART_LSR_PE);
-   icount->brk++;
- } else if (status & UART_LSR_PE)
-   icount->parity++;
- else if (status & UART_LSR_FE)
-   icount->frame++;
- if (status & UART_LSR_OE)
-   icount->overrun++;
+   if (status & UART_LSR_BI) {
+   status &= ~(UART_LSR_FE | UART_LSR_PE);
+   icount->brk++;
+   } else if (status & UART_LSR_PE)
+   icount->parity++;
+   else if (status & UART_LSR_FE)
+   icount->frame++;
+   if (status & UART_LSR_OE)
+   icount->overrun++;
 
  /*
   * Now check to see if character should be
   * ignored, and mask off conditions which
   * should be ignored.
   */
- if (status & info->ignore_status_mask)
-   goto out;
+   if (status & info->ignore_status_mask)
+   goto out;
 
- status &= info->read_status_mask;
-
- if (status & (UART_LSR_BI)) {
+   status &= info->read_status_mask;
+   if (status & (UART_LSR_BI)) {
 #ifdef SERIAL_DEBUG_INTR
-   printk("handling break");
+   printk("handling break");
 #endif
-   flag = TTY_BREAK;
-   if (info->tport.flags & ASYNC_SAK)
- do_SAK(info->tport.tty);
- } else if (status & UART_LSR_PE)
-   flag = TTY_PARITY;
- else if (status & UART_LSR_FE)
-   flag = TTY_FRAME;
- if (status & UART_LSR_OE) {
-   /*
-* Overrun is special, since it's
-* reported immediately, and doesn't
-* affect the current character
-*/
-oe = 1;
- }
+   flag = TTY_BREAK;
+   if (info->tport.flags & ASYNC_SAK)
+   do_SAK(info->tport.tty);
+ 

[PATCH] Enabled pstore write for powerpc

2017-04-27 Thread Ankit Kumar
After commit c950fd6f201a kernel registers pstore write based on flag set.
Pstore write for powerpc is broken as flags(PSTORE_FLAGS_DMESG) is not set for
powerpc architecture. On panic, kernel doesn't write message to
/fs/pstore/dmesg*(Entry doesn't gets created at all).

This patch enables pstore write for powerpc architecture by setting
PSTORE_FLAGS_DMESG flag.

Fixes:c950fd6f201a pstore: Split pstore fragile flags
Signed-off-by: Ankit Kumar <an...@linux.vnet.ibm.com>
---

 arch/powerpc/kernel/nvram_64.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index d5e2b83..021db31 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -561,6 +561,7 @@ static ssize_t nvram_pstore_read(u64 *id, enum 
pstore_type_id *type,
 static struct pstore_info nvram_pstore_info = {
.owner = THIS_MODULE,
.name = "nvram",
+   .flags = PSTORE_FLAGS_DMESG,
.open = nvram_pstore_open,
.read = nvram_pstore_read,
.write = nvram_pstore_write,
-- 
2.7.4