Eric Blake <ebl...@redhat.com> writes: > On 11/26/2014 05:43 AM, Max Reitz wrote: >> On 2014-11-25 at 20:46, John Snow wrote: >>> From: Fam Zheng <f...@redhat.com> >>> >>> Signed-off-by: Fam Zheng <f...@redhat.com> >>> Signed-off-by: John Snow <js...@redhat.com> >>> --- >>> block.c | 35 +++++++++++++++++++++++++++++++---- >>> include/block/block.h | 4 ++++ >>> 2 files changed, 35 insertions(+), 4 deletions(-) >>> > >>> @@ -5406,7 +5431,9 @@ int64_t >>> bdrv_dbm_calc_def_granularity(BlockDriverState *bs) >>> int64_t bdrv_dirty_bitmap_granularity(BlockDriverState *bs, >>> BdrvDirtyBitmap *bitmap) >>> { >>> - return BDRV_SECTOR_SIZE << hbitmap_granularity(bitmap->bitmap); >>> + g_assert(BDRV_SECTOR_SIZE << hbitmap_granularity(bitmap->bitmap) >>> == \ >>> + bitmap->granularity); >> >> Do you really need that backslash? >> >> If you don't and remove it, or if you do and keep it, and with either >> "name ? g_strdup(name) : NULL" left as-is or replace by "g_strdup(name)": >> > > g_strdup(NULL) is safe, so 'name ? g_strdup(name) : NULL' is pointless > and can be written as 'g_strdup(name)' with no change in functionality.
Yes, please. See also: 80e0090 virtio: Drop superfluous conditionals around g_strdup() c14e984 vnc: Drop superfluous conditionals around g_strdup()