Re: [PATCH v2 4/5] x86: Use getopt to handle command line args

2024-04-23 Thread Anthony PERARD
On Tue, Apr 23, 2024 at 04:16:10PM +0100, Fouad Hilly wrote: > On Mon, Apr 22, 2024 at 6:48 PM Anthony PERARD > wrote: > > On Tue, Apr 16, 2024 at 10:15:45AM +0100, Fouad Hilly wrote: > > > +if ( argc != 2 ) > > > +goto ext_err; > > > > Why only two arguments allowed? And why check

Re: [PATCH v2 4/5] x86: Use getopt to handle command line args

2024-04-23 Thread Fouad Hilly
On Mon, Apr 22, 2024 at 6:48 PM Anthony PERARD wrote: > > On Tue, Apr 16, 2024 at 10:15:45AM +0100, Fouad Hilly wrote: > > diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c > > index 0c0b2337b4ea..e3c1943e3633 100644 > > --- a/tools/misc/xen-ucode.c > > +++ b/tools/misc/xen-ucode.c > >

Re: [PATCH v2 4/5] x86: Use getopt to handle command line args

2024-04-22 Thread Anthony PERARD
On Tue, Apr 16, 2024 at 10:15:45AM +0100, Fouad Hilly wrote: > diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c > index 0c0b2337b4ea..e3c1943e3633 100644 > --- a/tools/misc/xen-ucode.c > +++ b/tools/misc/xen-ucode.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include

[PATCH v2 4/5] x86: Use getopt to handle command line args

2024-04-16 Thread Fouad Hilly
Use getopt_long() to handle command line arguments. Introduce ext_err for common exit with errors. [v2] 1- Removed unnecessary NULL initialization. 2- Used static at the beginning of type struct declaration. 3- Corrected switch\case indentations. 4- Removed redundant checks. 5- Corrected label