clean unnecessary code: don't check g_strdup arg for NULL
Subsystems (2)
PATCH 1/2 clean unnecessary code: don't check g_strdup arg for NULL
Signed-off-by Dong Xu Wang <[email protected]>
--- util/uri.c | 2 +- vl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
util/uri.c +1 -1
@@ -2162,7 +2162,7 @@ query_params_append (struct QueryParams *ps, } ps->p[ps->n].name =g_strdup (name); - ps->p[ps->n].value = value ?g_strdup (value) :NULL ; + ps->p[ps->n].value =g_strdup (value); ps->p[ps->n].ignore =0 ; ps->n++;
vl.c +1 -1
@@ -1215,7 +1215,7 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev, node =g_malloc0 (sizeof (FWBootEntry)); node->bootindex = bootindex; - node->suffix = suffix ?g_strdup (suffix) :NULL ; + node->suffix =g_strdup (suffix); node->dev = dev; QTAILQ_FOREACH(i, &fw_boot_order, link) {
Signature · 1 line
1.7.11.7
PATCH 2/2 remove double semicolons
Signed-off-by Dong Xu Wang <[email protected]>
--- block/nbd.c | 2 +- fsdev/virtfs-proxy-helper.c | 4 ++-- hw/9pfs/virtio-9p-local.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/intc/imx_avic.c | 2 +- hw/usb/host-linux.c | 4 ++-- qga/channel-win32.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-)
block/nbd.c +1 -1
@@ -609,7 +609,7 @@ static int nbd_co_discard(BlockDriverState *bs, int64_t sector_num,return 0 ; } request.type =NBD_CMD_TRIM ; - request.from = sector_num *512 ;; + request.from = sector_num *512 ; request.len = nb_sectors *512 ;nbd_coroutine_start (s, &request);
fsdev/virtfs-proxy-helper.c +2 -2
@@ -248,7 +248,7 @@ static int send_fd(int sockfd, int fd)static int send_status (int sockfd,struct iovec *iovec,int status) {ProxyHeader header; -int retval, msg_size;; +int retval, msg_size;if (status <0 ) { header.type =T_ERROR ;
@@ -381,7 +381,7 @@ static int send_response(int sock, struct iovec *iovec, int size)proxy_marshal (iovec,0 ,"dd" , header.type, header.size); retval =socket_write (sock, iovec->iov_base, header.size +PROXY_HDR_SZ );if (retval <0 ) { -return retval;; +return retval; }return 0 ; }
hw/9pfs/virtio-9p-local.c +1 -1
@@ -878,7 +878,7 @@ static int local_remove(FsContext *ctx, const char *path)* Now remove the name from parent directory * .virtfs_metadata directory */ - err =remove (local_mapped_attr_path (ctx, path, buffer));; + err =remove (local_mapped_attr_path (ctx, path, buffer));if (err <0 && errno !=ENOENT ) {/* * We didn't had the .virtfs_metadata file. May be file created
hw/i386/pc_q35.c +1 -1
@@ -128,7 +128,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args) q35_host->mch.ram_memory = ram_memory; q35_host->mch.pci_address_space = pci_memory; q35_host->mch.system_memory =get_system_memory (); - q35_host->mch.address_space_io =get_system_io ();; + q35_host->mch.address_space_io =get_system_io (); q35_host->mch.below_4g_mem_size = below_4g_mem_size; q35_host->mch.above_4g_mem_size = above_4g_mem_size;/* pci */
hw/intc/imx_avic.c +1 -1
@@ -370,7 +370,7 @@ static void imx_avic_reset(DeviceState *dev)static int imx_avic_init (SysBusDevice *dev) { -IMXAVICState *s =FROM_SYSBUS (IMXAVICState, dev);; +IMXAVICState *s =FROM_SYSBUS (IMXAVICState, dev);memory_region_init_io (&s->iomem, &imx_avic_ops, s,"imx_avic" ,0x1000 );sysbus_init_mmio (dev, &s->iomem);
hw/usb/host-linux.c +2 -2
@@ -651,7 +651,7 @@ static void usb_host_handle_reset(USBDevice *dev)trace_usb_host_reset (s->bus_num, s->addr); -usb_host_do_reset (s);; +usb_host_do_reset (s);usb_host_claim_interfaces (s,0 );usb_linux_update_endp_table (s);
@@ -1429,7 +1429,7 @@ static void usb_host_exit_notifier(struct Notifier *n, void *data)usb_host_release_port (s);if (s->fd !=-1 ) { -usb_host_do_reset (s);; +usb_host_do_reset (s); } }
qga/channel-win32.c +1 -1
@@ -268,7 +268,7 @@ static GIOStatus ga_channel_write(GAChannel *c, const char *buf, size_t size,GIOStatus ga_channel_write_all (GAChannel *c,const char *buf,size_t size) { -GIOStatus status =G_IO_STATUS_NORMAL ;; +GIOStatus status =G_IO_STATUS_NORMAL ;size_t count;while (size) {
Signature · 1 line
1.7.11.7
Quoted 1 line · Dong Xu Wang
Signed-off-by Dong Xu Wang <[email protected]>
Thank you Dong, (re)applied both patches to the trivial patch queue.
/mjt