Re: [PATCH] Fixes: Indentation using spaces instead of TABS and improve formatting

2024-05-20 Thread Tanmay
Sure! Thanks for the update.

~ Tanmay

On Mon, 20 May, 2024, 6:32 pm Peter Maydell, 
wrote:

> On Wed, 8 May 2024 at 09:15, Tanmay Patil 
> wrote:
> >
> > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/373
> >
> > Files changed:
> > - hw/arm/boot.c
> > - hw/char/omap_uart.c
> > - hw/gpio/zaurus.c
> > - hw/input/tsc2005.c
> >
> > Signed-off-by: Tanmay Patil 
>
> Thanks for this patch; I've applied it to my target-arm.next
> queue and it will get upstream within the next week or so.
> (I tweaked the commit message format a bit.)
>
> -- PMM
>


Re: [PATCH] Fixes: Indentation using TABs and improve formatting

2024-05-08 Thread Tanmay
Hi,

I just sent a patch with fewer files to address using git-send-email.

Thanks,
Tanmay

On Tue, 7 May 2024 at 15:56, Peter Maydell  wrote:

> On Mon, 6 May 2024 at 07:20, Tanmay  wrote:
> >
> > Hi,
> >
> > I have added a patch inline that fixes indentation and formatting for
> some files as listed in https://gitlab.com/qemu-project/qemu/-/issues/373.
> >
> > Thanks,
> > Tanmay
>
> Hi; thanks for this patch. Unfortunately there seem to be some
> problems with the formatting, which mean it doesn't apply correctly.
>
> In particular you've sent it as a plain/text + HTML email, and
> something (probably your mail client) is wrapping long lines.
> I can usually fix something like this up on my end for a first
> time submitter, but in this case the patch is just way too big
> for that to be practical.
>
> I generally don't recommend trying to send patch emails directly
> through the gmail web UI -- it unfortunately mangles them too
> much. Personally I use git-send-email; it is a bit awkward to
> set up, but https://git-send-email.io/ has a nice step-by-step
> guide including specific details on how to configure it to send
> via Gmail.
>
> > From 46026574821c46804111eea6607a1b39314b7abe Mon Sep 17 00:00:00 2001
> > From: Tanmay Patil 
> > Date: Sat, 25 Nov 2023 00:53:54 +0530
> > Subject: [PATCH] Fixes: Indentation using TABs and improve formatting
> >  Resolves: https://gitlab.com/qemu-project/qemu/-/issues/373
> >
> >Files changed:
> > - hw/arm/boot.c
> > - hw/char/omap_uart.c
> > - hw/dma/pxa2xx_dma.c
> > - hw/gpio/omap_gpio.c
> > - hw/gpio/zaurus.c
> > - hw/input/tsc2005.c
> > - hw/input/tsc210x.c
> > - hw/intc/omap_intc.c
> > - hw/misc/cbus.c
> > - hw/misc/omap_clk.c
> > - hw/misc/omap_l4.c
> > - hw/misc/omap_sdrc.c
> > - hw/misc/omap_tap.c
> > - hw/sd/omap_mmc.c
> > - hw/sd/pxa2xx_mmci.c
> > - hw/timer/omap_gptimer.c
> >     - hw/timer/omap_synctimer.c
> > - hw/timer/pxa2xx_timer.c
> > - include/hw/arm/pxa.h
> > - include/hw/arm/sharpsl.h
> > - include/hw/arm/soc_dma.h
> > - tcg/arm/tcg-target.h
> >
> > Signed-off-by: Tanmay Patil 
> > ---
> >  hw/arm/boot.c |   8 +-
> >  hw/char/omap_uart.c   |  49 +-
> >  hw/dma/pxa2xx_dma.c   | 198 
> >  hw/gpio/omap_gpio.c   | 243 +-
> >  hw/gpio/zaurus.c  |  61 +--
> >  hw/input/tsc2005.c| 130 ++---
> >  hw/input/tsc210x.c| 442 +
> >  hw/intc/omap_intc.c   | 261 +-
> >  hw/misc/cbus.c| 202 
> >  hw/misc/omap_clk.c| 999 +++---
> >  hw/misc/omap_l4.c |  21 +-
> >  hw/misc/omap_sdrc.c   | 135 +++---
> >  hw/misc/omap_tap.c|  28 +-
> >  hw/sd/omap_mmc.c  | 208 
> >  hw/sd/pxa2xx_mmci.c   | 149 +++---
> >  hw/timer/omap_gptimer.c   | 126 ++---
> >  hw/timer/omap_synctimer.c |   7 +-
> >  hw/timer/pxa2xx_timer.c   | 279 ++-
> >  include/hw/arm/pxa.h  | 100 ++--
> >  include/hw/arm/sharpsl.h  |   2 +-
> >  include/hw/arm/soc_dma.h  |   4 +-
> >  tcg/arm/tcg-target.h  |   4 +-
> >  22 files changed, 1903 insertions(+), 1753 deletions(-)
>
> This is a lot of changes to do all in one commit, even though they're
> all just whitespace fixes. Could you split them up, please, into
> multiple patches that tackle fewer files at a time?
>
> thanks
> -- PMM
>


[PATCH] Fixes: Indentation using spaces instead of TABS and improve formatting

2024-05-08 Thread Tanmay Patil
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/373

Files changed:
- hw/arm/boot.c
- hw/char/omap_uart.c
- hw/gpio/zaurus.c
- hw/input/tsc2005.c

Signed-off-by: Tanmay Patil 
---
 hw/arm/boot.c   |   8 +--
 hw/char/omap_uart.c |  49 +
 hw/gpio/zaurus.c|  61 +++--
 hw/input/tsc2005.c  | 130 
 4 files changed, 131 insertions(+), 117 deletions(-)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 84ea6a807a..d480a7da02 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -347,13 +347,13 @@ static void set_kernel_args_old(const struct 
arm_boot_info *info,
 WRITE_WORD(p, info->ram_size / 4096);
 /* ramdisk_size */
 WRITE_WORD(p, 0);
-#define FLAG_READONLY  1
-#define FLAG_RDLOAD4
-#define FLAG_RDPROMPT  8
+#define FLAG_READONLY 1
+#define FLAG_RDLOAD   4
+#define FLAG_RDPROMPT 8
 /* flags */
 WRITE_WORD(p, FLAG_READONLY | FLAG_RDLOAD | FLAG_RDPROMPT);
 /* rootdev */
-WRITE_WORD(p, (31 << 8) | 0);  /* /dev/mtdblock0 */
+WRITE_WORD(p, (31 << 8) | 0); /* /dev/mtdblock0 */
 /* video_num_cols */
 WRITE_WORD(p, 0);
 /* video_num_rows */
diff --git a/hw/char/omap_uart.c b/hw/char/omap_uart.c
index 6848bddb4e..c2ef4c137e 100644
--- a/hw/char/omap_uart.c
+++ b/hw/char/omap_uart.c
@@ -61,7 +61,7 @@ struct omap_uart_s *omap_uart_init(hwaddr base,
 s->fclk = fclk;
 s->irq = irq;
 s->serial = serial_mm_init(get_system_memory(), base, 2, irq,
-   omap_clk_getrate(fclk)/16,
+   omap_clk_getrate(fclk) / 16,
chr ?: qemu_chr_new(label, "null", NULL),
DEVICE_NATIVE_ENDIAN);
 return s;
@@ -76,27 +76,27 @@ static uint64_t omap_uart_read(void *opaque, hwaddr addr, 
unsigned size)
 }
 
 switch (addr) {
-case 0x20: /* MDR1 */
+case 0x20:  /* MDR1 */
 return s->mdr[0];
-case 0x24: /* MDR2 */
+case 0x24:  /* MDR2 */
 return s->mdr[1];
-case 0x40: /* SCR */
+case 0x40:  /* SCR */
 return s->scr;
-case 0x44: /* SSR */
+case 0x44:  /* SSR */
 return 0x0;
-case 0x48: /* EBLR (OMAP2) */
+case 0x48:  /* EBLR (OMAP2) */
 return s->eblr;
-case 0x4C: /* OSC_12M_SEL (OMAP1) */
+case 0x4C:  /* OSC_12M_SEL (OMAP1) */
 return s->clksel;
-case 0x50: /* MVR */
+case 0x50:  /* MVR */
 return 0x30;
-case 0x54: /* SYSC (OMAP2) */
+case 0x54:  /* SYSC (OMAP2) */
 return s->syscontrol;
-case 0x58: /* SYSS (OMAP2) */
+case 0x58:  /* SYSS (OMAP2) */
 return 1;
-case 0x5c: /* WER (OMAP2) */
+case 0x5c:  /* WER (OMAP2) */
 return s->wkup;
-case 0x60: /* CFPS (OMAP2) */
+case 0x60:  /* CFPS (OMAP2) */
 return s->cfps;
 }
 
@@ -115,35 +115,36 @@ static void omap_uart_write(void *opaque, hwaddr addr,
 }
 
 switch (addr) {
-case 0x20: /* MDR1 */
+case 0x20:  /* MDR1 */
 s->mdr[0] = value & 0x7f;
 break;
-case 0x24: /* MDR2 */
+case 0x24:  /* MDR2 */
 s->mdr[1] = value & 0xff;
 break;
-case 0x40: /* SCR */
+case 0x40:  /* SCR */
 s->scr = value & 0xff;
 break;
-case 0x48: /* EBLR (OMAP2) */
+case 0x48:  /* EBLR (OMAP2) */
 s->eblr = value & 0xff;
 break;
-case 0x4C: /* OSC_12M_SEL (OMAP1) */
+case 0x4C:  /* OSC_12M_SEL (OMAP1) */
 s->clksel = value & 1;
 break;
-case 0x44: /* SSR */
-case 0x50: /* MVR */
-case 0x58: /* SYSS (OMAP2) */
+case 0x44:  /* SSR */
+case 0x50:  /* MVR */
+case 0x58:  /* SYSS (OMAP2) */
 OMAP_RO_REG(addr);
 break;
-case 0x54: /* SYSC (OMAP2) */
+case 0x54:  /* SYSC (OMAP2) */
 s->syscontrol = value & 0x1d;
-if (value & 2)
+if (value & 2) {
 omap_uart_reset(s);
+}
 break;
-case 0x5c: /* WER (OMAP2) */
+case 0x5c:  /* WER (OMAP2) */
 s->wkup = value & 0x7f;
 break;
-case 0x60: /* CFPS (OMAP2) */
+case 0x60:  /* CFPS (OMAP2) */
 s->cfps = value & 0xff;
 break;
 default:
diff --git a/hw/gpio/zaurus.c b/hw/gpio/zaurus.c
index 5884804c58..7342440b95 100644
--- a/hw/gpio/zaurus.c
+++ b/hw/gpio/zaurus.c
@@ -49,19 +49,20 @@ struct ScoopInfo {
 uint16_t isr;
 };
 
-#define SCOOP_MCR  0x00
-#define SCOOP_CDR  0x04
-#define SCOOP_CSR  0x08
-#define SCOOP_CPR  0x0c
-#define SCOOP_CCR  0x10
-#define SCOOP_IRR_IRM  0x14
-#define SCOOP_IMR  0x18
-#define SCOOP_ISR  0x1c
-#define SCOOP_GPCR 0x20
-#define SCOOP_GPWR 0x24
-#define SCOOP_GPRR 0x28
-
-static inline void scoop_gpio_handler_update(ScoopInfo *s) {
+#define SCOOP_M

Re: [PATCH] Fixes: Indentation using TABs and improve formatting

2024-05-06 Thread Tanmay
Sure, I'll do it!

Thanks,
Tanmay

On Mon, 6 May 2024 at 10:11, Thomas Huth  wrote:

> On 04/05/2024 22.34, Michael Tokarev wrote:
> > 04.05.2024 21:58, Tanmay wrote:
> >> Hi,
> >>
> >> I have attached a patch file that fixes indentation and formatting for
> >> some files as listed in
> https://gitlab.com/qemu-project/qemu/-/issues/373
> >> <https://gitlab.com/qemu-project/qemu/-/issues/373>.
> >
> > it is sort of good you posted this patch to stable@.  It has absolutely
> > nothing to do
> > with stable, but it serves as a an example of things which should - in
> my
> > opinion -
> > not be done at all.
>
> I disagree. Yes, clean-up patches like this make it somewhat difficult to
> backport other patches to stable, but that should not be the reason to not
> do cleanups at all. If we keep badly formatted code in the repository,
> people will copy-n-paste it to other places, or if you have to do fixes in
> sources that have mixed TABs and spaces, you often get complaints from
> checkpatch.pl though it is not your fault. So we should get this straight
> at
> one point in time.
>
> So, Tanmay, could you please resend your patch, this time to
> qemu-devel@nongnu.org instead of qemu-stable, and CC: qemu-...@nongnu.org
> and the corresponding ARM maintainers (you can use
> scripts/get_maintainers.pl to find out the correct maintainers that
> should
> be CC:-ed). And if possible, please send your patch inline and not as an
> attachment (so it's possible to comment on the patch via hitting the reply
> button), preferably with "git send-email" instead of using your e-mail
> program.
>
>   Thanks!
>Thomas
>
>


Re: [PATCH] Fixes: Indentation using TABs and improve formatting

2024-05-05 Thread Tanmay
Hi,

I completely agree!
This was more of a "NEWCOMERS" issue to help us understand how the patch
flow works.
I'll take up a trivial issue and work on it instead.

Thanks,
Tanmay

On Sun, 5 May 2024 at 02:05, Michael Tokarev  wrote:

> 04.05.2024 21:58, Tanmay wrote:
> > Hi,
> >
> > I have attached a patch file that fixes indentation and formatting for
> some files as listed in https://gitlab.com/qemu-project/qemu/-/issues/373
> > <https://gitlab.com/qemu-project/qemu/-/issues/373>.
>
> it is sort of good you posted this patch to stable@.  It has absolutely
> nothing to do
> with stable, but it serves as a an example of things which should - in my
> opinion -
> not be done at all.  We had another similar change, 55339361276a "sh4:
> Coding style:
> Remove tabs", which makes all further changes (fixes) in this area
> basically
> non-back-portable to previous stable series.
>
> FWIW,
>
> /mjt
> --
> GPG Key transition (from rsa2048 to rsa4096) since 2024-04-24.
> New key: rsa4096/61AD3D98ECDF2C8E  9D8B E14E 3F2A 9DD7 9199  28F1 61AD
> 3D98 ECDF 2C8E
> Old key: rsa2048/457CE0A0804465C5  6EE1 95D1 886E 8FFB 810D  4324 457C
> E0A0 8044 65C5
> Transition statement: http://www.corpit.ru/mjt/gpg-transition-2024.txt
>
>


Re: Replace calls to functions named cpu_physical_memory_* with address_space_*.

2023-10-26 Thread Tanmay
Yeah, I felt that it may not be a cakewalk as it might sound.

You're right, trying to understand the whole code is overwhelming. I'll
start with a small section instead.

I have interest in working on x86_64 and Aarch64 architectures within qemu.
Please let me know if there are any specific tasks from where I can start
exploring.

Thanks,
Tanmay

On Thu, 26 Oct 2023 at 22:16, Peter Maydell 
wrote:

> On Thu, 26 Oct 2023 at 13:48, Tanmay  wrote:
> > I'm really interested in contributing to qemu. I wanted to
> > work on the renaming API calls cpu_physical_memory_* to
> > address_space_*. I couldn't find any related issues on the
> > GItlab tracker. Can I work on this issue?
>
> You're welcome to, but be aware that this is unfortunately
> one of the items in the "BiteSizedTasks" list that is
> not as simple as the one-line description makes it sound.
> (I have a personal project to try to go through that page and
> either expand entries into issues in gitlab that describe the
> task in more detail, or else delete them if they don't really
> seem to be "bite sized". But I haven't got very far with it yet,
> so there are still quite a few unhelpful "landmine" tasks on it.
> Sorry about that :-(  )
>
> It also is something where the right thing to do is going to
> depend on the call-site and what that particular device or piece
> of code is trying to do -- it is not a mechanical conversion.
> (This is partly why the conversion is not yet complete.)
>
> Most of the devices which use these functions should indeed
> use address_space_* functions instead, but the question then
> is "what address space should they access?". That usually ought
> to be one passed into them by the board code. (commit 112a829f8f0a
> is an example of that kind of conversion.) Unfortunately many
> of the remaining uses of cpu_physical_memory_* in hw/ are
> in very old code which hasn't even been converted to the
> kind of new device model coding style that would allow you to
> provide an address space by a QOM property that way. So for
> those devices this would be just one of a whole pile of
> "modernizations" and refactorings that need to be done.
>
> I think what I would suggest is that rather than starting
> with this task in general, that you start with what part
> of QEMU you're interested in working on in particular (eg
> whether you're interested in a particular target architecture
> or a particular subsystem like migration, etc), and then
> we can probably find some tasks that relate to that specific
> interest and help in starting to understand that part of the
> code. (QEMU as a whole is too big for anybody to understand
> all of it...) If what you want to work on turns out to
> involve one of the bits of code which needs this API upgrade,
> maybe we can help you work on that; but it might turn out that
> the two don't overlap at all, or that there's a better starting
> task.
>
> thanks
> -- PMM
>


Re: Replace calls to functions named cpu_physical_memory_* with address_space_*.

2023-10-26 Thread Tanmay
Hi,

The above refactoring of functions was mentioned under API conversion at
https://wiki.qemu.org/Contribute/BiteSizedTasks .

Thanks,
Tanmay Patil

On Thu, 26 Oct 2023 at 15:54, Tanmay  wrote:

> Hi,
>
> I'm really interested in contributing to qemu. I wanted to work on the
> renaming API calls cpu_physical_memory_* to address_space_*. I couldn't
> find any related issues on the GItlab tracker. Can I work on this issue?
>
> Thanks,
> Tanmay Patil
>


Replace calls to functions named cpu_physical_memory_* with address_space_*.

2023-10-26 Thread Tanmay
Hi,

I'm really interested in contributing to qemu. I wanted to work on the
renaming API calls cpu_physical_memory_* to address_space_*. I couldn't
find any related issues on the GItlab tracker. Can I work on this issue?

Thanks,
Tanmay Patil